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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

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

[复制链接]
闪电 发表于 2005-9-15 01:48:30 | 显示全部楼层
出去了晚上,来晚了,呜呜呜
回复

使用道具 举报

windgodman 发表于 2005-9-15 01:53:47 | 显示全部楼层
很不错的东西阿。可惜用不上。。唉。。
回复

使用道具 举报

爱雨冷雪 发表于 2005-9-15 02:39:09 | 显示全部楼层
呜..跟这有冲突咯.晕呼呼...
https://discuz.dismall.com/viewth ... 1&highlight=###
回复

使用道具 举报

totoromehk 发表于 2005-9-15 03:31:05 | 显示全部楼层
Parse error: parse error, unexpected T_STRING in /home/ascm/public_html/bbs/topicadmin.php on line 381

請問為何修改後出現以上錯呢??



  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.         accesscheck($query);
  50.         $query = $db->query("SELECT * FROM $table_threads WHERE tid IN($tids) ");

  51.         if(!submitcheck('moderatesubmit')){
  52.                 $threadlist = array();
  53.                 while($thread = $db->fetch_array($query)) {
  54.                         if($thread['fid'] == $fid){
  55.                                 $thread['lastposterenc'] = rawurlencode($thread['lastposter']);
  56.                                 if($thread['attachment']) {
  57.                                         require_once DISCUZ_ROOT.'./include/attachment.php';
  58.                                         $thread['attachment'] = attachtype($thread['attachment']).' ';
  59.                                 } else {
  60.                                         $thread['attachment'] = '';
  61.                                 }
  62.                                 $thread[subject] = cutstr($thread[subject],77);
  63.                                 $thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
  64.                                 $thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);
  65.                                 $threadlist[] = $thread;
  66.                         }
  67.                 }
  68.                
  69.                 if(!$threadlist) showmessage('admin_moderate_nothread');

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

  82.                        

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

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

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

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

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

  114.                         if ($haveattach){
  115.                                 $query = $db->query("SELECT attachment FROM $table_attachments WHERE tid IN ($tids)");
  116.                                 while($attach = $db->fetch_array($query)) {
  117.                                         @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
  118.                                 }
  119.                                 $db->query("DELETE FROM $table_attachments WHERE tid IN ($tids)");
  120.                         }
  121.                        
  122.                         $db->query("DELETE FROM $table_threads WHERE tid IN ($tids)");
  123.                         $db->query("DELETE FROM $table_polls WHERE tid IN ($tids)");
  124.                         $db->query("DELETE FROM $table_posts WHERE tid IN ($tids)");
  125. if ($forum['type'] == 'sub') {
  126.         updateforumcount($fup['fid']);
  127. }

  128.                         updateforumcount($fid);

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

  131.                 }elseif($operation == 'close' && $allowclose){
  132.                        
  133.                         $close = $type ? 1 : 0;
  134.                         $db->query("UPDATE $table_threads SET closed='$close' WHERE tid in($tids)");
  135.                         modlog();
  136.                         showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");

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

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

  157.         if(!is_array($delete) || !count($delete)) {
  158.                 showmessage('admin_delpost_invalid');
  159.         }

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

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

  163.                         $deleteid = '';
  164.                         foreach($delete as $id) {
  165.                                 $deleteid .= '<input type="hidden" name="delete[]" value="'.$id.'">';
  166.                         }

  167.                         include template('topicadmin_delpost');
  168.                        
  169.                 } else {
  170.                         header("Location: {$boardurl}topicadmin.php?action=delete&fid=$fid&tid=$tid&page=$page&fpage=$fpage");
  171.                 }

  172.         } else {

  173.                 $pids = implode_ids( $delete );

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

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

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

  204.                 $db->query("DELETE FROM $table_posts WHERE pid IN ($pids)");
  205.                 updatethreadcount($tid);
  206.                 updateforumcount($fid);

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

  209.         }

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

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

  214.                 for($i = 1; $i <= 3; $i++) {
  215.                         $stylecheck[$i] = $stylestr[$i - 1] ? 'checked' : NULL;
  216.                 }
  217.                 $colorcheck = array($string[1] => 'checked');
  218.                
  219.                 include template('topicadmin_highlight');

  220.         } else {

  221.                 $stylebin = '';
  222.                 for($i = 1; $i <= 3; $i++) {
  223.                         $stylebin .= empty($highlight_style[$i]) ? '0' : '1';
  224.                 }
  225.                 $highlight_style = bindec($stylebin);

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

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

  232.         }

  233. } elseif($action == 'xm_highlight' && $allowhighlight) {
  234.         if(!submitcheck('xm_highlightsubmit')) {
  235.       
  236.                 $xm_hl_string=explode(',',$thread['xm_hl']);
  237.                
  238.                 for($i = 1; $i <=9; $i++) {
  239.                         $xu_check[$i] =$i==$xm_hl_string[0] ?  'checked' : NULL;
  240.                                                                         
  241.            }

  242.           if($xm_hl_string[0]){            
  243.            switch($xm_hl_string[0]){
  244.            
  245.            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];
  246.                    break;                                    
  247.            
  248.            case 2:
  249.                    $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];                  
  250.                    break;
  251.                               
  252.            case 3:
  253.                    $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];                           
  254.                    break;           
  255.            
  256.            case 4:
  257.                    $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];                     
  258.                    break;           
  259.                      
  260.            case 5:
  261.                    $xm_id_51=$xm_hl_string[1];$xm_id_52=$xm_hl_string[2];               
  262.                    break;   
  263.            
  264.            case 6:
  265.                    $xm_id_61=$xm_hl_string[1];$xm_id_62=$xm_hl_string[2];$xm_id_63=$xm_hl_string[3];                             
  266.                    break;
  267.            case 7:
  268.                    $xm_id_71=$xm_hl_string[1];$xm_id_72=$xm_hl_string[2];$xm_id_73=$xm_hl_string[3];                             
  269.                    break;
  270.            case 8:
  271.                    $xm_id_81=$xm_hl_string[1];$xm_id_82=$xm_hl_string[2];$xm_id_83=$xm_hl_string[3];                             
  272.                    break;                                       
  273.                      
  274.            default: break;         
  275.               }
  276.            
  277.            }
  278.         include template('topicadmin_xm_highlight');

  279.         } else {

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

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

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

  332.                 include template('topicadmin_digest');

  333.         } else {

  334.                 if($level < 0 || $level > 3) {
  335.                         showmessage('undefined_action', NULL, 'HALTED');
  336.                 }
  337.                 $digest_mark=($level-intval($thread['digest']))*$digestcredits;

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

  339.                 if($digest_mark && $discuz_uid != $thread['authorid'] ) {
  340.                         $db->query("UPDATE $table_members SET credit=credit".($digest_mark > 0 ? '+' : '')."$digest_mark WHERE uid='$thread[authorid]'");
  341.                 }
  342.                 modlog();
  343.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");

  344.         }

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

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

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

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

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

  354.                 include template('topicadmin_delete');

  355.         } else {

  356.                 $uids = $comma = '';
  357.                 $query = $db->query("SELECT authorid,aid FROM $table_posts WHERE tid='$tid'");
  358.                 $aids = 0;
  359.                 while($post = $db->fetch_array($query)) {
  360.                         $uids .= "$comma$post[authorid]";
  361.                         $comma = ',';
  362.                         if ($post['aid']) $aids++;
  363.                 }
  364.                 updatemember('-', $uids, $deletedcredits);

  365.                 $db->query("DELETE FROM $table_threads WHERE tid='$tid'");
  366.                 $db->query("DELETE FROM $table_posts WHERE tid='$tid'");
  367.                 $db->query("DELETE FROM $table_polls WHERE tid='$tid'");

  368.                
  369.                 if ($aids){
  370.                         $query = $db->query("SELECT attachment FROM $table_attachments WHERE tid='$tid'");
  371.                         while($attach = $db->fetch_array($query)) {
  372.                                 @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
  373.                         }
  374.                         $db->query("DELETE FROM $table_attachments WHERE tid='$tid'");
  375.                 }
  376.                
  377.                 updateforumcount($fid);
  378.                 if ($forum['type'] == 'sub') {
  379.                         updateforumcount($fup['fid']);
  380.                 }

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

  383.         }

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

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

  386.                 include template('topicadmin_openclose');

  387.         } else {
  388.                 $openclose = $thread['closed'] ? 0 : 1;
  389.                 $db->query("UPDATE $table_threads SET closed='$openclose' WHERE tid='$tid' AND fid='$fid'");
  390.                 modlog();
  391.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");
  392.         }

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

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

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

  396.                 $forumselect = forumselect();
  397.                 include template('topicadmin_move');

  398.         } else {

  399.                 if(!$moveto) {
  400.                         showmessage('admin_move_invalid');
  401.                 }

  402.                 $displayorderadd = !$adminglobal ? ", displayorder='0'" : NULL;
  403.                 if($type == 'normal') {
  404.                         $db->query("UPDATE $table_threads SET fid='$moveto' $displayorderadd WHERE tid='$tid' AND fid='$fid'");
  405.                         $db->query("UPDATE $table_posts SET fid='$moveto' WHERE tid='$tid' AND fid='$fid'");
  406.                 } else {
  407.                         $db->query("INSERT INTO $table_threads (fid, creditsrequire, iconid, author, authorid, subject, dateline, lastpost, lastposter, views, replies, displayorder, digest, closed, poll, attachment)
  408.                                 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')");

  409.                         $db->query("UPDATE $table_threads SET fid='$moveto' $displayorderadd WHERE tid='$tid' AND fid='$fid'");
  410.                         $db->query("UPDATE $table_posts SET fid='$moveto' WHERE tid='$tid' AND fid='$fid'");
  411.                 }

  412.                 if ($forum['type'] == 'sub') {
  413.                         $query= $db->query("SELECT fup FROM $table_forums WHERE fid='$fid' LIMIT 1");
  414.                         $fup = $db->result($query, 0);
  415.                         updateforumcount($fup);
  416.                 }

  417.                 modlog();
  418.                 updateforumcount($moveto);
  419.                 updateforumcount($fid);
  420.                 showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");
  421.         }

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

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

  424.                 include template('topicadmin_topuntop');

  425.         } else {

  426.                 if($level < 0 || $level > 3) {
  427.                         showmessage('undefined_action');
  428.                 }
  429.                 $db->query("UPDATE $table_threads SET displayorder='$level' WHERE tid='$tid' AND fid='$fid'");

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

  432.         }

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

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

  435.         $query = $db->query("SELECT m.adminid, p.useip FROM $table_posts p
  436.                                 LEFT JOIN $table_members m ON m.uid=p.authorid
  437.                                 WHERE pid='$pid' AND tid='$tid'");
  438.         if(!$member = $db->fetch_array($query)) {
  439.                 showmessage('thread_nonexistence', NULL, 'HALTED');
  440.         } elseif(($member['adminid'] == 1 && $adminid > 1) || ($member['adminid'] == 2 && $adminid > 2)) {
  441.                 showmessage('admin_getip_nopermission', NULL, 'HALTED');
  442.         }

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

  444.         include template('topicadmin_getip');

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

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

  447.                 include template('topicadmin_bump');

  448.         } else {

  449.                 $query = $db->query("SELECT subject, lastposter, lastpost FROM $table_threads WHERE tid='$tid' LIMIT 1");
  450.                 $thread = $db->fetch_array($query);
  451.                 $thread[subject] = addslashes($thread['subject']);
  452.                 $thread[lastposter] = addslashes($thread['lastposter']);
  453.                 $db->query("UPDATE $table_threads SET lastpost='$timestamp' WHERE tid='$tid' AND fid='$fid'");
  454.                 $db->query("UPDATE $table_forums SET lastpost='$thread[subject]\t$timestamp\t$thread[lastposter]' WHERE fid='$fid' $fupadd");

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

  457.         }

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

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


  461.                 $replies = $thread['replies'];
  462.                 if($replies <= 0) {
  463.                         showmessage('admin_split_invalid');
  464.                 }

  465.                 $postlist = array();
  466.                 $query = $db->query("SELECT * FROM $table_posts WHERE tid='$tid' ORDER BY dateline");
  467.                 while($post = $db->fetch_array($query)) {
  468.                         $post['message'] = postify($post['message'], $post['smileyoff'], $post['bbcodeoff']);
  469.                         $postlist[] = $post;
  470.                 }

  471.                 include template('topicadmin_split');

  472.         } else {

  473.                 if(!trim($subject)) {
  474.                         showmessage('admin_split_subject_invalid');
  475.                 }
  476.                 $subject = $subject ? dhtmlspecialchars(censor(trim($subject))) :'';

  477.                 $pids = implode_ids( $split );

  478.                 if($pids) {

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

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

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

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

  489.                         updatethreadcount($tid);
  490.                         updatethreadcount($newtid);
  491.                         updateforumcount($fid);

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

  494.                 } else {
  495.                         showmessage('admin_split_new_invalid');
  496.                 }
  497.         }

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

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

  500.                 include template('topicadmin_merge');

  501.         } else {

  502.                 $query = $db->query("SELECT fid, views, replies FROM $table_threads WHERE tid='$othertid'");
  503.                 if(!$other = $db->fetch_array($query)) {
  504.                         showmessage('admin_merge_nonexistence');
  505.                 }
  506.                 if(!$adminglobal && $other['fid'] != $forum['fid']) {
  507.                         showmessage('admin_merge_invalid');
  508.                 }

  509.                 $other['views'] = intval($other['views']);
  510.                 $other['replies']++;

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

  513.                 $db->query("UPDATE $table_attachments SET tid='$tid' WHERE tid='$othertid'");
  514.                 $db->query("DELETE FROM $table_threads WHERE tid='$othertid'");
  515.                 $db->query("UPDATE $table_threads SET views=views+$other[views], replies=replies+$other[replies] WHERE tid='$tid'");
  516.                
  517.                 if($fid == $other['fid']) {
  518.                         $db->query("UPDATE $table_forums SET threads=threads-1 WHERE fid='$fid' $fupadd");
  519.                 } else {
  520.                         $db->query("UPDATE $table_forums SET threads=threads-1, posts=posts-$postsmerged WHERE fid='$other[fid]'");
  521.                         $db->query("UPDATE $table_forums SET posts=$posts+$postsmerged WHERE fid='$fid' $fupadd");
  522.                 }

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

  525.         }

  526. } else {

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

  528. }

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

  531.         if(!$action) {
  532.                 $action = $GLOBALS['action'];
  533.         }
  534.         if (!$thread['tid']) $thread['tid']=intval($GLOBALS['tid']);
  535.         if ($action == 'moderate'){
  536.                 $action .='_'.$operation;
  537.                 $thread[subject] = $tids;
  538.                 $thread[tid] = 0;
  539.         }
  540.         @$fp = fopen(DISCUZ_ROOT.'./forumdata/modslog.php', 'a');
  541.         @flock($fp, 2);
  542.         @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");
  543.         @fclose($fp);
  544. }

  545. function accesscheck($query) {
  546.         global $db,$fid;
  547.         while($thread = $db->fetch_array($query)) {
  548.                 if($thread['fid'] <> $fid){
  549.                         showmessage('admin_moderate_accesserror', NULL, 'HALTED');
  550.                 }
  551.         }
  552. }

  553. ?>
