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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[9.22更新,增加文字底色][原创]10种自定义参数标题醒目高亮

[复制链接]
爱雨冷雪 发表于 2005-9-15 08:05:03 | 显示全部楼层
原帖由 lu5266 于 2005-9-15 07:33 发表


呵呵
顺便问下
你有那个vip版的common.js那个文件吧

有 的话

嘿嘿

pm给我下

免得用了哪个的话

那个层变的很不好看(要支持html才好看)

VIP???什么VIP???
不过我用两种JS就是了。。有些风格,用不一样的JS。。
http://www.23717.com/bbs/include/cc.js
http://www.23717.com/bbs/include/common.js

反正不知道你说的是哪种VIP的什么东东,你直接下载看咯~!
还有一种还未用就是oytktk 那种。。
回复

使用道具 举报

爱雨冷雪 发表于 2005-9-15 08:09:46 | 显示全部楼层
两种不一样的JS,不一样的效果。。嘻嘻
第一个有点错误。。
http://www.23717.com/bbs/forumdi ... id=1&sid=Jxt4Va

第二种没有~
http://www.23717.com/bbs/forumdi ... d=18&sid=Jxt4Va
我得用第二种咯~
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-15 08:16:53 | 显示全部楼层
原帖由 爱雨冷雪 于 2005-9-15 08:09 发表
两种不一样的JS,不一样的效果。。嘻嘻
第一个有点错误。。
http://www.23717.com/bbs/forumdi ... id=1&sid=Jxt4Va

第二种没有~
[url]http://www.23717.c ...


知道了

我的sp1的common.js 没有一个函数

2.5的才有

呵呵
回复

使用道具 举报

yjflq2002 发表于 2005-9-15 08:26:15 | 显示全部楼层
回复

使用道具 举报

oytktk 发表于 2005-9-15 08:30:45 | 显示全部楼层
原帖由 lu5266 于 2005-9-15 06:23 发表


真是好兄弟啊

我昨天晚上11.10就熄等了啊

呵呵



那还用说~~~
回复

使用道具 举报

爱雨冷雪 发表于 2005-9-15 08:38:19 | 显示全部楼层
原帖由 lu5266 于 2005-9-15 08:16 发表


知道了

我的sp1的common.js 没有一个函数

2.5的才有

呵呵

要怎么加?
回复

使用道具 举报

yjflq2002 发表于 2005-9-15 08:42:10 | 显示全部楼层
装了,觉得管理时的参数还是复杂了点
回复

使用道具 举报

Pteranodon 发表于 2005-9-15 09:02:43 | 显示全部楼层
支持, 這個好玩~~ 我待會去試
回复

使用道具 举报

wwtang 发表于 2005-9-15 09:12:01 | 显示全部楼层
额...为什么我只能用任意高亮呢,其他的功能我都不能用,一用,就发生,模板对不齐,还有就是连高亮的这个贴子都看不到了..请问是什么原因??
回复

使用道具 举报

Pteranodon 发表于 2005-9-15 09:25:12 | 显示全部楼层
我全都弄好了. . .
但不成功 T_T

一但在topcinadmin.php 那裡加了這個代碼後, 便. .會:


  1. Parse error: parse error, unexpected T_STRING in /home/xdxdxd/public_html/bbs/topicadmin.php on line 394
复制代码


