WenRou's Blog

新浪微薄腾讯微薄

最新碎语:测试图片碎语哦

您的位置:WenRou's Blog >Blog> WeCenter 3.0.2 问题收集

WeCenter 3.0.2 问题收集

WeCenter 3.0.2 问题收集

...
1、编辑器: 
       发表文章 可以评论(不带编辑器)
       发表问题可以回复(带编辑器) 
       编辑器的功能修改  static/js/editor/ckeditor目录
 
2、引入系统 JS 文件
    system/aws_controller.inc.php文件搜索'引入系统 JS 文件'
   其js文件地址位于static/js 

3、页头
view/default/global/header_meta.tpl.html

自定义页头加入下面的DIV
<div class="page-control">全局头部插入测试
</div>

4、页底部
views/default/global/footer.tpl.htm
找到: <div class="aw-footer aw-wecenter">
在后面加入代码,比如加入友情链接
<ol class="breadcrumb" >
<li><a target=_blank href=http://www.vpshz.com>vps合租网</a></li><li><a target=_blank href=http://www.wenrou.cn>温柔网</a><li><a class=btn btn-mini btn-success href=/article/11>申请链接</a></li>
</ol>

5、login登录页模版
    \views\default\account\
    js在\static\js\app\
    css在\static\css\default\


5、修改logo

(1).修改桌面版logo。在`/static/css/default/img/`文件里,有两个logo,logo.png是网站导航栏logo,login_logo是登陆注册页面显示的logo。
(2). 修改手机版logo。在`/static/mobile/img/`文件里,修改同上。
(3)CSS里面修改LOGO的宽度,要考虑到整个结构。
    .aw-logo{width:70px;height:40px;margin:9px 0 0 0;}
    width margin 改大。
   .aw-search-box width宽度调小点。
   比如按照比例将你自己的logo按比例缩小到高度等于36,假设你logo缩小后的长宽高为X:36
去static/css/default/common.css中查找这行:
.aw-logo a{display:block;width: 56px;height: 36px;background:url('img/logo.png') no-repeat;
将56修改成X
 
6、手机模板   view/mobile/
   邮件模板  views/default/global/email_template.tpl.htm

7、伪静态
第一步:在相应的conf文件中添加如下代码
location / {
if (!-e $request_filename)
{
rewrite (.*) /index.php;
}
}

或者
location / {
if (!-e $request_filename)
{
rewrite (.*) /index.php;

}
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
if (!-e $request_filename)
{
rewrite (.*) /index.php;
}
}

有朋友反映说推荐使用 try_files 替代 rewrite更好,比如
如下location / {
try_files $uri $uri/ /index.php$is_args$args;
}

第二步:上传..htaccess到网站根目录,其内容如下:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
 
8、InstantClick.js 预加载技术

鼠标悬停 hover (hover->click之间200ms左右)
鼠标按下 Mousedown (Mousedown->click之间100ms左右),
Touchstart 手机触碰
这两个事件之间通常有200ms的间隔,InstantClick 利用这个时间间隔预加载页面。这样当你点击页面的时候,其实页面已经加载到本地了,呈现当然也就会很快。
当然InstantClick 也使用了 Pjax: 
同时我试用了下,的确效果不错。如果你的博客需要实现Pjax,InstantClick会是个不错的选择。
使用方法:
下载instantclick.js 官网地址 http://instantclick.io/download 
使用
<script src="instantclick.min.js" data-no-instant></script>
<script data-no-instant>InstantClick.init();</script>
注:
data-no-instant的含义是,这个JS只会运行一次,需要根据自己的情况设置。
如果想避免不必要的预加载,关闭hover,启用Mousedown是个不错的选择,moursedown意味着已经点击链接
InstantClick也提供了几个事件可以设置。
change 页面更改完毕,即click触发加载后
fetch 页面开始预加载
receive 页面预加载完毕,即:hover或mousedown触发的预加载,但不一定会change,因为用户不一定click

实例
因为使用ajax,所以google ga不会统计PV,所以增加change方法
<script src="instantclick.min.js" data-no-instant></script>
<script data-no-instant>
/* Google Analytics code here, without ga('send', 'pageview') */
InstantClick.on('change', function() {
ga('send', 'pageview', location.pathname + location.search);
});
InstantClick.init();
</script>

---

转载请注明本文标题和链接:《WeCenter 3.0.2 问题收集

分享到:

发表评论

38 + 5 =
路人甲 表情
看不清楚?点图切换 Ctrl+Enter快速提交