复制代码
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-15 06:23:37 | 显示全部楼层
原帖由 oytktk 于 2005-9-15 00:17 发表
只有一句话,安装要仔细.


真是好兄弟啊

我昨天晚上11.10就熄等了啊

呵呵
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-15 06:56:36 | 显示全部楼层
原帖由 totoromehk 于 2005-9-15 03:31 发表
Parse error: parse error, unexpected T_STRING in /home/ascm/public_html/bbs/topicadmin.php on line 381

請問為何修改後出現以上錯呢??



<?php

/*
:::::::::::::::::::::::::::::::: ...


我看不出错来啊

我拿你贴出来的代码
把我自己 的覆盖去测试
完全可以的
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-15 07:23:41 | 显示全部楼层
原帖由 爱雨冷雪 于 2005-9-15 02:39 发表
呜..跟这有冲突咯.晕呼呼...
https://discuz.dismall.com/viewth ... 1&highlight=###



解决的方法:



       
  1. $thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
  2.         $thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);
  3.         //start
  4. if((!$forum['viewperm'] && !$allowview) || ($forum['viewperm'] && !strstr($forum['viewperm'], "\t$groupid\t"))) {
  5.         $thread['message'] = "谢谢您的访问!由于权限不够,您仅可浏览本版主题标题。";
  6.     } elseif($thread['creditsrequire'] && $thread['creditsrequire'] > $credit && !$ismoderator) {
  7.         include language('messages');
  8.         eval("\$show_message = "".$language[thread_nopermission]."";");
  9.         $thread['message'] =  $show_message;
  10.     } else {
  11.               $thread['message']  = preg_replace("/\[hide=?\d*\](.+?)\[\/hide\]/is", "**** 回复后才可查看信息 *****", $thread['message'] );
  12.         $thread['message']  = preg_replace("/\[sell=?\d*\](.+?)\[\/sell\]/is", "**** 付費信息,已經隱藏 *****", $thread['message'] );
  13.         $thread['message']  = preg_replace("/\[php](.+?)\[\/php\]/is", "**** 内容为PHP代码 *****", $thread['message'] );
  14.         $thread['message']  = preg_replace("/\[code](.+?)\[\/code\]/is", "**** 内容为普通代码 *****", $thread['message'] );
  15.         $thread['message']  = preg_replace("/\[quote](.+?)\[\/quote\]/is", "**** 内容为引用信息 *****", $thread['message'] );
  16.         $thread['message']  = preg_replace("/\[url=?(.+?)\](.+?)\[\/url\]/is", "**** 此处为超级链接 *****", $thread['message'] );
  17.         $thread['message']  = preg_replace("/\[img](.+?)\[\/img\]/is", "**** 此处为图片链接 *****", $thread['message'] );
  18.         $thread['message'] = str_replace('"', '"', $thread['message']);
  19.         $thread['message'] = str_replace('<', '&lt;', $thread['message']);
  20.         $thread['message'] = str_replace('>', '&gt;', $thread['message']);
  21.         $thread['message'] = str_replace("\r\n", " ◇ ", $thread['message']);    //去掉回车,紧凑显示
  22.         $thread['message'] = cutstr($thread['message'],60);        //截断
  23.         }
  24.     if($thread[replies]) {
  25.         $thread['shortmsg'] = '<b>主题:'.$thread[subject].'</b><br><b>回复:</b>'.$thread[re_subject].'<br><font color=red>'.$thread[message].'</font>'.'<br><font class=numtxt>最后发表:'.$thread[lastposter].'<br>主题作者:'.$thread[author].'&nbsp; 发表时间:'.$thread[dateline].'</font>';
  26.     } else {
  27.         $thread['shortmsg'] = '<b>主题:'.$thread[subject].'</b><br><font color=red>'.$thread[message].'</font>'.'<br>主题作者:'.$thread[author].'&nbsp; 发表时间:'.$thread[dateline].'</font>';
  28.     }
  29.     //end  
复制代码



剪贴到:

  1. if($thread['xm_hl']) {
复制代码


的上面.
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-15 07:33:49 | 显示全部楼层
原帖由 爱雨冷雪 于 2005-9-15 02:39 发表
呜..跟这有冲突咯.晕呼呼...
https://discuz.dismall.com/viewth ... 1&highlight=###


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

有 的话

嘿嘿

pm给我下

免得用了哪个的话

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

使用道具 举报

 楼主| lu5266 发表于 2005-9-15 07:46:07 | 显示全部楼层
原帖由 lu5266 于 2005-9-15 06:56 发表


我看不出错来啊

我拿你贴出来的代码
把我自己 的覆盖去测试
完全可以的



由于此

请你的出错的在详细的说明下
回复

使用道具 举报

爱雨冷雪 发表于 2005-9-15 08:01:53 | 显示全部楼层
原帖由 lu5266 于 2005-9-15 07:23 发表



解决的方法:



       
        [code]$thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
        $thread['lastpost'] = gmdate("$dateformat $timeformat", $thread ...

嘻嘻,解决~~~没问题咯~~
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-2 20:30 , Processed in 0.101240 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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