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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

〔2.5 SP1〕用户精华帖数统计 1.51

[复制链接]
折翼の天使♂ 发表于 2005-9-13 12:58:58 | 显示全部楼层

我试过了``没问题!!

解决帖子中不显示的方法!

之前我们在viewthread.htm加过

  1. <!----------------------------------------------------------------
  2.     User's Digest Counting 1.51 By Polo!
  3.     Added Next Line
  4.    ---------------------------------------------------------------->

  5.         <!--{if $post[userdigests]}-->{lang thread_digest} $post[userdigests]<br><!--{/if}-->

  6. <!---------------------------------------------------------------->
复制代码


所以在viewthread.htm要找
  1. <!--{if $post[userdigests]}-->{lang thread_digest} $post[userdigests]<br><!--{/if}-->
复制代码


替换为
  1. <!--{if $post[userdigests]}-->{lang thread_digest} $post[userdigests]<br><!--{else}-->
  2. {lang thread_digest} 0<br><!--{/if}-->
复制代码


搞定!!!
回复

使用道具 举报

折翼の天使♂ 发表于 2005-9-13 13:11:26 | 显示全部楼层
再分享个看这个方法帖啲心得!

作者一直要我们替换这,替换那``
其实不必!!作者也许是为了留名``嘻``或者是为了`方便再改时`做个标志``


注意看下面啲``

  1. <!----------------------------------------------------------------
  2.     User's Digest Counting 1.51 By Polo!
  3.     Added Next Line
  4.    ---------------------------------------------------------------->

  5.         <!--{if $post[userdigests]}-->{lang thread_digest} $post[userdigests]<br><!--{/if}-->

  6. <!---------------------------------------------------------------->
复制代码


其中其实只有``
  1. <!--{if $post[userdigests]}-->{lang thread_digest} $post[userdigests]<br><!--{/if}-->
复制代码

需加添加!!!!

再如``

  1. // ----------------------------------------------------------------
  2.         //  User's Digest Counting 1.51 By Polo!
  3.         //  Added: m.userdigests,
  4.         // ----------------------------------------------------------------

  5.         $post_user_info_sql = 'm.username, m.gender, m.groupid, m.adminid, m.regdate, m.lastactivity, m.postnum, m.credit, m.userdigests, m.email, m.site, m.icq, m.oicq, m.yahoo, m.msn, m.location, m.avatar, m.avatarwidth, m.avatarheight, m.signature, m.customstatus, m.showemail';

  6.         // ----------------------------------------------------------------
复制代码


其中其实只有``
  1. m.userdigests,
复制代码

需加添加!!!!


作者有说明``大家``要认真看!!
  1. //   Added: m.userdigests,
复制代码


就是说"其实要添加啲内容"```

这样大家在Viewthread.htm,和viewpro.htm就容易改了``
不妨碍我们以前改啲!!
回复

使用道具 举报

fhg007 发表于 2005-9-13 14:43:54 | 显示全部楼层
这个好难改啊...都有谁好了呢?
回复

使用道具 举报

折翼の天使♂ 发表于 2005-9-13 15:11:20 | 显示全部楼层
我早上```弄OK啦``有空去我论坛看看!
回复

使用道具 举报

拒买日本货 发表于 2005-9-14 12:21:50 | 显示全部楼层
所有都按照步骤来做..

在加精华.提升主题.移动主题等动作时...结果显示完成,但是白屏!!!

经排查..和topicadmin.php文件有关...

就算拿安装DZ2.5SP的原始文件来安装,结果也一样的白屏..

证明与其他插件冲突无关.........
本人的topicadmin.php文件:

<?php

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

require './include/common.php';
require_once DISCUZ_ROOT.'./include/post.php';
require $discuz_root.'./include/discuzcode.php';
//全局定义短信内容之一
$msg_2="

如有疑问,请查看社区守则以及各版块置顶的管理规则,或向管理员反映。";

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

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


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

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



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

