一个建议:
viewthread.php里面的修改.
作者直接把动作的判断放在了帖子的循环中,每多一个回复贴就循环多一次,造成资源浪费,减慢读贴速度.
我自己在楼主的基础上修改了一下.
1,viewthread.php
找到
- // nDesigner:仿4.0加入管理动作显示 Start [Author: 多口仔]
复制代码
在下面添加
- if($post['postcount']==1){
复制代码
找到
- // nDesigner:仿4.0加入管理动作显示 End [Author: 多口仔]
复制代码
在其上面添加
同时,我为自己添加了转移帖子的时候显示转移自哪个论坛的功能.
在楼主的基础上:
数据库升级:
- ALTER TABLE `cdb_threads ` ADD `threads_fromfid` SMALLINT( 6 ) UNSIGNED NOT NULL ;
复制代码
1,topicadmin.php
查找(原作者有三处要修改.可能我自己曾经改过所以我自己这文件只有两处,如果各位查找到三处的,请把三处都改):
- UPDATE $table_threads SET fid='$moveto', threads_moderate='1', threads_moderatetime='$timestamp', threads_moderator='$discuz_user', threads_moderatorid='$discuz_uid'
复制代码
在后面添加
2,viewthread.php
查找
- if($thread[threads_moderate] == 1) {
复制代码
在下面添加
- $query2= $db->query("SELECT name FROM $table_forums WHERE fid=$thread[threads_fromfid]");
- while($result = $db->fetch_array($query2))
- {
- $fromfid = $result['name'];
- }
复制代码
查找:
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_move]."";
复制代码
替换为:
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_move]."自 ".$fromfid;
复制代码
注意:如果增加显示转移自哪个论坛的功能,就必须进行本文最前面的修改,否则会多出很多查询拖慢速度,有一个版面内有多少个回贴就增加多少查询!
因此,viewthread.php的完整修改是:
- // nDesigner:仿4.0加入管理动作显示 Start [Author: 多口仔]
- if($post['postcount']==1){
- include language('templates');
- $thread['moderatetime'] = gmdate("$dateformat $timeformat", $thread['threads_moderatetime'] + $timeoffset * 3600);
- if($thread[threads_moderate] == 1) {
- $query2= $db->query("SELECT name FROM $table_forums WHERE fid=$thread[threads_fromfid]");
- while($result = $db->fetch_array($query2))
- {
- $fromfid = $result['name'];
- }
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_move]."自 ".$fromfid;
- } elseif ($thread[threads_moderate] == 3 && $thread[closed] == 1) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_close]."";
- } elseif ($thread[threads_moderate] == 3 && $thread[closed] == 0) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_open]."";
- } elseif ($thread[threads_moderate] == 4 && $thread[displayorder] > 0) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_top]."";
- } elseif ($thread[threads_moderate] == 4 && $thread[displayorder] == 0) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_top_del]."";
- } elseif ($thread[threads_moderate] == 5 && $thread[digest] > 0) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_digest]."";
- } elseif ($thread[threads_moderate] == 5 && $thread[digest] == 0) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_digest_del]."";
- } elseif ($thread[threads_moderate] == 6) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_highlight]."";
- } elseif ($thread[threads_moderate] == 7) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_split]."";
- } elseif ($thread[threads_moderate] == 8) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_merge]."";
- } elseif ($thread[threads_moderate] == 9) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_bump]."";
- } elseif ($thread[threads_moderate] == 10) {
- $modaction = "".$language['thread_moderate']." <a href=viewpro.php?uid=".$thread[threads_moderatorid]."> ".$thread[threads_moderator]."</a> ".$language['on']." ".$thread[moderatetime]." ".$language[thread_moderate_recount]."";
- }
- }
-
- // nDesigner:仿4.0加入管理动作显示 End [Author: 多口仔]
复制代码
[ 本帖最后由 xiori 于 2005-9-16 20:56 编辑 ] |