給您看看我的那一頁吧, 希望解決問題 T_T


  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. $discuz_action = 151;

  20. $tid   = $tid ? $tid :'';
  21. $page  = intval($page);
  22. $fpage = intval($fpage);

  23. if($tid) {
  24.         $query = $db->query("SELECT * FROM $table_threads WHERE tid='$tid'");
  25.         $thread = $db->fetch_array($query);
  26.         $thread['subject'] .= $action == 'delthread' ? ", etc." : NULL;
  27. }

  28. if($forum['type'] == 'forum') {
  29.         $navigation = "&raquo; <a href="forumdisplay.php?fid=$fid&page=$fpage">$forum[name]</a> &raquo; <a href="viewthread.php?tid=$tid">$thread[subject]</a> ";
  30.         $navtitle = ' - '.strip_tags($forum['name']).' - '.$thread['subject'];
  31. } else {
  32.         $query = $db->query("SELECT name, fid, moderator FROM $table_forums WHERE fid='$forum[fup]'");
  33.         $fup = $db->fetch_array($query);
  34.         $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> ";
  35.         $navtitle = ' - '.strip_tags($fup['name']).' - '.strip_tags($forum['name']).' - '.$thread['subject'];
  36. }

  37. if(!$discuz_user || !$discuz_pw || !modcheck($discuz_user)) {
  38.         showmessage('admin_nopermission', NULL, 'HALTED');
  39. }

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

  41. if($action == 'moderate') {
  42.         if(!is_array($moderate) || !count($moderate)) {
  43.                 showmessage('admin_moderate_nothread');
  44.         }elseif(!$operation){
  45.                 showmessage('admin_moderate_nooperation');
  46.         }
  47.         $tids = implode_ids($moderate);
  48.         $query = $db->query("SELECT * FROM $table_threads WHERE tid IN($tids) ");
  49.         if(!submitcheck('moderatesubmit')){
  50.                 $threadlist = array();
  51.                 while($thread = $db->fetch_array($query)) {
  52.                         if($thread['fid'] == $fid){
  53.                                 $thread['lastposterenc'] = rawurlencode($thread['lastposter']);
  54.                                 if($thread['attachment']) {
  55.                                         require_once DISCUZ_ROOT.'./include/attachment.php';
  56.                                         $thread['attachment'] = attachtype($thread['attachment']).' ';
  57.                                 } else {
  58.                                         $thread['attachment'] = '';
  59.                                 }
  60.                                 $thread[subject] = cutstr($thread[subject],77);
  61.                                 $thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
  62.                                 $thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);
  63.                                 $threadlist[] = $thread;
  64.                         }
  65.                 }
  66.                
  67.                 if(!$threadlist) showmessage('admin_moderate_nothread');

  68.                 if($operation == 'move') {
  69.                         require_once DISCUZ_ROOT.'./include/forum.php';
  70.                         $forumselect = forumselect();
  71.                 }
  72.                 include template('topicadmin_moderate');
  73.        
  74.         }else{
  75.        
  76.                 if($operation == 'move' && $allowmove) {
  77.                         if(!$moveto) {
  78.                                 showmessage('admin_move_invalid');
  79.                         }

  80.                         accesscheck($query);

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

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

  84.                         if ($forum['type'] == 'sub') {
  85.                                 $query= $db->query("SELECT fup FROM $table_forums WHERE fid='$fid' LIMIT 1");
  86.                                 $fup = $db->result($query, 0);
  87.                                 updateforumcount($fup);
  88.                         }
  89.                         modlog();
  90.                         updateforumcount($moveto);
  91.                         updateforumcount($fid);
  92.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");

  93.                 }elseif($operation == 'stick' && $allowtop){
  94.                         accesscheck($query);
  95.                         if($level < 0 || $level > 3) {
  96.                                 showmessage('undefined_action');
  97.                         }
  98.                         $db->query("UPDATE $table_threads SET displayorder='$level' WHERE tid IN ($tids)");
  99.                         modlog();
  100.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");

  101.                 }elseif($operation == 'delete' && $allowdelpost) {
  102.                         accesscheck($query);
  103.                         $uids = $comma = '';
  104.                         $haveattach = 0;
  105.                         $query = $db->query("SELECT authorid ,aid FROM $table_posts WHERE tid IN ($tids)");
  106.                         while($post = $db->fetch_array($query)) {
  107.                                 $uids .= "$comma$post[authorid]";
  108.                                 $comma = ',';
  109.                                 if ($post['aid']) $haveattach++;
  110.                         }
  111.                         updatemember('-', $uids, $deletedcredits);

  112.                         if ($haveattach){
  113.                                 $query = $db->query("SELECT attachment FROM $table_attachments WHERE tid IN ($tids)");
  114.                                 while($attach = $db->fetch_array($query)) {
  115.                                         @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
  116.                                 }
  117.                                 $db->query("DELETE FROM $table_attachments WHERE tid IN ($tids)");
  118.                         }
  119.                        
  120.                         $db->query("DELETE FROM $table_threads WHERE tid IN ($tids)");
  121.                         $db->query("DELETE FROM $table_polls WHERE tid IN ($tids)");
  122.                         $db->query("DELETE FROM $table_posts WHERE tid IN ($tids)");

  123.                         updateforumcount($fid);

  124.                         modlog();
  125.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");

  126.                 }elseif($operation == 'close' && $allowclose){
  127.                         accesscheck($query);
  128.                         $close = $type ? 1 : 0;
  129.                         $db->query("UPDATE $table_threads SET closed='$close' WHERE tid in($tids)");
  130.                         modlog();
  131.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");

  132.                 }elseif($operation == 'digest' && $allowdigest){
  133.                         if($level < 0 || $level > 3) {
  134.                                 showmessage('undefined_action', NULL, 'HALTED');
  135.                         }
  136.                         while($thread = $db->fetch_array($query)) {
  137.                                 if ($thread['fid'] == $fid && $thread['digest']<>$level){
  138.                                         $digest_mark=($level-intval($thread['digest']))*$digestcredits;
  139.                                         $db->query("UPDATE $table_threads SET digest='$level' WHERE tid='$thread[tid]'");
  140.                                         if($digest_mark && $discuz_uid != $thread[authorid]) {
  141.                                                 $db->query("UPDATE $table_members SET credit=credit".($digest_mark > 0 ? '+' : '')."$digest_mark WHERE uid='$thread[authorid]'");
  142.                                         }
  143.                                 }
  144.                         }
  145.                         modlog();
  146.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");
  147.                 }else{
  148.                         showmessage('admin_nopermission', NULL, 'HALTED');
  149.                 }
  150.         }

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

  152.         if(!is_array($delete) || !count($delete)) {
  153.                 showmessage('admin_delpost_invalid');
  154.         }

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

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

  158.                         $deleteid = '';
  159.                         foreach($delete as $id) {
  160.                                 $deleteid .= '<input type="hidden" name="delete[]" value="'.$id.'">';
  161.                         }

  162.                         include template('topicadmin_delpost');
  163.                        
  164.                 } else {
  165.                         header("Location: {$boardurl}topicadmin.php?action=delete&fid=$fid&tid=$tid&page=$page&fpage=$fpage");
  166.                 }

  167.         } else {

  168.                 $pids = implode_ids( $delete );

  169.                 $uids = $comma = '';
  170.                 $actionpost = $totalpost = $aids = 0;
  171.                 $query = $db->query("SELECT pid, authorid, aid FROM $table_posts WHERE tid='$tid'");
  172.                 $totalpost = $db->num_rows($query);
  173.                 while($post = $db->fetch_array($query)) {
  174.                         if (in_array($post[pid], $delete)){
  175.                                 $uids .= "$comma$post[authorid]";
  176.                                 $comma = ',';
  177.                                 $actionpost ++;
  178.                                 if ($post['aid']) $aids .=','.$post[pid];
  179.                         }
  180.                 }

  181.                 if ($actionpost < 1) {
  182.                         showmessage('admin_delpost_invalid');
  183.                 }elseif($actionpost <> count($delete)){
  184.                         showmessage('admin_moderate_accesserror', NULL, 'HALTED');
  185.                 }elseif($actionpost >= $totalpost ){
  186.                         header("Location: {$boardurl}topicadmin.php?action=delete&fid=$fid&tid=$tid&page=$page&fpage=$fpage");
  187.                 }
  188.                
  189.                 updatemember('-', $uids, $deletedcredits);

  190.                 if ($aids){
  191.                         require_once DISCUZ_ROOT.'./include/attachment.php';
  192.                         $query = $db->query("SELECT pid, attachment, filetype FROM $table_attachments WHERE pid IN ($aids)");
  193.                         while($attach = $db->fetch_array($query)) {
  194.                                         @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
  195.                         }
  196.                         $db->query("DELETE FROM $table_attachments WHERE pid IN ($aids)");
  197.                         updatethread_type($tid , $thread['attachment']);
  198.                 }

  199.                 $db->query("DELETE FROM $table_posts WHERE pid IN ($pids)");
  200.                 updatethreadcount($tid);
  201.                 updateforumcount($fid);

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

  204.         }

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

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

  209.                 for($i = 1; $i <= 3; $i++) {
  210.                         $stylecheck[$i] = $stylestr[$i - 1] ? 'checked' : NULL;
  211.                 }
  212.                 $colorcheck = array($string[1] => 'checked');
  213.                
  214.                 include template('topicadmin_highlight');

  215.         } else {

  216.                 $stylebin = '';
  217.                 for($i = 1; $i <= 3; $i++) {
  218.                         $stylebin .= empty($highlight_style[$i]) ? '0' : '1';
  219.                 }
  220.                 $highlight_style = bindec($stylebin);

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

  225.                 modlog();
  226. //短消息通知HACK START by Btaoto Plus1.0
  227.                         if ($isto){
  228.                         $subject="[系統]您的主題被(高亮顯示)通知 ";
  229.                         $message="===================================\r\n";
  230.                         $message.="您的主題 [url=".$boardurl."/viewthread.php?tid=".$tid."]".$thread[subject].'[/url]'." \r\n ";
  231.                         $message.="(高亮顯示)此主題的管理團隊成員︰$discuz_user \r\n";
  232.                         $message.="原因︰\r\n $reason \r\n";
  233.                         $message.="===================================\r\n";
  234.                         $db->query("INSERT INTO $table_pms (msgtoid, msgfrom, msgfromid, folder, new, subject, dateline, message)
  235.                                 VALUES('$uid', '$discuz_user', '$discuz_uid', 'inbox', '1', '$subject', '$timestamp', '$message')");
  236.                         $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$uid'");
  237.                         }

  238.         //短消息通知HACK by Btaoto Plus1.0 END
  239.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  240.         }

  241. }
  242. //=====八種自定義參數標題醒目+任意顏色高亮==start==By www.5466.ik8.com==============

  243. elseif($action == 'xm_highlight' && $allowhighlight) {
  244.         if(!submitcheck('xm_highlightsubmit')) {
  245.       
  246.                 $xm_hl_string=explode(',',$thread['xm_hl']);
  247.                
  248.                 for($i = 1; $i <=9; $i++) {
  249.                         $xu_check[$i] =$i==$xm_hl_string[0] ?  'checked' : NULL;
  250.                                                                         
  251.            }

  252.           if($xm_hl_string[0]){            
  253.            switch($xm_hl_string[0]){
  254.            
  255.            case 1: $xm_id_11=$xm_hl_string[1];$xm_id_12=$xm_hl_string[2];$xm_id_13=$xm_hl_string[3];$xm_id_14=$xm_hl_string[4];
  256.                    break;                                    
  257.            
  258.            case 2:
  259.                    $xm_id_21=$xm_hl_string[1];$xm_id_22=$xm_hl_string[2];$xm_id_23=$xm_hl_string[3];$xm_id_24=$xm_hl_string[4];                  
  260.                    break;
  261.                               
  262.            case 3:
  263.                    $xm_id_31=$xm_hl_string[1];$xm_id_32=$xm_hl_string[2];$xm_id_33=$xm_hl_string[3];$xm_id_34=$xm_hl_string[4];                           
  264.                    break;           
  265.            
  266.            case 4:
  267.                    $xm_id_41=$xm_hl_string[1];$xm_id_42=$xm_hl_string[2];$xm_id_43=$xm_hl_string[3];$xm_id_44=$xm_hl_string[4];                     
  268.                    break;           
  269.                      
  270.            case 5:
  271.                    $xm_id_51=$xm_hl_string[1];$xm_id_52=$xm_hl_string[2];               
  272.                    break;   
  273.            
  274.            case 6:
  275.                    $xm_id_61=$xm_hl_string[1];$xm_id_62=$xm_hl_string[2];$xm_id_63=$xm_hl_string[3];                             
  276.                    break;
  277.            case 7:
  278.                    $xm_id_71=$xm_hl_string[1];$xm_id_72=$xm_hl_string[2];$xm_id_73=$xm_hl_string[3];                             
  279.                    break;
  280.            case 8:
  281.                    $xm_id_81=$xm_hl_string[1];$xm_id_82=$xm_hl_string[2];$xm_id_83=$xm_hl_string[3];                             
  282.                    break;                                       
  283.                      
  284.            default: break;         
  285.               }
  286.            
  287.            }
  288.         include template('topicadmin_xm_highlight');

  289.         } else {

  290.                 $xm_hl_str = '';
  291.                
  292.                 if($xm_hl_id==1){$xm_hl_str=$xm_hl_id.','.$font_color.','.$font_size.','.$font_style.','.$font_underline;
  293.                
  294.                 }
  295.                
  296.                 else if($xm_hl_id==2){$xm_hl_str=$xm_hl_id.','.$text_color1.','.$text_color2.','.$speed_1.','.$pause_1;
  297.                
  298.                 }
  299.                
  300.                 else if($xm_hl_id==3){ $xm_hl_str=$xm_hl_id.','.$textoffset1.','.$textoffset2.','.$speed_2.','.$pause_2;
  301.                
  302.                 }
  303.                
  304.                 else if($xm_hl_id==4){ $xm_hl_str=$xm_hl_id.','.$textcolor.','.$textsize1.','.$speed_3.','.$pause_3;
  305.                
  306.                 }
  307.                
  308.                 else if($xm_hl_id==5){ $xm_hl_str=$xm_hl_id.','.$sider_color.','.$text_color;
  309.                  
  310.                 }
  311.                
  312.                 else if($xm_hl_id==6){ $xm_hl_str=$xm_hl_id.','.$start_color.','.$start_n.','.$end_color;
  313.                  
  314.                 }
  315.                 else if($xm_hl_id==7){ $xm_hl_str=$xm_hl_id.','.$glow_color1.','.$glow_pow.','.$glow_color2;
  316.                  
  317.                 }
  318.                 else if($xm_hl_id==8){ $xm_hl_str=$xm_hl_id.','.$shadow_color1.','.$shadow_view.','.$shadow_color2;
  319.                  
  320.                 }                                       
  321.                 else if($xm_hl_id==9){ $xm_hl_str=$xm_hl_id;
  322.                  
  323.                 }                        
  324.                
  325.                 else if($xm_hl_id==10){ $xm_hl_str='';
  326.                
  327.                 }        
  328.                         
  329.                 else showmessage('對不起,未定義操作!');
  330.                
  331.                
  332.                 if(strlen($xm_hl_str)>25){ $xm_hl_str=substr($xm_hl_str,0, 25);}
  333.                
  334.                
  335.                 $db->query("UPDATE $table_threads SET xm_hl='$xm_hl_str' WHERE tid='$tid'");

  336.                 modlog();
  337.                 showmessage('醒目高亮顯示-->管理操作成功', "forumdisplay.php?fid=$fid&page=$fpage");
  338.    
  339.         }

  340. }

  341. //=====八種自定義參數標題醒目+任意顏色高亮==end==By lu5266=====================
  342. elseif($action == 'digest' && $allowdigest) {
  343.         if(!submitcheck('digestsubmit')) {

  344.                 include template('topicadmin_digest');

  345.         } else {

  346.                 if($level < 0 || $level > 3) {
  347.                         showmessage('undefined_action', NULL, 'HALTED');
  348.                 }
  349.                 $digest_mark=($level-intval($thread['digest']))*$digestcredits;

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

  351.                 if($digest_mark && $discuz_uid != $thread['authorid'] ) {
  352.                         $db->query("UPDATE $table_members SET credit=credit".($digest_mark > 0 ? '+' : '')."$digest_mark WHERE uid='$thread[authorid]'");
  353.                 }
  354.                 modlog();
  355. //短消息通知HACK START by Btaoto Plus1.0
  356.                         if ($isto){
  357.                         $subject="[系統]您的主題被(加精華/取消精華)通知 ";
  358.                         $message="===================================\r\n";
  359.                         $message.="您的主題 [url=".$boardurl."/viewthread.php?tid=".$tid."]".$thread[subject].'[/url]'." \r\n 精華級別︰$level 級\r\n";
  360.                         $message.="(精華)此主題的管理團隊成員︰$discuz_user \r\n";
  361.                         $message.="原因︰\r\n $reason \r\n";
  362.                         $message.="===================================\r\n";
  363.                         $db->query("INSERT INTO $table_pms (msgtoid, msgfrom, msgfromid, folder, new, subject, dateline, message)
  364.                                 VALUES('$uid', '$discuz_user', '$discuz_uid', 'inbox', '1', '$subject', '$timestamp', '$message')");
  365.                         $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$uid'");
  366.                         }

  367.         //短消息通知HACK by Btaoto Plus1.0 END
  368.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  369.         }

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

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

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

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

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

  379.                 include template('topicadmin_delete');

  380.         } else {

  381.                 $uids = $comma = '';
  382.                 $query = $db->query("SELECT authorid,aid FROM $table_posts WHERE tid='$tid'");
  383.                 $aids = 0;
  384.                 while($post = $db->fetch_array($query)) {
  385.                         $uids .= "$comma$post[authorid]";
  386.                         $comma = ',';
  387.                         if ($post['aid']) $aids++;
  388.                 }
  389.                 updatemember('-', $uids, $deletedcredits);
  390. //短消息通知HACK START by Btaoto Plus1.0
  391.                         if ($isto){
  392.                         $subject="[系統]您的主題被(刪除)通知 ";
  393.                         $message="===================================\r\n";
  394.                         $message.="您的主題 [url=".$boardurl."/viewthread.php?tid=".$tid."]".$thread[subject].'[/url]'." \r\n ";
  395.                         $message.="(刪除)此主題的管理團隊成員︰$discuz_user \r\n";
  396.                         $message.="原因︰\r\n $reason \r\n";
  397.                         $message.="===================================\r\n";
  398.                         $db->query("INSERT INTO $table_pms (msgtoid, msgfrom, msgfromid, folder, new, subject, dateline, message)
  399.                                 VALUES('$uid', '$discuz_user', '$discuz_uid', 'inbox', '1', '$subject', '$timestamp', '$message')");
  400.                         $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$uid'");
  401.                         }

  402.         //短消息通知HACK by Btaoto Plus1.0 END

  403.                 $db->query("DELETE FROM $table_threads WHERE tid='$tid'");
  404.                 $db->query("DELETE FROM $table_posts WHERE tid='$tid'");
  405.                
  406.                 if ($aids){
  407.                         $query = $db->query("SELECT attachment FROM $table_attachments WHERE tid='$tid'");
  408.                         while($attach = $db->fetch_array($query)) {
  409.                                 @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
  410.                         }
  411.                         $db->query("DELETE FROM $table_attachments WHERE tid='$tid'");
  412.                 }
  413.                
  414.                 updateforumcount($fid);
  415.                 if ($forum['type'] == 'sub') {
  416.                         updateforumcount($fup['fid']);
  417.                 }

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

  420.         }

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

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

  423.                 include template('topicadmin_openclose');

  424.         } else {
  425.                 $openclose = $thread['closed'] ? 0 : 1;
  426.                 $db->query("UPDATE $table_threads SET closed='$openclose' WHERE tid='$tid' AND fid='$fid'");
  427.                 modlog();
  428. //短消息通知HACK START by Btaoto Plus1.0
  429.                         if ($isto){
  430.                         $subject="[系統]您的主題被(關閉/打開)通知 ";
  431.                         $message="===================================\r\n";
  432.                         $message.="您的主題 [url=".$boardurl."/viewthread.php?tid=".$tid."]".$thread[subject].'[/url]'." \r\n ";
  433.                         $message.="(關閉/打開)此主題的管理團隊成員︰$discuz_user \r\n";
  434.                         $message.="原因︰\r\n $reason \r\n";
  435.                         $message.="===================================\r\n";
  436.                         $db->query("INSERT INTO $table_pms (msgtoid, msgfrom, msgfromid, folder, new, subject, dateline, message)
  437.                                 VALUES('$uid', '$discuz_user', '$discuz_uid', 'inbox', '1', '$subject', '$timestamp', '$message')");
  438.                         $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$uid'");
  439.                         }

  440.         //短消息通知HACK by Btaoto Plus1.0 END
  441.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");
  442.         }

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

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

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

  446.                 $forumselect = forumselect();
  447.                 include template('topicadmin_move');

  448.         } else {

  449.                 if(!$moveto) {
  450.                         showmessage('admin_move_invalid');
  451.                 }

  452.                 $displayorderadd = !$adminglobal ? ", displayorder='0'" : NULL;
  453.                 if($type == 'normal') {
  454.                         $db->query("UPDATE $table_threads SET fid='$moveto' $displayorderadd WHERE tid='$tid' AND fid='$fid'");
  455.                         $db->query("UPDATE $table_posts SET fid='$moveto' WHERE tid='$tid' AND fid='$fid'");
  456.                 } else {
  457.                         $db->query("INSERT INTO $table_threads (fid, creditsrequire, iconid, author, authorid, subject, dateline, lastpost, lastposter, views, replies, displayorder, digest, closed, poll, attachment)
  458.                                 VALUES ('$thread[fid]', '$thread[creditsrequire]', '$thread[iconid]', '".addslashes($thread['author'])."', '$thread[authorid]', '$thread[subject]', '$thread[dateline]', '$thread[lastpost]', '$thread[lastposter]', '0', '0', '0', '0', '$thread[tid]', '0', '0')");

  459.                         $db->query("UPDATE $table_threads SET fid='$moveto' $displayorderadd WHERE tid='$tid' AND fid='$fid'");
  460.                         $db->query("UPDATE $table_posts SET fid='$moveto' WHERE tid='$tid' AND fid='$fid'");
  461.                 }

  462.                 if ($forum['type'] == 'sub') {
  463.                         $query= $db->query("SELECT fup FROM $table_forums WHERE fid='$fid' LIMIT 1");
  464.                         $fup = $db->result($query, 0);
  465.                         updateforumcount($fup);
  466.                 }

  467.                 modlog();
  468.                 updateforumcount($moveto);
  469.                 updateforumcount($fid);
  470. //短消息通知HACK START by Btaoto Plus1.0
  471.                         if ($isto){
  472.                         $subject="[系統]您的主題被(移動)通知 ";
  473.                         $message="===================================\r\n";
  474.                         $message.="您的主題 [url=".$boardurl."/viewthread.php?tid=".$tid."]".$thread[subject].'[/url]'." \r\n ";
  475.                         $message.="(移動)此主題的管理團隊成員︰$discuz_user \r\n";
  476.                         $message.="原因︰\r\n $reason \r\n";
  477.                         $message.="===================================\r\n";
  478.                         $db->query("INSERT INTO $table_pms (msgtoid, msgfrom, msgfromid, folder, new, subject, dateline, message)
  479.                                 VALUES('$uid', '$discuz_user', '$discuz_uid', 'inbox', '1', '$subject', '$timestamp', '$message')");
  480.                         $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$uid'");
  481.                         }

  482.         //短消息通知HACK by Btaoto Plus1.0 END
  483.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");
  484.         }

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

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

  487.                 include template('topicadmin_topuntop');

  488.         } else {

  489.                 if($level < 0 || $level > 3) {
  490.                         showmessage('undefined_action');
  491.                 }
  492.                 $db->query("UPDATE $table_threads SET displayorder='$level' WHERE tid='$tid' AND fid='$fid'");

  493.                 modlog();
  494. //短消息通知HACK START by Btaoto Plus1.0
  495.                         if ($isto){
  496.                         $subject="[系統]您的主題被(置頂/取消置頂)通知 ";
  497.                         $message="===================================\r\n";
  498.                         $message.="您的主題 [url=".$boardurl."/viewthread.php?tid=".$tid."]".$thread[subject].'[/url]'." \r\n 置頂級別︰$level 級 \r\n";
  499.                         $message.="(置頂)此主題的管理團隊成員︰$discuz_user \r\n";
  500.                         $message.="原因︰\r\n $reason \r\n";
  501.                         $message.="===================================\r\n";
  502.                         $db->query("INSERT INTO $table_pms (msgtoid, msgfrom, msgfromid, folder, new, subject, dateline, message)
  503.                                 VALUES('$uid', '$discuz_user', '$discuz_uid', 'inbox', '1', '$subject', '$timestamp', '$message')");
  504.                         $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$uid'");
  505.                         }

  506.         //短消息通知HACK by Btaoto Plus1.0 END
  507.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  508.         }

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

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

  511.         $query = $db->query("SELECT m.adminid, p.useip FROM $table_posts p
  512.                                 LEFT JOIN $table_members m ON m.uid=p.authorid
  513.                                 WHERE pid='$pid' AND tid='$tid'");
  514.         if(!$member = $db->fetch_array($query)) {
  515.                 showmessage('thread_nonexistence', NULL, 'HALTED');
  516.         } elseif(($member['adminid'] == 1 && $adminid > 1) || ($member['adminid'] == 2 && $adminid > 2)) {
  517.                 showmessage('admin_getip_nopermission', NULL, 'HALTED');
  518.         }

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

  520.         include template('topicadmin_getip');

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

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

  523.                 include template('topicadmin_bump');

  524.         } else {

  525.                 $query = $db->query("SELECT subject, lastposter, lastpost FROM $table_threads WHERE tid='$tid' LIMIT 1");
  526.                 $thread = $db->fetch_array($query);
  527.                 $thread[lastposter] = addslashes($thread['lastposter']);
  528.                 $db->query("UPDATE $table_threads SET lastpost='$timestamp' WHERE tid='$tid' AND fid='$fid'");
  529.                 $db->query("UPDATE $table_forums SET lastpost='$thread[subject]\t$timestamp\t$thread[lastposter]' WHERE fid='$fid' $fupadd");

  530.                 modlog();
  531. //短消息通知HACK START by Btaoto Plus1.0
  532.                         if ($isto){
  533.                         $subject="[系統]您的主題被(提升)通知 ";
  534.                         $message="===================================\r\n";
  535.                         $message.="您的主題 [url=".$boardurl."/viewthread.php?tid=".$tid."]".$thread[subject].'[/url]'." \r\n ";
  536.                         $message.="(提升)此主題的管理團隊成員︰$discuz_user \r\n";
  537.                         $message.="原因︰\r\n $reason \r\n";
  538.                         $message.="===================================\r\n";
  539.                         $db->query("INSERT INTO $table_pms (msgtoid, msgfrom, msgfromid, folder, new, subject, dateline, message)
  540.                                 VALUES('$uid', '$discuz_user', '$discuz_uid', 'inbox', '1', '$subject', '$timestamp', '$message')");
  541.                         $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$uid'");
  542.                         }

  543.         //短消息通知HACK by Btaoto Plus1.0 END
  544.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  545.         }

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

  547.         if(!submitcheck('splitsubmit')) {

  548.                 require_once DISCUZ_ROOT.'./include/discuzcode.php';

  549.                 $replies = $thread['replies'];
  550.                 if($replies <= 0) {
  551.                         showmessage('admin_split_invalid');
  552.                 }

  553.                 $postlist = array();
  554.                 $query = $db->query("SELECT * FROM $table_posts WHERE tid='$tid' ORDER BY dateline");
  555.                 while($post = $db->fetch_array($query)) {
  556.                         $post['message'] = postify($post['message'], $post['smileyoff'], $post['bbcodeoff']);
  557.                         $postlist[] = $post;
  558.                 }

  559.                 include template('topicadmin_split');

  560.         } else {

  561.                 if(!trim($subject)) {
  562.                         showmessage('admin_split_subject_invalid');
  563.                 }
  564.                 $subject = $subject ? dhtmlspecialchars(censor(trim($subject))) :'';

  565.                 $pids = implode_ids( $split );

  566.                 if($pids) {

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

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

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

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

  577.                         updatethreadcount($tid);
  578.                         updatethreadcount($newtid);
  579.                         updateforumcount($fid);

  580.                         modlog();
  581. //短消息通知HACK START by Btaoto Plus1.0
  582.                         if ($isto){
  583.                         $subject="[系統]您的主題被(分割)通知 ";
  584.                         $message="===================================\r\n";
  585.                         $message.="您的主題 [url=".$boardurl."/viewthread.php?tid=".$tid."]".$thread[subject].'[/url]'." \r\n ";
  586.                         $message.="(分割)此主題的管理團隊成員︰$discuz_user \r\n";
  587.                         $message.="原因︰\r\n $reason \r\n";
  588.                         $message.="===================================\r\n";
  589.                         $db->query("INSERT INTO $table_pms (msgtoid, msgfrom, msgfromid, folder, new, subject, dateline, message)
  590.                                 VALUES('$uid', '$discuz_user', '$discuz_uid', 'inbox', '1', '$subject', '$timestamp', '$message')");
  591.                         $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$uid'");
  592.                         }

  593.         //短消息通知HACK by Btaoto Plus1.0 END
  594.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  595.                 } else {
  596.                         showmessage('admin_split_new_invalid');
  597.                 }
  598.         }

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

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

  601.                 include template('topicadmin_merge');

  602.         } else {

  603.                 $query = $db->query("SELECT fid, views, replies FROM $table_threads WHERE tid='$othertid'");
  604.                 if(!$other = $db->fetch_array($query)) {
  605.                         showmessage('admin_merge_nonexistence');
  606.                 }
  607.                 if(!$adminglobal && $other['fid'] != $forum['fid']) {
  608.                         showmessage('admin_merge_invalid');
  609.                 }

  610.                 $other['views'] = intval($other['views']);
  611.                 $other['replies']++;

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

  614.                 $db->query("UPDATE $table_attachments SET tid='$tid' WHERE tid='$othertid'");
  615.                 $db->query("DELETE FROM $table_threads WHERE tid='$othertid'");
  616.                 $db->query("UPDATE $table_threads SET views=views+$other[views], replies=replies+$other[replies] WHERE tid='$tid'");
  617.                
  618.                 if($fid == $other['fid']) {
  619.                         $db->query("UPDATE $table_forums SET threads=threads-1 WHERE fid='$fid' $fupadd");
  620.                 } else {
  621.                         $db->query("UPDATE $table_forums SET threads=threads-1, posts=posts-$postsmerged WHERE fid='$other[fid]'");
  622.                         $db->query("UPDATE $table_forums SET posts=$posts+$postsmerged WHERE fid='$fid' $fupadd");
  623.                 }

  624.                 modlog();
  625. //短消息通知HACK START by Btaoto Plus1.0
  626.                         if ($isto){
  627.                         $subject="[系統]您的主題被(合併)通知 ";
  628.                         $message="===================================\r\n";
  629.                         $message.="您的主題 [url=".$boardurl."/viewthread.php?tid=".$tid."]".$thread[subject].'[/url]'." \r\n ";
  630.                         $message.="(合併)此主題的管理團隊成員︰$discuz_user \r\n";
  631.                         $message.="原因︰\r\n $reason \r\n";
  632.                         $message.="===================================\r\n";
  633.                         $db->query("INSERT INTO $table_pms (msgtoid, msgfrom, msgfromid, folder, new, subject, dateline, message)
  634.                                 VALUES('$uid', '$discuz_user', '$discuz_uid', 'inbox', '1', '$subject', '$timestamp', '$message')");
  635.                         $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$uid'");
  636.                         }

  637.         //短消息通知HACK by Btaoto Plus1.0 END
  638.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  639.         }

  640. } else {

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

  642. }

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

  645.         if(!$action) {
  646.                 $action = $GLOBALS['action'];
  647.         }
  648.         if (!$thread['tid']) $thread['tid']=intval($GLOBALS['tid']);
  649.         if ($action == 'moderate'){
  650.                 $action .='_'.$operation;
  651.                 $thread[subject] = $tids;
  652.                 $thread[tid] = 0;
  653.         }
  654.         @$fp = fopen(DISCUZ_ROOT.'./forumdata/modslog.php', 'a');
  655.         @flock($fp, 2);
  656.         @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");
  657.         @fclose($fp);
  658. }

  659. function accesscheck($query) {
  660.         global $db,$fid;
  661.         while($thread = $db->fetch_array($query)) {
  662.                 if($thread['fid'] <> $fid){
  663.                         showmessage('admin_moderate_accesserror', NULL, 'HALTED');
  664.                 }
  665.         }
  666. }

  667. ?>
复制代码
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-16 03:53 , Processed in 0.194994 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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