可以的啊,那可能是你之前的数据表还在,没有删除
在Application/Common/Model/MessageModel.class.php中的353行左右找到
private function _initUserMessageSession($uids, $type)
然后将
private function _initUserMessageSession($uids, $type) { $messageTypeModel = M('MessageType'); $map['uid'] = array('in', $uids); $map['type'] = $type; $already_uids = $messageTypeModel->where($map)->field('uid')->select(); $already_uids = array_column($already_uids, 'uid'); $need_uids = array_diff($uids, $already_uids); $dataList = array(); foreach ($need_uids as $val) { S('MY_MESSAGE_SESSION_' . $val, null); $dataList[] = array('uid' => $val, 'type' => $type, 'status' => 1); } unset($val); if (count($dataList)) { $messageTypeModel->addAll($dataList); } return true; }
改为
private function _initUserMessageSession($uids, $type) { $messageTypeModel = M('MessageType'); $map['uid'] = array('in', $uids); $map['type'] = $type; $already_uids = $messageTypeModel->where($map)->field('uid')->select(); $already_uids = array_column($already_uids, 'uid'); if($already_uids == null) $already_uids = array(); $need_uids = array_diff($uids, $already_uids); $dataList = array(); foreach ($need_uids as $val) { S('MY_MESSAGE_SESSION_' . $val, null); $dataList[] = array('uid' => $val, 'type' => $type, 'status' => 1); } unset($val); if (count($dataList)) { $messageTypeModel->addAll($dataList); } return true; }
点击无反应是一个小BUG,应急修复方法如下:
在Application/Weibo/Static/js目录下找到weibo.js
在191行左右找到这一句:
this.find('#insert_image').attr('onclick', 'insert_image.showBox()');
然后注释掉即可,也可以自行用其他办法解决
这个的用途不是统一的啊,看你自己怎么用啊
在对应控制器的对应方法里啊
比如 网站首页 这个SEO规则
模块 控制器 方法分别是Home,Index,index
然后我把SEO标题,关键字,描述分别设置成{$home.title},{$home.keyword},{$home.describe}
然后在Application/Home/Controller/IndexController.class.php里面的index方法中加上
$home = array( 'title' => "OpenSNS", 'keyword' => 'OpenSNS', 'describe' => '开源社交系统', ); $this->assign('home',$home);
注意加在最后一行
$this->display('index');
的前面,并且保证当前使用的是聚合首页(因为不同类型的首页对应不同的模板)
然后保存->清除缓存
再打开网站首页,是不是发现标题已经变成了OpenSNS,
然后右键->查看网页源代码
<title>OpenSNS</title> <meta name="keywords" content="OpenSNS"/> <meta name="description" content="开源社交系统"/>
这就已经设置成功了啊
当然,除了自己定义的外,也可以调用其他模板里面的变量
修复ing