本帖最后由 shwan 于 2013-3-6 12:33 编辑
有同学说要改表头,分析后原方法不妥,因为该段SQL操作一处是insert,一处是replace。原来的代码如下 :- if(!DB::result_first("SELECT COUNT(*) FROM pre_forum_threadprofile WHERE global=1")) {
- DB::query("INSERT INTO `pre_forum_threadprofile` (`id`, `name`, `template`, `global`) VALUES
- (1, '默认方案', 'a:2:{s:4:"left";s:399:"{numbercard}\r\n{groupicon}<p>{*}</p>{/groupicon}\r\n{authortitle}<p><em>{*}</em></p>{/authortitle}\r\n{customstatus}<p class="xg1">{*}</p>{/customstatus}\r\n{star}<p>{*}</p>{/star}\r\n{upgradeprogress}<p>{*}</p>{/upgradeprogress}\r\n<dl class="pil cl">\r\n\t<dt>{baseinfo=credits,1}</dt><dd>{baseinfo=credits,0}</dd>\r\n</dl>\r\n{medal}<p class="md_ctrl">{*}</p>{/medal}\r\n<dl class="pil cl">{baseinfo=field_qq,0}</dl>";s:3:"top";s:82:"<dl class="cl">\r\n<dt>{baseinfo=credits,1}</dt><dd>{baseinfo=credits,0}</dd>\r\n</dl>";}', 1);");
- DB::query("REPLACE INTO pre_forum_bbcode VALUES ('2','2','qq','bb_qq.gif','<a href="http://wpa.qq.com/msgrd?V=3&Uin={1}&Site=[Discuz!]&from=discuz&Menu=yes" target="_blank"><img src="static/image/common/qq_big.gif" border="0"></a>','[qq]688888[/qq]','显示 QQ 在线状态,点这个图标可以和他(她)聊天','1','请输入 QQ 号码:<a href="" class="xi2" onclick="this.href=\'http://wp.qq.com/set.html?from=discuz&uin=\'+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(\'e_cst1_qq_param_1\').value" target="_blank" style="float:right;">设置QQ在线状态 </a>','1','21','1 2 3 10 11 12 13 14 15 16 17 18 19');");
- }
复制代码 正确的做法是:修改update.php第1703-1707行内容如下:- if(!DB::result_first("SELECT COUNT(*) FROM ".DB::table("forum_threadprofile")." WHERE global=1")) {
- DB::query("INSERT INTO ".DB::table("forum_threadprofile")." (`id`, `name`, `template`, `global`) VALUES
- (1, '默认方案', 'a:2:{s:4:"left";s:399:"{numbercard}\r\n{groupicon}<p>{*}</p>{/groupicon}\r\n{authortitle}<p><em>{*}</em></p>{/authortitle}\r\n{customstatus}<p class="xg1">{*}</p>{/customstatus}\r\n{star}<p>{*}</p>{/star}\r\n{upgradeprogress}<p>{*}</p>{/upgradeprogress}\r\n<dl class="pil cl">\r\n\t<dt>{baseinfo=credits,1}</dt><dd>{baseinfo=credits,0}</dd>\r\n</dl>\r\n{medal}<p class="md_ctrl">{*}</p>{/medal}\r\n<dl class="pil cl">{baseinfo=field_qq,0}</dl>";s:3:"top";s:82:"<dl class="cl">\r\n<dt>{baseinfo=credits,1}</dt><dd>{baseinfo=credits,0}</dd>\r\n</dl>";}', 1);");
- DB::query("REPLACE INTO ".DB::table("forum_bbcode")." VALUES ('2','2','qq','bb_qq.gif','<a href="http://wpa.qq.com/msgrd?V=3&Uin={1}&Site=[Discuz!]&from=discuz&Menu=yes" target="_blank"><img src="static/image/common/qq_big.gif" border="0"></a>','[qq]688888[/qq]','显示 QQ 在线状态,点这个图标可以和他(她)聊天','1','请输入 QQ 号码:<a href="" class="xi2" onclick="this.href=\'http://wp.qq.com/set.html?from=discuz&uin=\'+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(\'e_cst1_qq_param_1\').value" target="_blank" style="float:right;">设置QQ在线状态 </a>','1','21','1 2 3 10 11 12 13 14 15 16 17 18 19');");
- }
复制代码 |