function ctrl_msg(){
        global $title,$content,$docredit,$domoney,$msg,$jf,$lb;
        $title = dhtmlspecialchars(censor(trim($title)));
        $content = dhtmlspecialchars(censor(trim($content)));
        $docredit = dhtmlspecialchars(censor(trim($docredit)));
        $domoney = dhtmlspecialchars(censor(trim($domoney)));
        $msg = trim(censor(parseurl($msg)));
        if($title =="" and $content ==""){showmessage('admin_ctrl_invalid');}
        if ($docredit >$jf or $docredit < -$jf or $domoney >$lb or $domoney < -$lb){showmessage('admin_ctrl2_invalid');}
}
////操作原因,分值判断





$discuz_action = 151;

$tid   = $tid ? $tid :'';
$page  = intval($page);
$fpage = intval($fpage);

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

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

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

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

if($action == 'moderate') {
        if(!is_array($moderate) || !count($moderate)) {
                showmessage('admin_moderate_nothread');
        }elseif(!$operation){
                showmessage('admin_moderate_nooperation');
        }
        $tids = implode_ids($moderate);
        $query = $db->query("SELECT * FROM $table_threads WHERE tid IN($tids) ");
        accesscheck($query);
        $query = $db->query("SELECT * FROM $table_threads WHERE tid IN($tids) ");

        if(!submitcheck('moderatesubmit')){
                $threadlist = array();
                while($thread = $db->fetch_array($query)) {
                        if($thread['fid'] == $fid){
                                $thread['lastposterenc'] = rawurlencode($thread['lastposter']);
                                if($thread['attachment']) {
                                        require_once DISCUZ_ROOT.'./include/attachment.php';
                                        $thread['attachment'] = attachtype($thread['attachment']).' ';
                                } else {
                                        $thread['attachment'] = '';
                                }
                                $thread[subject] = cutstr($thread[subject],77);
                                $thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
                                $thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);
                                $threadlist[] = $thread;
                        }
                }
               
                if(!$threadlist) showmessage('admin_moderate_nothread');

                if($operation == 'move') {
                        require_once DISCUZ_ROOT.'./include/forum.php';
                        $forumselect = forumselect();
                }
                include template('topicadmin_moderate');
       
        }else{
       
                if($operation == 'move' && $allowmove) {
                        if(!$moveto) {
                                showmessage('admin_move_invalid');
                        }

                       
ctrl_msg();   //调用函数


        $query= $db->query("SELECT name FROM $table_forums WHERE fid=$fid");
        while($result = $db->fetch_array($query))
        {
            $czfirstfn = $result['name'];
        }
         
        $query= $db->query("SELECT name FROM $table_forums WHERE fid=$moveto");
        while($result = $db->fetch_array($query))
        {
            $czsecondfn = $result['name'];
        }
//帖子操作短信通知 hack by xiori 2005-3-18


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

以下为".$discuz_user."给您的附言:".$msg."";
        }
        while($memberid = $db->fetch_array($query)) {

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

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

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

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

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

                        if ($forum['type'] == 'sub') {
                                $query= $db->query("SELECT fup FROM $table_forums WHERE fid='$fid' LIMIT 1");
                                $fup = $db->result($query, 0);
                                updateforumcount($fup);
                        }
                        modlog();
                        updateforumcount($moveto);
                        updateforumcount($fid);
                        showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");
  // ------------------------------------------------------------
        //  Multi Drop Threads
        //  28-08-2005 By Polo!
        // ------------------------------------------------------------

                } elseif($operation == 'drop') {

                        $query = $db->query("SELECT lastpost FROM $table_threads WHERE fid='$fid' ORDER BY lastpost ASC LIMIT 1");
                        $newlastpost = $db->result($query, 0);

                        $db->query("UPDATE $table_threads SET lastpost='$newlastpost' WHERE tid IN($tids)");
                        $query = $db->query("SELECT subject, lastposter, lastpost FROM $table_threads WHERE fid='$fid' ORDER BY lastpost DESC LIMIT 1");
                        $thread = $db->fetch_array($query);
                        $thread['lastposter'] = addslashes($thread['lastposter']);
                        $db->query("UPDATE $table_forums SET lastpost='$thread[subject]\t$thread[lastpost]\t$thread[lastposter]' WHERE fid='$fid' $fupadd");

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

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


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

以下为".$discuz_user."给您的附言:".$msg."";
        }
        while($memberid = $db->fetch_array($query)) {

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

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

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

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



                        $db->query("UPDATE $table_threads SET displayorder='$level' WHERE tid IN ($tids)");
                        modlog();
                        showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");

                }elseif($operation == 'delete' && $allowdelpost) {
                       
ctrl_msg();   //调用函数

                $uids = $comma = '';
                        $haveattach = 0;
                        $query = $db->query("SELECT authorid ,aid FROM $table_posts WHERE tid IN ($tids)");
                        while($post = $db->fetch_array($query)) {
                                $uids .= "$comma$post[authorid]";
                                $comma = ',';
                                if ($post['aid']) $haveattach++;
                        }
                        updatemember('-', $uids, '0');
            
                        if ($haveattach){
                                $query = $db->query("SELECT attachment FROM $table_attachments WHERE tid IN ($tids)");
                                while($attach = $db->fetch_array($query)) {
                                        @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
                                }
                                $db->query("DELETE FROM $table_attachments WHERE tid IN ($tids)");
                        }
                       
//帖子操作短信通知 hack by xiori 2005-3-18


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

以下为".$discuz_user."给您的附言:".$msg."";
        }
        while($memberid = $db->fetch_array($query)) {

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

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

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

                        $db->query("DELETE FROM $table_threads WHERE tid IN ($tids)");
                        $db->query("DELETE FROM $table_polls WHERE tid IN ($tids)");
                        $db->query("DELETE FROM $table_posts WHERE tid IN ($tids)");
                if ($forum['type'] == 'sub') {
        updateforumcount($fup['fid']);
}

                        updateforumcount($fid);

                        modlog();
                        showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");
}elseif($operation == 'highlight' && $allowhighlight){
                        accesscheck($query);
                        $string = sprintf('%02d', $thread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                for($i = 1; $i <= 3; $i++) {
            $stylecheck[$i] = $stylestr[$i - 1] ? 'checked' : NULL;
                }
                        $stylebin = '';
                for($i = 1; $i <= 3; $i++) {
            $stylebin .= empty($highlight_style[$i]) ? '0' : '1';
                }
                $highlight_style = bindec($stylebin);

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

                modlog();
                showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");
                }elseif($operation == 'close' && $allowclose){
                       
                        ctrl_msg();   //调用函数
                        $close = $type ? 1 : 0;
//帖子操作短信通知 hack by xiori 2005-3-18


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

以下为".$discuz_user."给您的附言:".$msg."";
        }
        while($memberid = $db->fetch_array($query)) {

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


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

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

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

                }
/*取消批量加入精华                       
                elseif($operation == 'digest' && $allowdigest){
                        if($level < 0 || $level > 3) {
                                showmessage('undefined_action', NULL, 'HALTED');
                        }
                        while($thread = $db->fetch_array($query)) {
                                if ($thread['fid'] == $fid && $thread['digest']<>$level){
                                        $digest_mark=($level-intval($thread['digest']))*$digestcredits;
                                        $db->query("UPDATE $table_threads SET digest='$level' WHERE tid='$thread[tid]'");
                                        if($digest_mark && $discuz_uid != $thread[authorid]) {
                                                $db->query("UPDATE $table_members SET credit=credit".($digest_mark > 0 ? '+' : '')."$digest_mark WHERE uid='$thread[authorid]'");
                                        }
                                }
                        }
                        modlog();
                        showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$page");
                }
               
取消批量加入精华 */               
                else{
                        showmessage('admin_nopermission', NULL, 'HALTED');
                }
        }

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

        if(!is_array($delete) || !count($delete)) {
                showmessage('admin_delpost_invalid');
        }

        if(!submitcheck('delpostsubmit')) {

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

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

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

        } else {

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

                $uids = $comma = '';
                $actionpost = $totalpost = $aids = 0;
                $query = $db->query("SELECT pid, authorid, aid FROM $table_posts WHERE tid='$tid'");
                $totalpost = $db->num_rows($query);
                while($post = $db->fetch_array($query)) {
                        if (in_array($post[pid], $delete)){
                                $uids .= "$comma$post[authorid]";
                                $comma = ',';
                                $actionpost ++;
                                if ($post['aid']) $aids .=','.$post[pid];
                        }
                }

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

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


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

以下为".$discuz_user."给您的附言:".$msg."";
        }
        while($memberid = $db->fetch_array($query)) {

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

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

        }
       
} else{
$query = $db->query("SELECT authorid FROM $table_posts WHERE pid IN ($pids)");
        while($memberid = $db->fetch_array($query)) {
if ($updateur != "1") {
                                $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");  
}
        }
}
//帖子操作短信通知 hack by xiori 2005-3-18
                if ($aids){
                        require_once DISCUZ_ROOT.'./include/attachment.php';
                        $query = $db->query("SELECT pid, attachment, filetype FROM $table_attachments WHERE pid IN ($aids)");
                        while($attach = $db->fetch_array($query)) {
                                        @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
                        }
                        $db->query("DELETE FROM $table_attachments WHERE pid IN ($aids)");
                        updatethread_type($tid , $thread['attachment']);
                }

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

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

        }

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

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

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

        } else {

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

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

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

        }

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

                include template('topicadmin_digest');

        } else {

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

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

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


if($ynmsg==1)
        {
if($content !=""){$title=$content;}
if ($msg !=""){
        $msg="

以下为".$discuz_user."给您的附言:".$msg."";
        }

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


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

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

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

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

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


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

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

        }

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

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

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

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

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

                include template('topicadmin_delete');

        } else {
                        ctrl_msg();   //调用函数

                $uids = $comma = '';
                $query = $db->query("SELECT authorid,aid FROM $table_posts WHERE tid='$tid'");
                $aids = 0;
                while($post = $db->fetch_array($query)) {
                        $uids .= "$comma$post[authorid]";
                        $comma = ',';
                        if ($post['aid']) $aids++;
                }
                updatemember('-', $uids, '0');



if($ynmsg==1)
        {
$czsubject="删除主题短消息通知";
if($content !=""){$title=$content;}
if ($msg !=""){
        $msg="

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

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

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

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

if ($updateur != "1") {
                                $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");   
     }
        }
       
} else{
$query = $db->query("SELECT authorid, subject FROM $table_posts WHERE tid='$tid'");
        while($memberid = $db->fetch_array($query)) {
if ($updateur != "1") {
                                $db->query("UPDATE $table_members SET money=money+$domoney,credit=credit+$docredit WHERE uid = '$memberid[authorid]'");  
}
        }
}
//帖子操作短信通知 hack by xiori 2005-3-18



                $db->query("DELETE FROM $table_threads WHERE tid='$tid'");
                $db->query("DELETE FROM $table_posts WHERE tid='$tid'");
                $db->query("DELETE FROM $table_polls WHERE tid='$tid'");
                if ($aids){
                        $query = $db->query("SELECT attachment FROM $table_attachments WHERE tid='$tid'");
                        while($attach = $db->fetch_array($query)) {
                                @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$attach['attachment']);
                        }
                        $db->query("DELETE FROM $table_attachments WHERE tid='$tid'");
                }
               
                updateforumcount($fid);
                if ($forum['type'] == 'sub') {
                        updateforumcount($fup['fid']);
                }

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

        }

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

        if(!submitcheck('closesubmit')) {

                include template('topicadmin_openclose');

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

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


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

以下为".$discuz_user."给您的附言:".$msg."";
        }
        while($memberid = $db->fetch_array($query)) {

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


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

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

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



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

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

        if(!submitcheck('movesubmit')) {

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

                $forumselect = forumselect();
                include template('topicadmin_move');

        } else {

                if(!$moveto) {
                        showmessage('admin_move_invalid');
                }


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

ctrl_msg();   //调用函数


        $query= $db->query("SELECT name FROM $table_forums WHERE fid=$fid");
        while($result = $db->fetch_array($query))
        {
            $czfirstfn = $result['name'];
        }
         
        $query= $db->query("SELECT name FROM $table_forums WHERE fid=$moveto");
        while($result = $db->fetch_array($query))
        {
            $czsecondfn = $result['name'];
        }
//帖子操作短信通知 hack by xiori 2005-3-18


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

以下为".$discuz_user."给您的附言:".$msg."";
        }
        while($memberid = $db->fetch_array($query)) {

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

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

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




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

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

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

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

        if(!submitcheck('topsubmit')) {

                include template('topicadmin_topuntop');

        } else {

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


if($ynmsg==1)
        {
if($content !=""){$title=$content;}
if ($msg !=""){
        $msg="

以下为".$discuz_user."给您的附言:".$msg."";
        }

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


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

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

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

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

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

        }

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

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

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

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

        include template('topicadmin_getip');

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

        if(!submitcheck('bumpsubmit')) {

                include template('topicadmin_bump');

        } else {

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

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

        }
// ------------------------------------------------------------
//  Drop Threads
//  26-06-2005 By Polo!
// ------------------------------------------------------------

} elseif($action == 'drop') {

        if(!submitcheck('dropsubmit')) {

                include template('topicadmin_drop');

        } else {
                $dropvalue = intval($dropvalue);

                if($dropvalue < 1 && $dropunit <> 'least') {
                        showmessage('admin_drop_invalid');
                }

                if(!in_array($dropunit, array('hour', 'day', 'month', 'page', 'threads', 'least'))) {
                        showmessage('admin_drop_unit_invalid');
                }

                $sqladd = NULL;
                $droptime = 0;

                if(in_array($dropunit, array('hour', 'day', 'month'))) {
                        switch($dropunit) {
                                case 'hour':                $droptime = $dropvalue * 3600;                break;
                                case 'day':                $droptime = $dropvalue * 86400;                break;
                                case 'hour':                $droptime = $dropvalue * 2592000;        break;
                        }
                        $droptime = $thread['lastpost'] - $droptime;
                        $sqladd = "AND lastpost<='$droptime' ORDER BY lastpost DESC LIMIT 1";
                } else        if(in_array($dropunit, array('page', 'threads'))) {
                        $query = $db->query("SELECT COUNT(*) FROM $table_threads WHERE fid='$fid' AND lastpost>'$thread[lastpost]'");
                        $threadscount = $db->result($query, 0);
                        if($dropunit == 'page') {
                                $threadscount = $threadscount + $dropvalue * $tpp;
                        } else {
                                $threadscount = $threadscount + $dropvalue + 1;
                        }
                        $sqladd = "ORDER BY lastpost DESC LIMIT $threadscount, ".($threadscount+1);
                } else {
                        $sqladd = "ORDER BY lastpost ASC LIMIT 1";
                }

                $query = $db->query("SELECT lastpost FROM $table_threads WHERE fid='$fid' $sqladd");
                $newlastpost = $db->result($query, 0);
                if(!$newlastpost) {
                        showmessage('admin_drop_value_toobig');
                }
                $db->query("UPDATE $table_threads SET lastpost='$newlastpost' WHERE tid='$tid' AND fid='$fid'");
                $query = $db->query("SELECT subject, lastposter, lastpost FROM $table_threads WHERE fid='$fid'  ORDER BY lastpost DESC LIMIT 1");
                $thread = $db->fetch_array($query);
                $thread['lastposter'] = addslashes($thread['lastposter']);
                $db->query("UPDATE $table_forums SET lastpost='$thread[subject]\t$thread[lastpost]\t$thread[lastposter]' WHERE fid='$fid' $fupadd");

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

        }

// ------------------------------------------------------------
} elseif($action == 'split' && $allowsplit) {

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

                $replies = $thread['replies'];
                if($replies <= 0) {
                        showmessage('admin_split_invalid');
                }

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

                include template('topicadmin_split');

        } else {

                if(!trim($subject)) {
                        showmessage('admin_split_subject_invalid');
                }
                $subject = $subject ? dhtmlspecialchars(censor(trim($subject))) :'';

                $pids = implode_ids( $split );

                if($pids) {

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

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

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

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

                        updatethreadcount($tid);
                        updatethreadcount($newtid);
                        updateforumcount($fid);

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

                } else {
                        showmessage('admin_split_new_invalid');
                }
        }

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

        if(!submitcheck('mergesubmit')) {

                include template('topicadmin_merge');

        } else {

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

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

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

                $db->query("UPDATE $table_attachments SET tid='$tid' WHERE tid='$othertid'");
                $db->query("DELETE FROM $table_threads WHERE tid='$othertid'");
                $db->query("UPDATE $table_threads SET views=views+$other[views], replies=replies+$other[replies] WHERE tid='$tid'");
               
                if($fid == $other['fid']) {
                        $db->query("UPDATE $table_forums SET threads=threads-1 WHERE fid='$fid' $fupadd");
                } else {
                        $db->query("UPDATE $table_forums SET threads=threads-1, posts=posts-$postsmerged WHERE fid='$other[fid]'");
                        $db->query("UPDATE $table_forums SET posts=$posts+$postsmerged WHERE fid='$fid' $fupadd");
                }

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

        }

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

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

        if(!$isadmin) {
                showmessage('admin_getip_nopermission', NULL, 'HALTED');
        }
        $member['useip']=$useip;
        $member['iplocation'] = convertip($member['useip']);

        include template('topicadmin_getip');

} elseif($action == 'modmarkread' && $post) {

        $db->query("UPDATE $table_threads SET markread='$post\t$discuz_user\t$timestamp' WHERE tid='$tid'");
        showmessage('admin_succeed', "forumdisplay.php?fid=$fid&page=$fpage");
} else {

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

}

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

        if(!$action) {
                $action = $GLOBALS['action'];
        }
        if (!$thread['tid']) $thread['tid']=intval($GLOBALS['tid']);
        if ($action == 'moderate'){
                $action .='_'.$operation;
                $thread[subject] = $tids;
                $thread[tid] = 0;
        }
        @$fp = fopen(DISCUZ_ROOT.'./forumdata/modslog.php', 'a');
        @flock($fp, 2);
        @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");
        @fclose($fp);
}

function accesscheck($query) {
        global $db,$fid;
        while($thread = $db->fetch_array($query)) {
                if($thread['fid'] <> $fid){
                        showmessage('admin_moderate_accesserror', NULL, 'HALTED');
                }
        }
}

?>

如何解决?
回复

使用道具 举报

sdywd 发表于 2005-9-16 06:07:01 | 显示全部楼层
谢谢Polo! 谢谢折翼の天使♂
我已经安装成功了 ^_^
回复

使用道具 举报

fhg007 发表于 2005-9-16 09:07:33 | 显示全部楼层
谁帮我装下
回复

使用道具 举报

sdywd 发表于 2005-9-17 14:08:50 | 显示全部楼层
原帖由 fhg007 于 2005-9-16 09:07 发表
谁帮我装下



其实挺简单的啊,自己研究研究,还可以学东西呢
回复

使用道具 举报

DreamerY 发表于 2005-9-21 17:42:48 | 显示全部楼层
这个如果是装过银行,和体力阅读权限等插件,是不是应该酌情更改?
PS:我是HTML盲
///----_-----\\\
回复

使用道具 举报

fhg007 发表于 2005-9-22 07:47:58 | 显示全部楼层
不要改啊?
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-27 16:11 , Processed in 0.113958 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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