Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

主题分类插件FOR Discuz系列正式版-索引专题分类板内分类话题分类19/1

[复制链接]
iioo2005 发表于 2005-8-7 21:22:52 | 显示全部楼层
我安装了回收站v1.0的插件,现在标准安装的问题解决,批量安装不成功,前面有安装成功的大大,可否指教一下,说清楚一点 “topicadmin.php”怎么修改?
附上我的 topicadmin.php

  1. <?php

  2. /*
  3. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. :: [DISCUZ!]  Crossday Discuz! Board                                    ::
  5. :: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com)                ::
  6. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7. :: Author:  Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
  8. :: Version: 2.5F   2004/10/01 05:15                                     ::
  9. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10. */
  11. //fix:  BY pk0909
  12. /*
  13. 1 对分割后的主题缺少html转义处理
  14. 2 跳转的url参数问题
  15. 3 批量删除主题时,没有删除对应附件
  16. */

  17. require './include/common.php';
  18. require_once DISCUZ_ROOT.'./include/post.php';
  19. require_once DISCUZ_ROOT.'./include/cache.php';
  20. //分区版主
  21. require DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';


  22. require $discuz_root.'./include/discuzcode.php';

  23. //全局定义短信内容之一
  24. $msg_2="

  25. 如有疑问,请查看[url=http://bbs.8to.cn/viewthread.php?tid=42042&fpage=1]社区守则[/url]以及各版块置顶的管理规则,或[url=http://bbs.8to.cn/forumdisplay.php?fid=20]向管理员反映[/url]。";

  26. //全局定义短信内容之一
  27. $jfkarmaoptions = '';
  28. $jf=$jfmaxkarmarate = "10";   //积分最高或最低限额设定

  29.                 $jfoffset = ceil($jfmaxkarmarate / 10);
  30.                 for($jfvote = - $jfmaxkarmarate + $jfoffset; $jfvote <= $jfmaxkarmarate; $jfvote += $jfoffset) {
  31.                         $jfvotenum = $jfvote > 0 ? '+'.$jfvote : $jfvote;
  32.                         if ($jfvote=="-1"){$selected="selected";}
  33.                         $jfkarmaoptions .= $jfvote ? "<option value="$jfvote" $selected>$jfvotenum</option>\n" : NULL;
  34.                 $selected="";
  35.                 }
  36.         unset($jfvote, $jfvotenum, $jfoffset);


  37. $lbkarmaoptions = '';
  38. $lb=$lbmaxkarmarate = "30";  //社区币最高或最低限额设定

  39.                 $lboffset = ceil($lbmaxkarmarate / 30);
  40.                 for($lbvote = - $lbmaxkarmarate + $lboffset; $lbvote <= $lbmaxkarmarate; $lbvote += $lboffset) {
  41.                         $lbvotenum = $lbvote > 0 ? '+'.$lbvote : $lbvote;
  42.                         if ($lbvote== "-1"){$selected="selected";}
  43.                         $lbkarmaoptions .= $lbvote ? "<option value="$lbvote" $selected>$lbvotenum</option>\n" : NULL;
  44.         $selected="";        }
  45.         unset($lbvote, $lbvotenum, $lboffset);



  46. ////操作原因,分值判断

  47. function ctrl_msg(){
  48.         global $title,$content,$docredit,$domoney,$msg,$jf,$lb;
  49.         $title = dhtmlspecialchars(censor(trim($title)));
  50.         $content = dhtmlspecialchars(censor(trim($content)));
  51.         $docredit = dhtmlspecialchars(censor(trim($docredit)));
  52.         $domoney = dhtmlspecialchars(censor(trim($domoney)));
  53.         $msg = trim(censor(parseurl($msg)));
  54.         if($title =="" and $content ==""){showmessage('admin_ctrl_invalid');}
  55.         if ($docredit >$jf or $docredit < -$jf or $domoney >$lb or $domoney < -$lb){showmessage('admin_ctrl2_invalid');}
  56. }
  57. ////操作原因,分值判断





  58. $discuz_action = 151;
  59. //回收站定义分论坛变量  2005-4-10
  60. $recyclefid = 123;

  61. $tid   = $tid ? $tid :'';
  62. $page  = intval($page);
  63. $fpage = intval($fpage);

  64. if($tid) {
  65.         $query = $db->query("SELECT * FROM $table_threads WHERE tid='$tid'");
  66.         $thread = $db->fetch_array($query);
  67.         $thread['subject'] .= $action == 'delthread' ? ", etc." : NULL;
  68. }

  69. if($forum['type'] == 'forum') {
  70.         $navigation = "&raquo; <a href="forumdisplay.php?fid=$fid&page=$fpage">$forum[name]</a> &raquo; <a href="viewthread.php?tid=$tid">$thread[subject]</a> ";
  71.         $navtitle = ' - '.strip_tags($forum['name']).' - '.$thread['subject'];
  72. } else {
  73.         $query = $db->query("SELECT name, fid, moderator FROM $table_forums WHERE fid='$forum[fup]'");
  74.         $fup = $db->fetch_array($query);
  75.         $navigation = "&raquo; <a href="forumdisplay.php?fid=$fup[fid]">$fup[name]</a> &raquo; <a href="forumdisplay.php?fid=$fid&page=$fpage">$forum[name]</a> &raquo; <a href="viewthread.php?tid=$tid">$thread[subject]</a> ";
  76.         $navtitle = ' - '.strip_tags($fup['name']).' - '.strip_tags($forum['name']).' - '.$thread['subject'];
  77. }

  78. if(!$discuz_user || !$discuz_pw || !modcheck($discuz_user)) {
  79.         showmessage('admin_nopermission', NULL, 'HALTED');
  80. }

  81. //=D25 Subject classification=Ver.2.5.0 by Aday=Start//        
  82. $subjectcate = "";
  83.                 $cates=explode("|",$forum[cates]);
  84.                 $i=count($cates);for($i = 0; $i < count($cates); $i++) {
  85.                                 $thecates1 = explode("_",$cates[$i]);if($thecates1[0]==$thread[cate]){$subjectcate .=                 

  86. "<option value="$thecates1[0]" selected >$thecates1[1]</option>";}else{
  87.                                 $subjectcate .= "<option value="$thecates1[0]">$thecates1[1]</option>"; }
  88.                         }
  89. //=D25 Subject classification=Ver.2.5.0 by Aday=End//        

  90. $fupadd = $fup ? "OR (fid='$fup[fid]' && type<>'group')" : NULL;

  91. if($action == 'moderate') {
  92.         if(!is_array($moderate) || !count($moderate)) {
  93.                 showmessage('admin_moderate_nothread');
  94.         }elseif(!$operation){
  95.                 showmessage('admin_moderate_nooperation');
  96.         }
  97.         $tids = implode_ids($moderate);
  98.         $query = $db->query("SELECT * FROM $table_threads WHERE tid IN($tids) ");
  99.         accesscheck($query);
  100.         $query = $db->query("SELECT * FROM $table_threads WHERE tid IN($tids) ");

  101.         if(!submitcheck('moderatesubmit')){
  102.                 $threadlist = array();
  103.                 while($thread = $db->fetch_array($query)) {
  104.                         if($thread['fid'] == $fid){
  105.                                 $thread['lastposterenc'] = rawurlencode($thread['lastposter']);
  106.                                 if($thread['attachment']) {
  107.                                         require_once DISCUZ_ROOT.'./include/attachment.php';
  108.                                         $thread['attachment'] = attachtype($thread['attachment']).' ';
  109.                                 } else {
  110.                                         $thread['attachment'] = '';
  111.                                 }
  112.                                 $thread[subject] = cutstr($thread[subject],77);
  113.                                 $thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
  114.                                 $thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);
  115.                                 $threadlist[] = $thread;
  116.                         }
  117.                 }
  118.                
  119.                 if(!$threadlist) showmessage('admin_moderate_nothread');

  120.                 if($operation == 'move') {
  121.                         require_once DISCUZ_ROOT.'./include/forum.php';
  122.                         $forumselect = forumselect();
  123.                 }
  124.                 include template('topicadmin_moderate');
  125.        
  126.         }else{
  127.        
  128.                 if($operation == 'move' && $allowmove) {
  129.                         if(!$moveto) {
  130.                                 showmessage('admin_move_invalid');
  131.                         }

  132.                        
  133. ctrl_msg();   //调用函数


  134.         $query= $db->query("SELECT name FROM $table_forums WHERE fid=$fid");
  135.         while($result = $db->fetch_array($query))
  136.         {
  137.             $czfirstfn = $result['name'];
  138.         }
  139.          
  140.         $query= $db->query("SELECT name FROM $table_forums WHERE fid=$moveto");
  141.         while($result = $db->fetch_array($query))
  142.         {
  143.             $czsecondfn = $result['name'];
  144.         }
  145. //帖子操作短信通知 hack by xiori 2005-3-18


  146. if($ynmsg==1)
  147.         {
  148. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid IN ($tids)");
  149. $czsubject="移动主题短消息通知";
  150. if($content !=""){$title=$content;}
  151. if ($msg !=""){
  152.         $msg="

  153. 以下为".$discuz_user."给您的附言:[color=blue]".$msg."[/color]";
  154.         }
  155.         while($memberid = $db->fetch_array($query)) {

  156. if ($updateur != "1") {
  157. $msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被转移,且进行了 积分$docredit, 率币$domoney 的操作!";
  158. }else{$msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被转移,没有对您的分值进行操作!";
  159. }

  160. $msg_3="\n\n你的贴子由\n\n $czfirstfn  版块\n\n移到\n\n $czsecondfn  版块";
  161. $msgtext=$msg_1.$msg.$msg_3.$msg_2;
  162.         $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
  163.                                 VALUES('$discuz_user', '$discuz_uid', '$memberid[authorid]', 'inbox', '1', '$czsubject', '$timestamp', '$msgtext')");
  164.                 if ($updateur != "1") {
  165. $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");   
  166.      }
  167.                 $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$memberid[authorid]'");       

  168.         }
  169.        
  170. } else{
  171. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid IN ($tids)");
  172.         while($memberid = $db->fetch_array($query)) {
  173. if ($updateur != "1") {
  174.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");  
  175. }
  176.         }
  177. }
  178. //帖子操作短信通知 hack by xiori 2005-3-18

  179.                         $displayorderadd = !$adminglobal ? ", displayorder='0'" : NULL;

  180.                         $db->query("UPDATE $table_threads SET fid='$moveto' $displayorderadd WHERE tid IN($tids)");
  181.                         $db->query("UPDATE $table_posts SET fid='$moveto' WHERE tid IN($tids) ");

  182.                         if ($forum['type'] == 'sub') {
  183.                                 $query= $db->query("SELECT fup FROM $table_forums WHERE fid='$fid' LIMIT 1");
  184.                                 $fup = $db->result($query, 0);
  185.                                 updateforumcount($fup);
  186.                         }
  187.                         modlog();
  188.                         updateforumcount($moveto);
  189.                         updateforumcount($fid);
  190.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");

  191.                 }elseif($operation == 'stick' && $allowtop){
  192.                        
  193.                         ctrl_msg();   //调用函数
  194.                         if($level < 0 || $level > 3) {
  195.                                 showmessage('undefined_action');
  196.                         }
  197. //帖子操作短信通知 hack by xiori 2005-3-18


  198. if($ynmsg==1)
  199.         {
  200. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid IN ($tids)");
  201. if($content !=""){$title=$content;}
  202. if ($msg !=""){
  203.         $msg="

  204. 以下为".$discuz_user."给您的附言:[color=blue]".$msg."[/color]";
  205.         }
  206.         while($memberid = $db->fetch_array($query)) {

  207. if($level=="0"){if ($updateur != "1") {
  208. $msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被解除置顶,且进行了 积分$docredit, 率币$domoney 的操作!";
  209. $action_m="解除置顶";
  210.         }else{$msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被解除置顶,没有对您的分值进行操作!";
  211. $action_m="解除置顶";}
  212. }else{if ($updateur != "1") {
  213. $msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被置顶,且进行了 积分$docredit, 率币$domoney 的操作!";
  214. $action_m="置顶";}else{$msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被置顶,没有对您的分值进行操作!";
  215. $action_m="置顶";}}

  216. $msgtext=$msg_1.$msg.$msg_2;
  217. $czsubject=$action_m."主题短消息通知";

  218.         $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
  219.                                 VALUES('$discuz_user', '$discuz_uid', '$memberid[authorid]', 'inbox', '1', '$czsubject', '$timestamp', '$msgtext')");
  220.         if ($updateur != "1") {
  221.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");   
  222.      }
  223.                                 $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$memberid[authorid]'");       

  224.         }
  225.        
  226. } else{
  227. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid IN ($tids)");
  228.         while($memberid = $db->fetch_array($query)) {
  229. if ($updateur != "1") {
  230.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");  
  231. }
  232.         }
  233. }
  234. //帖子操作短信通知 hack by xiori 2005-3-18



  235.                         $db->query("UPDATE $table_threads SET displayorder='$level' WHERE tid IN ($tids)");
  236.                         modlog();

  237. if ($level < 2) {
  238.         $db->query("DELETE FROM {$tablepre}topthreads WHERE tid IN ($tids)");
  239.         if ($db->affected_rows()) updatecache('topthreads');
  240. } else {
  241.         $tidArray = explode(',', $tids);
  242.         foreach ($tidArray as $tmp) {
  243.                 $db->query("INSERT INTO {$tablepre}topthreads (tid) VALUES ($tmp)", 'SILENT');
  244.         }
  245.         updatecache('topthreads');
  246. }
  247.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");

  248.                 }elseif($operation == 'delete' && $allowdelpost) {

  249. //回收站修改开始  2005-4-10
  250. if($fid==$recyclefid) {

  251.                        
  252. ctrl_msg();   //调用函数

  253.                 $uids = $comma = '';
  254.                         $haveattach = 0;
  255.                         $query = $db->query("SELECT authorid ,aid FROM $table_posts WHERE tid IN ($tids)");
  256.                         while($post = $db->fetch_array($query)) {
  257.                                 $uids .= "$comma$post[authorid]";
  258.                                 $comma = ',';
  259.                                 if ($post['aid']) $haveattach++;
  260.                         }
  261.                         updatemember('-', $uids, '0');
  262.             
  263.                         if ($haveattach){
  264.                                 $query = $db->query("SELECT attachment FROM $table_attachments WHERE tid IN ($tids)");
  265.                                 while($attach = $db->fetch_array($query)) {
  266.                                         @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
  267.                                 }
  268.                                 $db->query("DELETE FROM $table_attachments WHERE tid IN ($tids)");
  269.                         }
  270.                        
  271. //帖子操作短信通知 hack by xiori 2005-3-18


  272. if($ynmsg==1)
  273.         {
  274. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid IN ($tids)");
  275. if($content !=""){$title=$content;}
  276. if ($msg !=""){
  277.         $msg="

  278. 以下为".$discuz_user."给您的附言:[color=blue]".$msg."[/color]";
  279.         }
  280.         while($memberid = $db->fetch_array($query)) {

  281. if ($updateur != "1") {
  282. $msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被删除,且进行了 积分$docredit, 率币$domoney 的操作!";
  283. }else{$msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被删除,没有对您的分值进行操作!";
  284. }

  285. $msgtext=$msg_1.$msg.$msg_2;
  286. $czsubject=$action_m."主题短消息通知";
  287.         $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
  288.                                 VALUES('$discuz_user', '$discuz_uid', '$memberid[authorid]', 'inbox', '1', '$czsubject', '$timestamp', '$msgtext')");
  289.         if ($updateur != "1") {
  290.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");   
  291.      }
  292.                                 $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$memberid[authorid]'");       

  293.         }
  294.        
  295. } else{
  296. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid IN ($tids)");
  297.         while($memberid = $db->fetch_array($query)) {
  298. if ($updateur != "1") {
  299.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");  
  300. }
  301.         }
  302. }
  303. //帖子操作短信通知 hack by xiori 2005-3-18

  304.                         $db->query("DELETE FROM $table_threads WHERE tid IN ($tids)");
  305.                         $db->query("DELETE FROM $table_polls WHERE tid IN ($tids)");
  306.                         $db->query("DELETE FROM $table_posts WHERE tid IN ($tids)");
  307. $db->query("DELETE FROM {$tablepre}topthreads WHERE tid IN ($tids)");
  308. if ($db->affected_rows()) updatecache('topthreads');
  309.                 if ($forum['type'] == 'sub') {
  310.         updateforumcount($fup['fid']);
  311. }

  312.                         updateforumcount($fid);

  313.                         modlog();
  314. $db->query("DELETE FROM {$tablepre}topthreads WHERE tid='$tid'");
  315. if ($db->affected_rows()) updatecache('topthreads');
  316.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");
  317. } else {
  318.                         $displayorderadd = !$adminglobal ? ", displayorder='0'" : NULL;

  319.                         $db->query("UPDATE $table_threads SET fid='$recyclefid' $displayorderadd WHERE tid IN($tids)");
  320.                         $db->query("UPDATE $table_posts SET fid='$recyclefid' WHERE tid IN($tids) ");

  321.                         if ($forum['type'] == 'sub') {
  322.                                 $query= $db->query("SELECT fup FROM $table_forums WHERE fid='$fid' LIMIT 1");
  323.                                 $fup = $db->result($query, 0);
  324.                                 updateforumcount($fup);
  325.                         }
  326.                         modlog();
  327.                         updateforumcount($recyclefid);
  328.                         updateforumcount($fid);
  329.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");
  330. }
  331. //回收站修改结束  2005-4-10

  332.                 }elseif($operation == 'close' && $allowclose){
  333.                        
  334.                         ctrl_msg();   //调用函数
  335.                         $close = $type ? 1 : 0;
  336. //帖子操作短信通知 hack by xiori 2005-3-18


  337. if($ynmsg==1)
  338.         {
  339. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid IN ($tids)");
  340. if($content !=""){$title=$content;}
  341. if ($msg !=""){
  342.         $msg="

  343. 以下为".$discuz_user."给您的附言:[color=blue]".$msg."[/color]";
  344.         }
  345.         while($memberid = $db->fetch_array($query)) {

  346. if($type=="0"){
  347. if ($updateur != "1") {
  348. $msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被解除锁定,且进行了 积分$docredit, 率币$domoney 的操作!";$action_m="解除锁定";
  349. }else{$msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被解除锁定,没有对您的分值进行操作!";$action_m="解除锁定";
  350. }
  351. }else{if ($updateur != "1") {
  352. $msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被锁定,且进行了 积分$docredit, 率币$domoney 的操作!";$action_m="锁定";
  353. }else{$msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被锁定,没有对您的分值进行操作!";$action_m="锁定";
  354. }}


  355. $msgtext=$msg_1.$msg.$msg_2;
  356. $czsubject=$action_m."主题短消息通知";

  357.         $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
  358.                                 VALUES('$discuz_user', '$discuz_uid', '$memberid[authorid]', 'inbox', '1', '$czsubject', '$timestamp', '$msgtext')");
  359.         if ($updateur != "1") {
  360.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");   
  361.      }
  362.                                 $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$memberid[authorid]'");       

  363.         }
  364.        
  365. } else{
  366. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid IN ($tids)");
  367.         while($memberid = $db->fetch_array($query)) {
  368. if ($updateur != "1") {
  369.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");  
  370. }
  371.         }
  372. }
  373. //帖子操作短信通知 hack by xiori 2005-3-18
  374.                         $db->query("UPDATE $table_threads SET closed='$close' WHERE tid in($tids)");
  375.                         modlog();
  376.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");

  377.                 }
  378. /*取消批量加入精华                       
  379.                 elseif($operation == 'digest' && $allowdigest){
  380.                         if($level < 0 || $level > 3) {
  381.                                 showmessage('undefined_action', NULL, 'HALTED');
  382.                         }
  383.                         while($thread = $db->fetch_array($query)) {
  384.                                 if ($thread['fid'] == $fid && $thread['digest']<>$level){
  385.                                         $digest_mark=($level-intval($thread['digest']))*$digestcredits;
  386.                                         $db->query("UPDATE $table_threads SET digest='$level' WHERE tid='$thread[tid]'");
  387.                                         if($digest_mark && $discuz_uid != $thread[authorid]) {
  388.                                                 $db->query("UPDATE $table_members SET credit=credit".($digest_mark > 0 ? '+' : '')."$digest_mark WHERE uid='$thread[authorid]'");
  389.                                         }
  390.                                 }
  391.                         }
  392.                         modlog();
  393.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");
  394.                 }
  395.                
  396. 取消批量加入精华 */               
  397.                 else{
  398.                         showmessage('admin_nopermission', NULL, 'HALTED');
  399.                 }
  400.         }

  401. } elseif($action == 'delpost' && $allowdelpost) {

  402.         if(!is_array($delete) || !count($delete)) {
  403.                 showmessage('admin_delpost_invalid');
  404.         }

  405.         if(!submitcheck('delpostsubmit')) {

  406.                 $query = $db->query("SELECT COUNT(*) FROM $table_posts WHERE tid='$tid'");
  407.                 if(count($delete) < $db->result($query, 0)) {

  408.                         $deleteid = '';
  409.                         foreach($delete as $id) {
  410.                                 $deleteid .= '<input type="hidden" name="delete[]" value="'.$id.'">';
  411.                         }

  412.                         include template('topicadmin_delpost');
  413.                        
  414.                 } else {
  415.                         header("Location: {$boardurl}topicadmin.php?action=delete&fid=$fid&tid=$tid&page=$page&fpage=$fpage");
  416.                 }

  417.         } else {
  418. //回收站修改开始 2005-4-10
  419. if($fid==$recyclefid) {



  420.                 $pids = implode_ids( $delete );
  421.                 ctrl_msg();   //调用函数

  422.                 $uids = $comma = '';
  423.                 $actionpost = $totalpost = $aids = 0;
  424.                 $query = $db->query("SELECT pid, authorid, aid FROM $table_posts WHERE tid='$tid'");
  425.                 $totalpost = $db->num_rows($query);
  426.                 while($post = $db->fetch_array($query)) {
  427.                         if (in_array($post[pid], $delete)){
  428.                                 $uids .= "$comma$post[authorid]";
  429.                                 $comma = ',';
  430.                                 $actionpost ++;
  431.                                 if ($post['aid']) $aids .=','.$post[pid];
  432.                         }
  433.                 }

  434.                 if ($actionpost < 1) {
  435.                         showmessage('admin_delpost_invalid');
  436.                 }elseif($actionpost <> count($delete)){
  437.                         showmessage('admin_moderate_accesserror', NULL, 'HALTED');
  438.                 }elseif($actionpost >= $totalpost ){
  439.                         header("Location: {$boardurl}topicadmin.php?action=delete&fid=$fid&tid=$tid&page=$page&fpage=$fpage");
  440.                 }
  441.                
  442.                 updatemember('-', $uids, '0');

  443. //帖子操作短信通知 hack by xiori 2005-3-18


  444. if($ynmsg==1)
  445.         {
  446. $query = $db->query("SELECT authorid, subject FROM $table_posts WHERE pid IN ($pids)");
  447. $czsubject="删除帖子短消息通知";
  448. if($content !=""){$title=$content;}
  449. if ($msg !=""){
  450.         $msg="

  451. 以下为".$discuz_user."给您的附言:[color=blue]".$msg."[/color]";
  452.         }
  453.         while($memberid = $db->fetch_array($query)) {

  454. if ($updateur != "1") {
  455. $msg_1="您在帖子“".$temsubject."”的回贴因[b] ".$title." [/b]而被删除,且进行了 积分$docredit, 率币$domoney 的操作!";
  456. }else{$msg_1="您在帖子“".$temsubject."”的回贴因[b] ".$title." [/b]而被删除,没有对您的分值进行操作!";
  457. }

  458. $msgtext=$msg_1.$msg.$msg_2;
  459.         $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
  460.                                 VALUES('$discuz_user', '$discuz_uid', '$memberid[authorid]', 'inbox', '1', '$czsubject', '$timestamp', '$msgtext')");
  461.                 if ($updateur != "1") {
  462. $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");   
  463.      }
  464.                 $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$memberid[authorid]'");       

  465.         }
  466.        
  467. } else{
  468. $query = $db->query("SELECT authorid FROM $table_posts WHERE pid IN ($pids)");
  469.         while($memberid = $db->fetch_array($query)) {
  470. if ($updateur != "1") {
  471.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");  
  472. }
  473.         }
  474. }
  475. //帖子操作短信通知 hack by xiori 2005-3-18
  476.                 if ($aids){
  477.                         require_once DISCUZ_ROOT.'./include/attachment.php';
  478.                         $query = $db->query("SELECT pid, attachment, filetype FROM $table_attachments WHERE pid IN ($aids)");
  479.                         while($attach = $db->fetch_array($query)) {
  480.                                         @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
  481.                         }
  482.                         $db->query("DELETE FROM $table_attachments WHERE pid IN ($aids)");
  483.                         updatethread_type($tid , $thread['attachment']);
  484.                 }

  485.                 $db->query("DELETE FROM $table_posts WHERE pid IN ($pids)");
  486.                 updatethreadcount($tid);
  487.                 updateforumcount($fid);

  488.                 modlog();
  489.                 showmessage('admin_succeed', "viewthread.php?tid=$tid&page=$page&fpage=$fpage");

  490. } else {
  491.                 $pids = implode_ids( $delete );

  492.                 $uids = $comma = '';
  493.                 $actionpost = $totalpost = $aids = 0;
  494.                 $query = $db->query("SELECT pid, aid FROM $table_posts WHERE tid='$tid'");
  495.                 $totalpost = $db->num_rows($query);
  496.                 while($post = $db->fetch_array($query)) {
  497.                         if (in_array($post[pid], $delete)){
  498.                                 $actionpost ++;
  499.                                 if ($post['aid']) $aids .=','.$post[pid];
  500.                         }
  501.                 }

  502.                 if ($actionpost < 1) {
  503.                         showmessage('admin_delpost_invalid');
  504.                 }elseif($actionpost <> count($delete)){
  505.                         showmessage('admin_moderate_accesserror', NULL, 'HALTED');
  506.                 }elseif($actionpost >= $totalpost ){
  507.                         header("Location: {$boardurl}topicadmin.php?action=delete&fid=$fid&tid=$tid&page=$page&fpage=$fpage");
  508.                 }
  509.                 if($forum['type'] == 'forum') {
  510.                         $czsubject = "$forum[name] --- $thread[subject] 回帖删除记录";
  511.                 } else {
  512.                         $czsubject = "$fup[name] --- $thread[subject] 回帖删除记录";
  513.                 }
  514.                 $czmessage="$discuz_user 进行了删除回帖操作。删除回帖如下。\n \n";
  515.                 $czmessage.="原主题地址:{$boardurl}viewthread.php?tid=$thread[tid]&fpage=1";

  516.                 $db->query("INSERT INTO $table_threads (fid, creditsrequire, iconid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, poll, attachment)
  517.                 VALUES ('$recyclefid', '0', '0', '$discuz_user', '$discuz_uid', '$czsubject', '$thread[dateline]', '$timestamp', '$discuz_user', '0', '0', '0', '0')");
  518.                 $cztid = $db->insert_id();

  519.                 $db->query("INSERT INTO $table_posts (fid, tid, aid, author, authorid, subject, dateline, message, useip, usesig, bbcodeoff, smileyoff, parseurloff)
  520.                 VALUES ('$recyclefid', '$cztid', '0', '$discuz_user', '$discuz_uid', '$czsubject', '$thread[dateline]', '$czmessage', '$onlineip', '1', '0', '0', '0')");

  521.                 if ($aids){
  522.                         require_once DISCUZ_ROOT.'./include/attachment.php';
  523.                         $query = $db->query("UPDATE $table_attachments SET tid='$cztid' WHERE pid IN ($aids)");
  524.                         updatethread_type($cztid , $thread['attachment']);
  525.                 }

  526.                 $db->query("UPDATE $table_posts SET fid='$recyclefid', tid='$cztid' WHERE pid IN ($pids)");

  527.                 if ($forum['type'] == 'sub') {
  528.                         $query= $db->query("SELECT fup FROM $table_forums WHERE fid='$fid' LIMIT 1");
  529.                         $fup = $db->result($query, 0);
  530.                         updateforumcount($fup);
  531.                 }

  532.                 updatethreadcount($tid);
  533.                 updateforumcount($fid);
  534.                 updatethreadcount($cztid);
  535.                 updateforumcount($recyclefid);

  536.                 modlog();
  537.                 showmessage('admin_succeed', "viewthread.php?tid=$tid&page=$page&fpage=$fpage");
  538. }
  539. //回收站修改结束  2005-4-10

  540.         }

  541. } elseif($action == 'highlight' && $allowhighlight) {
  542.         if(!submitcheck('highlightsubmit')) {

  543.                 $string = sprintf('%02d', $thread['highlight']);
  544.                 $stylestr = sprintf('%03b', $string[0]);

  545.                 for($i = 1; $i <= 3; $i++) {
  546.                         $stylecheck[$i] = $stylestr[$i - 1] ? 'checked' : NULL;
  547.                 }
  548.                 $colorcheck = array($string[1] => 'checked');
  549.                
  550.                 include template('topicadmin_highlight');

  551.         } else {

  552.                 $stylebin = '';
  553.                 for($i = 1; $i <= 3; $i++) {
  554.                         $stylebin .= empty($highlight_style[$i]) ? '0' : '1';
  555.                 }
  556.                 $highlight_style = bindec($stylebin);

  557.                 if($highlight_style < 0 || $highlight_style > 7 || $highlight_color < 0 || $highlight_color > 8) {
  558.                         showmessage('undefined_action', NULL, 'HALTED');
  559.                 }
  560.                 $db->query("UPDATE $table_threads SET highlight='$highlight_style$highlight_color' WHERE tid='$tid'");

  561.                 modlog();
  562.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  563.         }

  564. } elseif($action == 'digest' && $allowdigest) {
  565.         if(!submitcheck('digestsubmit')) {

  566.                 include template('topicadmin_digest');

  567.         } else {

  568.                 if($level < 0 || $level > 3) {
  569.                         showmessage('undefined_action', NULL, 'HALTED');
  570.                 }

  571.                 $db->query("UPDATE $table_threads SET digest='$level' WHERE tid='$tid'");

  572.                         ctrl_msg();   //调用函数
  573. //帖子操作短信通知 hack by xiori 2005-3-18


  574. if($ynmsg==1)
  575.         {
  576. if($content !=""){$title=$content;}
  577. if ($msg !=""){
  578.         $msg="

  579. 以下为".$discuz_user."给您的附言:[color=blue]".$msg."[/color]";
  580.         }

  581. if($level > 0){
  582. if ($updateur != "1") {
  583. $msg_1="您发表的帖子“".$temsubject."“因[b] ".$title." [/b]而被加入了精华,且进行了 积分$docredit, 率币$domoney 的操作!";$action_m="加入精华";
  584. }else{$msg_1="您发表的帖子“".$temsubject."“因[b] ".$title." [/b]而被加入精华,没有对您的分值进行操作!";$action_m="加入精华";
  585. }
  586. }else{if ($updateur != "1") {
  587. $msg_1="您发表的帖子“".$temsubject."“因[b] ".$title." [/b]而被解除精华,且进行了 积分$docredit, 率币$domoney 的操作!";$action_m="解除精华";
  588. }else{$msg_1="您发表的帖子“".$temsubject."“因[b] ".$title." [/b]而被解除精华,没有对您的分值进行操作!";$action_m="解除精华";
  589. }}


  590. $msgtext=$msg_1.$msg.$msg_2;
  591. $czsubject=$action_m."短消息通知";

  592.         $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
  593.                                 VALUES('$discuz_user', '$discuz_uid', '$thread[authorid]', 'inbox', '1', '$czsubject', '$timestamp', '$msgtext')");
  594.        
  595.         if ($updateur != "1") {
  596.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$thread[authorid]'");   
  597.      }
  598.                                 $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$thread[authorid]'");       

  599.        
  600.        
  601. } else{
  602. if ($updateur != "1") {
  603.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$thread[authorid]'");  
  604. }
  605.         }

  606. //帖子操作短信通知 hack by xiori 2005-3-18

  607. /*        禁止根据精华级别进行加积分


  608.                 $digest_mark=($level-intval($thread['digest']))*$digestcredits;

  609.                 if($digest_mark && $discuz_uid != $thread['authorid'] ) {
  610.                         $db->query("UPDATE $table_members SET credit=credit".($digest_mark > 0 ? '+' : '')."$digest_mark WHERE uid='$thread[authorid]'");
  611.                 }
  612. */
  613.                 modlog();
  614.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  615.         }

  616. } elseif($action == 'recount') {

  617.         $query = $db->query("SELECT COUNT(*) FROM $table_posts WHERE tid='$tid'");
  618.         $replies = $db->result($query, 0) - 1;

  619.         $query  = $db->query("SELECT author, dateline FROM $table_posts WHERE tid='$tid' ORDER BY dateline DESC LIMIT 1");
  620.         $post = $db->fetch_array($query);

  621.         $db->query("UPDATE $table_threads SET replies='$replies', lastpost='$post[dateline]', lastposter='".addslashes($post['author'])."' WHERE tid='$tid'");
  622.         showmessage('admin_succeed', "viewthread.php?tid=$tid&fpage=$fpage");

  623. } elseif($action == 'delete'  && $allowdelpost) {
  624.         if(!submitcheck('deletesubmit')) {

  625.                 include template('topicadmin_delete');

  626.         } else {
  627. //回收站修改开始 2005-4-10
  628. if($fid==$recyclefid) {
  629.                         ctrl_msg();   //调用函数

  630.                 $uids = $comma = '';
  631.                 $query = $db->query("SELECT authorid,aid FROM $table_posts WHERE tid='$tid'");
  632.                 $aids = 0;
  633.                 while($post = $db->fetch_array($query)) {
  634.                         $uids .= "$comma$post[authorid]";
  635.                         $comma = ',';
  636.                         if ($post['aid']) $aids++;
  637.                 }
  638.                 updatemember('-', $uids, '0');



  639. if($ynmsg==1)
  640.         {
  641. $czsubject="删除主题短消息通知";
  642. if($content !=""){$title=$content;}
  643. if ($msg !=""){
  644.         $msg="

  645. 以下为".$discuz_user."给您的附言:[color=blue]".$msg."[/color]";
  646.         }
  647. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid='$tid'");
  648.         while($memberidz = $db->fetch_array($query)) {
  649. if ($updateur != "1") {
  650. $msg_1="您发表的帖子“".$memberidz[subject]."“因[b] ".$title." [/b]而被删除,且进行了 积分$docredit, 率币$domoney 的操作!";
  651. }else{$msg_1="您发表的帖子“".$memberidz[subject]."“因[b] ".$title." [/b]而被删除,没有对您的分值进行操作!";
  652. }

  653. $msgtext=$msg_1.$msg.$msg_2;
  654.         $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
  655.                                 VALUES('$discuz_user', '$discuz_uid', '$memberidz[authorid]', 'inbox', '1', '$czsubject', '$timestamp', '$msgtext')");
  656.                                         $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$memberidz[authorid]'");                }
  657.   

  658. $query = $db->query("SELECT authorid, subject FROM $table_posts WHERE tid='$tid'");

  659.         while($memberid = $db->fetch_array($query)) {

  660. if ($updateur != "1") {
  661.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");   
  662.      }
  663.         }
  664.        
  665. } else{
  666. $query = $db->query("SELECT authorid, subject FROM $table_posts WHERE tid='$tid'");
  667.         while($memberid = $db->fetch_array($query)) {
  668. if ($updateur != "1") {
  669.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");  
  670. }
  671.         }
  672. }
  673. //帖子操作短信通知 hack by xiori 2005-3-18



  674.                 $db->query("DELETE FROM $table_threads WHERE tid='$tid'");
  675.                 $db->query("DELETE FROM $table_posts WHERE tid='$tid'");
  676.                 $db->query("DELETE FROM $table_polls WHERE tid='$tid'");
  677.                 if ($aids){
  678.                         $query = $db->query("SELECT attachment FROM $table_attachments WHERE tid='$tid'");
  679.                         while($attach = $db->fetch_array($query)) {
  680.                                 @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
  681.                         }
  682.                         $db->query("DELETE FROM $table_attachments WHERE tid='$tid'");
  683.                 }
  684.                
  685.                 updateforumcount($fid);
  686.                 if ($forum['type'] == 'sub') {
  687.                         updateforumcount($fup['fid']);
  688.                 }

  689.                 modlog();
  690.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  691. } else {
  692.                 $displayorderadd = !$adminglobal ? ", displayorder='0'" : NULL;
  693.                 $db->query("UPDATE $table_threads SET fid='$recyclefid' $displayorderadd WHERE tid='$tid' AND fid='$fid'");
  694.                 $db->query("UPDATE $table_posts SET fid='$recyclefid' WHERE tid='$tid' AND fid='$fid'");
  695.                 if ($forum['type'] == 'sub') {
  696.                         $query= $db->query("SELECT fup FROM $table_forums WHERE fid='$fid' LIMIT 1");
  697.                         $fup = $db->result($query, 0);
  698.                         updateforumcount($fup);
  699.                 }
  700.                 modlog();
  701.                 updateforumcount($recyclefid);
  702.                 updateforumcount($fid);
  703.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");
  704. }
  705. //回收站修改结束 2005-4-10
  706. //=D25 Subject classification=Ver.2.5.0 by Aday=Start//        
  707.                 }elseif($operation == 'cate' && $allowmove){
  708.                         accesscheck($query);
  709.                         if(!cate) {
  710.                                 showmessage('admin_cate_invalid');
  711.                         }
  712.                         $db->query("UPDATE $table_threads SET cate='$cate' WHERE  (tid IN ($tids)) AND fid='$fid'");
  713.                         modlog();
  714.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page&cateid=$cate");
  715. //=D25 Subject classification=Ver.2.5.0 by Aday=End//        
  716.         }

  717. } elseif($action == 'close' && $allowclose) {

  718.         if(!submitcheck('closesubmit')) {

  719.                 include template('topicadmin_openclose');

  720.         } else {
  721.                 ctrl_msg();   //调用函数
  722.                 $openclose = $thread['closed'] ? 0 : 1;
  723.                 $db->query("UPDATE $table_threads SET closed='$openclose' WHERE tid='$tid' AND fid='$fid'");

  724. //帖子操作短信通知 hack by xiori 2005-3-18


  725. if($ynmsg==1)
  726.         {
  727. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid='$tid' AND fid='$fid'");
  728. if($content !=""){$title=$content;}
  729. if ($msg !=""){
  730.         $msg="

  731. 以下为".$discuz_user."给您的附言:[color=blue]".$msg."[/color]";
  732.         }
  733.         while($memberid = $db->fetch_array($query)) {

  734. if($type=="0"){
  735. if ($updateur != "1") {
  736. $msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被解除锁定,且进行了 积分$docredit, 率币$domoney 的操作!";$action_m="解除锁定";
  737. }else{$msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被解除锁定,没有对您的分值进行操作!";$action_m="解除锁定";
  738. }
  739. }else{if ($updateur != "1") {
  740. $msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被锁定,且进行了 积分$docredit, 率币$domoney 的操作!";$action_m="锁定";
  741. }else{$msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被锁定,没有对您的分值进行操作!";$action_m="锁定";
  742. }}


  743. $msgtext=$msg_1.$msg.$msg_2;
  744. $czsubject=$action_m."主题短消息通知";

  745.         $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
  746.                                 VALUES('$discuz_user', '$discuz_uid', '$memberid[authorid]', 'inbox', '1', '$czsubject', '$timestamp', '$msgtext')");
  747.         if ($updateur != "1") {
  748.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");   
  749.      }
  750.                                 $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$memberid[authorid]'");       

  751.         }
  752.        
  753. } else{
  754. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid='$tid' AND fid='$fid'");
  755.         while($memberid = $db->fetch_array($query)) {
  756. if ($updateur != "1") {
  757.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");  
  758. }
  759.         }
  760. }
  761. //帖子操作短信通知 hack by xiori 2005-3-18



  762.                 modlog();
  763.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");
  764.         }

  765. } elseif($action == 'move'  && $allowmove) {

  766.         if(!submitcheck('movesubmit')) {

  767.                 require_once DISCUZ_ROOT.'./include/forum.php';

  768.                 $forumselect = forumselect();
  769.                 include template('topicadmin_move');

  770.         } else {

  771.                 if(!$moveto) {
  772.                         showmessage('admin_move_invalid');
  773.                 }


  774.                 $displayorderadd = !$adminglobal ? ", displayorder='0'" : NULL;

  775. ctrl_msg();   //调用函数


  776.         $query= $db->query("SELECT name FROM $table_forums WHERE fid=$fid");
  777.         while($result = $db->fetch_array($query))
  778.         {
  779.             $czfirstfn = $result['name'];
  780.         }
  781.          
  782.         $query= $db->query("SELECT name FROM $table_forums WHERE fid=$moveto");
  783.         while($result = $db->fetch_array($query))
  784.         {
  785.             $czsecondfn = $result['name'];
  786.         }
  787. //帖子操作短信通知 hack by xiori 2005-3-18


  788. if($ynmsg==1)
  789.         {
  790. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid='$tid' AND fid='$fid'");
  791. $czsubject="移动主题短消息通知";
  792. if($content !=""){$title=$content;}
  793. if ($msg !=""){
  794.         $msg="

  795. 以下为".$discuz_user."给您的附言:[color=blue]".$msg."[/color]";
  796.         }
  797.         while($memberid = $db->fetch_array($query)) {

  798. if ($updateur != "1") {
  799. $msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被转移,且进行了 积分$docredit, 率币$domoney 的操作!";
  800. }else{$msg_1="您发表的帖子“".$memberid[subject]."“因[b] ".$title." [/b]而被转移,没有对您的分值进行操作!";
  801. }

  802. $msg_3="\n\n你的贴子由\n\n $czfirstfn  版块\n\n移到\n\n $czsecondfn  版块";
  803. $msgtext=$msg_1.$msg.$msg_3.$msg_2;
  804.         $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
  805.                                 VALUES('$discuz_user', '$discuz_uid', '$memberid[authorid]', 'inbox', '1', '$czsubject', '$timestamp', '$msgtext')");
  806.                 if ($updateur != "1") {
  807. $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");   
  808.      }
  809.                 $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$memberid[authorid]'");       

  810.         }
  811.        
  812. } else{
  813. $query = $db->query("SELECT authorid, subject FROM $table_threads WHERE tid='$tid' AND fid='$fid'");
  814.         while($memberid = $db->fetch_array($query)) {
  815. if ($updateur != "1") {
  816.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");  
  817. }
  818.         }
  819. }
  820. //帖子操作短信通知 hack by xiori 2005-3-18




  821.                 if($type == 'normal') {
  822.                         $db->query("UPDATE $table_threads SET fid='$moveto' $displayorderadd WHERE tid='$tid' AND fid='$fid'");
  823.                         $db->query("UPDATE $table_posts SET fid='$moveto' WHERE tid='$tid' AND fid='$fid'");
  824.                 }

  825.                 if ($forum['type'] == 'sub') {
  826.                         $query= $db->query("SELECT fup FROM $table_forums WHERE fid='$fid' LIMIT 1");
  827.                         $fup = $db->result($query, 0);
  828.                         updateforumcount($fup);
  829.                 }

  830.                 modlog();
  831.                 updateforumcount($moveto);
  832.                 updateforumcount($fid);
  833.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");
  834.         }

  835. } elseif($action == 'top' && $allowtop) {

  836.         if(!submitcheck('topsubmit')) {

  837.                 include template('topicadmin_topuntop');

  838.         } else {

  839.                 if($level < 0 || $level > 3) {
  840.                         showmessage('undefined_action');
  841.                 }
  842. ctrl_msg();   //调用函数
  843. //帖子操作短信通知 hack by xiori 2005-3-18


  844. if($ynmsg==1)
  845.         {
  846. if($content !=""){$title=$content;}
  847. if ($msg !=""){
  848.         $msg="

  849. 以下为".$discuz_user."给您的附言:[color=blue]".$msg."[/color]";
  850.         }

  851. if($level > 0){
  852. if ($updateur != "1") {
  853. $msg_1="您发表的帖子“".$temsubject."“因[b] ".$title." [/b]而被置顶,且进行了 积分$docredit, 率币$domoney 的操作!";$action_m="置顶";
  854. }else{$msg_1="您发表的帖子“".$temsubject."“因[b] ".$title." [/b]而被置顶,没有对您的分值进行操作!";$action_m="置顶";
  855. }
  856. }else{if ($updateur != "1") {
  857. $msg_1="您发表的帖子“".$temsubject."“因[b] ".$title." [/b]而被解除置顶,且进行了 积分$docredit, 率币$domoney 的操作!";$action_m="解除置顶";
  858. }else{$msg_1="您发表的帖子“".$temsubject."“因[b] ".$title." [/b]而被解除置顶,没有对您的分值进行操作!";$action_m="解除置顶";
  859. }}


  860. $msgtext=$msg_1.$msg.$msg_2;
  861. $czsubject=$action_m."短消息通知";

  862.         $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
  863.                                 VALUES('$discuz_user', '$discuz_uid', '$thread[authorid]', 'inbox', '1', '$czsubject', '$timestamp', '$msgtext')");
  864.        
  865.         if ($updateur != "1") {
  866.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$thread[authorid]'");   
  867.      }
  868.                                 $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$thread[authorid]'");       

  869.        
  870.        
  871. } else{
  872. if ($updateur != "1") {
  873.                                 $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$thread[authorid]'");  
  874. }
  875.         }

  876. //帖子操作短信通知 hack by xiori 2005-3-18
  877.                 $db->query("UPDATE $table_threads SET displayorder='$level' WHERE tid='$tid' AND fid='$fid'");

  878.                 modlog();
  879. if ($level > 1) {
  880.         $db->query("INSERT INTO {$tablepre}topthreads (tid) VALUES ('$tid')", 'SILENT');
  881.         updatecache('topthreads');
  882. } else {
  883.         $db->query("DELETE FROM {$tablepre}topthreads WHERE tid='$tid'");
  884.         if ($db->affected_rows()) updatecache('topthreads');
  885. }
  886.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  887.         }

  888. } elseif($action == 'getip' && $allowviewip) {

  889.         require_once DISCUZ_ROOT.'./include/misc.php';

  890.         $query = $db->query("SELECT m.adminid, p.useip FROM $table_posts p
  891.                                 LEFT JOIN $table_members m ON m.uid=p.authorid
  892.                                 WHERE pid='$pid' AND tid='$tid'");
  893.         if(!$member = $db->fetch_array($query)) {
  894.                 showmessage('thread_nonexistence', NULL, 'HALTED');
  895.         } elseif(($member['adminid'] == 1 && $adminid > 1) || ($member['adminid'] == 2 && $adminid > 2)) {
  896.                 showmessage('admin_getip_nopermission', NULL, 'HALTED');
  897.         }

  898.         $member['iplocation'] = convertip($member['useip']);

  899.         include template('topicadmin_getip');

  900. } elseif($action == 'bump') {

  901.         if(!submitcheck('bumpsubmit')) {

  902.                 include template('topicadmin_bump');

  903.         } else {

  904.                 $query = $db->query("SELECT subject, lastposter, lastpost FROM $table_threads WHERE tid='$tid' LIMIT 1");
  905.                 $thread = $db->fetch_array($query);
  906.                 $thread[lastposter] = addslashes($thread['lastposter']);
  907.                 $db->query("UPDATE $table_threads SET lastpost='$timestamp' WHERE tid='$tid' AND fid='$fid'");
  908.                 $db->query("UPDATE $table_forums SET lastpost='$thread[subject]\t$timestamp\t$thread[lastposter]' WHERE fid='$fid' $fupadd");

  909.                 modlog();
  910.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  911.         }

  912. } elseif($action == 'split' && $allowsplit) {

  913. require_once DISCUZ_ROOT.'./include/discuzcode.php';
  914.       if(!submitcheck('splitsubmit')) {

  915.                 $replies = $thread['replies'];
  916.                 if($replies <= 0) {
  917.                         showmessage('admin_split_invalid');
  918.                 }

  919.                 $postlist = array();
  920.                 $query = $db->query("SELECT * FROM $table_posts WHERE tid='$tid' ORDER BY dateline");
  921.                 while($post = $db->fetch_array($query)) {
  922.                         $post['message'] = postify($post['message'], $post['smileyoff'], $post['bbcodeoff']);
  923.                         $postlist[] = $post;
  924.                 }

  925.                 include template('topicadmin_split');

  926.         } else {

  927.                 if(!trim($subject)) {
  928.                         showmessage('admin_split_subject_invalid');
  929.                 }
  930.                 $subject = $subject ? dhtmlspecialchars(censor(trim($subject))) :'';

  931.                 $pids = implode_ids( $split );

  932.                 if($pids) {

  933.                         $db->query("INSERT INTO $table_threads (fid, subject) VALUES ('$fid', '$subject')");
  934.                         $newtid = $db->insert_id();

  935.                         $db->query("UPDATE $table_posts SET tid='$newtid' WHERE pid IN ($pids)");
  936.                         $db->query("UPDATE $table_attachments SET tid='$newtid' WHERE pid IN ($pids)");

  937.                         $query = $db->query("SELECT author, authorid, dateline FROM $table_posts WHERE tid='$tid' ORDER BY dateline ASC LIMIT 1");
  938.                         $fpost = $db->fetch_array($query);
  939.                         $db->query("UPDATE $table_threads SET author='$fpost[author]', authorid='$fpost[authorid]', dateline='$fpost[dateline]' WHERE tid='$tid'");

  940.                         $query = $db->query("SELECT author, authorid, dateline FROM $table_posts WHERE tid='$newtid' ORDER BY dateline ASC LIMIT 1");
  941.                         $fpost = $db->fetch_array($query);
  942.                         $db->query("UPDATE $table_threads SET author='$fpost[author]', authorid='$fpost[authorid]', dateline='$fpost[dateline]' WHERE tid='$newtid'");

  943.                         updatethreadcount($tid);
  944.                         updatethreadcount($newtid);
  945.                         updateforumcount($fid);

  946.                         modlog();
  947.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  948.                 } else {
  949.                         showmessage('admin_split_new_invalid');
  950.                 }
  951.         }

  952. } elseif($action == 'merge' && $allowmerge) {

  953.         if(!submitcheck('mergesubmit')) {

  954.                 include template('topicadmin_merge');

  955.         } else {

  956.                 $query = $db->query("SELECT fid, views, replies FROM $table_threads WHERE tid='$othertid'");
  957.                 if(!$other = $db->fetch_array($query)) {
  958.                         showmessage('admin_merge_nonexistence');
  959.                 }
  960.                 if(!$adminglobal && $other['fid'] != $forum['fid']) {
  961.                         showmessage('admin_merge_invalid');
  962.                 }

  963.                 $other['views'] = intval($other['views']);
  964.                 $other['replies']++;

  965.                 $db->query("UPDATE $table_posts SET tid='$tid' WHERE tid='$othertid'");
  966.                 $postsmerged = $db->affected_rows();

  967.                 $db->query("UPDATE $table_attachments SET tid='$tid' WHERE tid='$othertid'");
  968.                 $db->query("DELETE FROM $table_threads WHERE tid='$othertid'");
  969.                 $db->query("UPDATE $table_threads SET views=views+$other[views], replies=replies+$other[replies] WHERE tid='$tid'");
  970.                
  971.                 if($fid == $other['fid']) {
  972.                         $db->query("UPDATE $table_forums SET threads=threads-1 WHERE fid='$fid' $fupadd");
  973.                 } else {
  974.                         $db->query("UPDATE $table_forums SET threads=threads-1, posts=posts-$postsmerged WHERE fid='$other[fid]'");
  975.                         $db->query("UPDATE $table_forums SET posts=$posts+$postsmerged WHERE fid='$fid' $fupadd");
  976.                 }

  977.                 modlog();
  978.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  979.         }

  980. }elseif($action == 'seeip' && $allowviewip) {

  981.         require_once DISCUZ_ROOT.'./include/misc.php';

  982.         if(!$isadmin) {
  983.                 showmessage('admin_getip_nopermission', NULL, 'HALTED');
  984.         }
  985.         $member['useip']=$useip;
  986.         $member['iplocation'] = convertip($member['useip']);

  987.         include template('topicadmin_getip');

  988. } else {

  989.         showmessage('admin_nopermission', NULL, 'HALTED');

  990. }

  991. function modlog($action = '') {
  992.         global $discuz_user, $groupid, $adminid, $onlineip, $timestamp, $forum, $thread, $operation, $tids;

  993.         if(!$action) {
  994.                 $action = $GLOBALS['action'];
  995.         }
  996.         if (!$thread['tid']) $thread['tid']=intval($GLOBALS['tid']);
  997.         if ($action == 'moderate'){
  998.                 $action .='_'.$operation;
  999.                 $thread[subject] = $tids;
  1000.                 $thread[tid] = 0;
  1001.         }
  1002.         @$fp = fopen(DISCUZ_ROOT.'./forumdata/modslog.php', 'a');
  1003.         @flock($fp, 2);
  1004.         @fwrite($fp, "$timestamp\t$discuz_user\t$groupid\t$onlineip\t$forum[fid]\t$forum[name]\t$thread[tid]\t$thread[subject]\t$action\n");
  1005.         @fclose($fp);
  1006. }

  1007. function accesscheck($query) {
  1008.         global $db,$fid;
  1009.         while($thread = $db->fetch_array($query)) {
  1010.                 if($thread['fid'] <> $fid){
  1011.                         showmessage('admin_moderate_accesserror', NULL, 'HALTED');
  1012.                 }
  1013.         }
  1014. }

  1015. ?>

复制代码

[ 本帖最后由 iioo2005 于 2005-8-7 21:24 编辑 ]
回复

使用道具 举报

hufanyun 发表于 2005-8-7 21:28:46 | 显示全部楼层
那么多没有工具很难帮你。我自己的电脑坏了。
回复

使用道具 举报

alex0007 发表于 2005-8-9 16:00:23 | 显示全部楼层
楼主发的这个主题分类。。我觉得要得奖。。!!!谢谢楼主。。我要确认一下的是:这个hack是绝对可以在2.5 sp1下使用的。。因为我安装成功。。正常使用中。。是指所有功能。。

[ 本帖最后由 alex0007 于 2005-8-9 16:11 编辑 ]
回复

使用道具 举报

alex0007 发表于 2005-8-9 16:18:36 | 显示全部楼层

这是批量管理的贴图

这是批量管理成功后的的演示图

[ 本帖最后由 alex0007 于 2005-8-9 16:22 编辑 ]
回复

使用道具 举报

iioo2005 发表于 2005-8-9 19:35:06 | 显示全部楼层
唉,楼上的老大,可否帮我看看,我的问题出在哪里了?
回复

使用道具 举报

g8g8g8g8 发表于 2005-8-10 11:30:18 | 显示全部楼层
发现问题
快速发主题和新发主题时
就算选了专题分类,也没有用!
一样在其他分类中显示
得重新编辑一下分类才可以
不知什么原因
在线等
回复

使用道具 举报

yunhai 发表于 2005-8-12 17:02:17 | 显示全部楼层

回复 #91 iioo2005 的帖子

  1. //帖子操作短信通知 hack by xiori 2005-3-18

  2.                         $db->query("DELETE FROM $table_threads WHERE tid IN ($tids)");
  3.                         $db->query("DELETE FROM $table_polls WHERE tid IN ($tids)");
  4.                         $db->query("DELETE FROM $table_posts WHERE tid IN ($tids)");
  5. $db->query("DELETE FROM {$tablepre}topthreads WHERE tid IN ($tids)");
  6. if ($db->affected_rows()) updatecache('topthreads');
  7.                 if ($forum['type'] == 'sub') {
  8.         updateforumcount($fup['fid']);
  9. }

  10.                         updateforumcount($fid);

  11.                         modlog();
  12. $db->query("DELETE FROM {$tablepre}topthreads WHERE tid='$tid'");
  13. if ($db->affected_rows()) updatecache('topthreads');
  14.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");
复制代码


下面添加
  1. //=D25 Subject classification=Ver.2.5.0 by Aday=Start//        
  2.                 }elseif($operation == 'cate' && $allowmove){
  3.                         accesscheck($query);
  4.                         if(!cate) {
  5.                                 showmessage('admin_cate_invalid');
  6.                         }
  7.                         $db->query("UPDATE $table_threads SET cate='$cate' WHERE  (tid IN ($tids)) AND fid='$fid'");
  8.                         modlog();
  9.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page&cateid=$cate");
  10. //=D25 Subject classification=Ver.2.5.0 by Aday=End//         
复制代码


试试看,我看你修改的东西不少!!

[ 本帖最后由 yunhai 于 2005-8-12 17:03 编辑 ]
回复

使用道具 举报

iioo2005 发表于 2005-8-12 21:11:13 | 显示全部楼层
感谢jerrychf的帮助,我已经成功的安装了这个插件.
将  jerrychf 告诉我的方法贴出来,希望能够办到更多的朋友。

其實最重要的是把分類插件中修改 topicadmin.php 中的這一段

  1. //=D25 Subject classification=Ver.2.5.0 by Aday=Start//        
  2.                 }elseif($operation == 'cate' && $allowmove){
  3.                         accesscheck($query);
  4.                         if(!cate) {
  5.                                 showmessage('admin_cate_invalid');
  6.                         }
  7.                         $db->query("UPDATE $table_threads SET cate='$cate' WHERE  (tid IN ($tids)) AND fid='$fid'");
  8.                         modlog();
  9.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page&cateid=$cate");
  10. //=D25 Subject classification=Ver.2.5.0 by Aday=End//
复制代码


加在回收站的這一段之後

  1. //回收站修改開始 2005-4-10
  2. if($fid==$recyclefid) {

  3.                         accesscheck($query);
  4.                         $uids = $comma = '';
  5.                         $haveattach = 0;
  6.                         $query = $db->query("SELECT authorid ,aid FROM $table_posts WHERE tid IN ($tids)");
  7.                         while($post = $db->fetch_array($query)) {
  8.                                 $uids .= "$comma$post[authorid]";
  9.                                 $comma = ',';
  10.                                 if ($post['aid']) $haveattach++;
  11.                         }
  12.                         updatemember('-', $uids, $deletedcredits);

  13.                         if ($haveattach){
  14.                                 $query = $db->query("SELECT attachment FROM $table_attachments WHERE tid IN ($tids)");
  15.                                 while($attach = $db->fetch_array($query)) {
  16.                                         @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
  17.                                 }
  18.                                 $db->query("DELETE FROM $table_attachments WHERE tid IN ($tids)");
  19.                         }
  20.                         
  21.                         $db->query("DELETE FROM $table_threads WHERE tid IN ($tids)");
  22.                         $db->query("DELETE FROM $table_polls WHERE tid IN ($tids)");
  23.                         $db->query("DELETE FROM $table_posts WHERE tid IN ($tids)");

  24.                         updateforumcount($fid);

  25.                         modlog();
  26.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");
  27.    

  28. } else {
  29.                         $displayorderadd = !$adminglobal ? ", displayorder='0'" : NULL;

  30.                         $db->query("UPDATE $table_threads SET fid='$recyclefid' $displayorderadd WHERE tid IN($tids)");
  31.                         $db->query("UPDATE $table_posts SET fid='$recyclefid' WHERE tid IN($tids) ");

  32.                         if ($forum['type'] == 'sub') {
  33.                                 $query= $db->query("SELECT fup FROM $table_forums WHERE fid='$fid' LIMIT 1");
  34.                                 $fup = $db->result($query, 0);
  35.                                 updateforumcount($fup);
  36.                         }
  37.                         modlog();
  38.                         updateforumcount($recyclefid);
  39.                         updateforumcount($fid);
  40.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");
  41.                         
  42.                         
  43. }
  44. //回收站修改結束  2005-4-10
复制代码

[ 本帖最后由 iioo2005 于 2005-8-12 21:12 编辑 ]
回复

使用道具 举报

iioo2005 发表于 2005-8-14 18:38:32 | 显示全部楼层
顶一下,有人成功的使用了 强制使用分类的功能么?
回复

使用道具 举报

moggy 发表于 2005-8-20 14:18:34 | 显示全部楼层
对性能的影响大吗?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-18 05:25 , Processed in 0.117191 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表