/* [Discuz!] (C)2001-2007 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: topicadmin.php 16905 2008-11-27 05:50:59Z cnteacher $ */ define('CURSCRIPT', 'topicadmin'); define('NOROBOT', TRUE); require_once './include/common.inc.php'; require_once DISCUZ_ROOT . './include/post.func.php'; require_once DISCUZ_ROOT . './include/misc.func.php'; $discuz_action = 201; $modpostsnum = $iscircleadmin = 0; $resultarray = $thread = array(); if ($gid = intval($gid)) { if ($supe['circlestatus'] && $discuz_uid && $action == 'moderate' && $operation == 'delete' && supe_submitcheck(1)) { supe_dbconnect(); $query = $supe['db']->query("SELECT COUNT(*) FROM {$supe[tablepre]}groupuid WHERE gid='{$gid}' AND uid='{$discuz_uid}' AND flag>1", 'SILENT'); $iscircleadmin = $db->result($query, 0); } } if (!$discuz_uid || !($forum['ismoderator'] || $iscircleadmin)) { showmessage('admin_nopermission', NULL, 'HALTED'); } if ($forum['type'] == 'forum') { $navigation = "» <a href=\"forumdisplay.php?fid={$fid}\">{$forum['name']}</a>"; $navtitle = strip_tags($forum['name']); } else { $fup = $db->fetch_first("SELECT fid, name FROM {$tablepre}forums WHERE fid='{$forum['fup']}'"); $navigation = "» <a href=\"forumdisplay.php?fid={$fup['fid']}\">{$fup['name']}</a> » <a href=\"forumdisplay.php?fid={$fid}\">{$forum['name']}</a> "; $navtitle = strip_tags($fup['name']) . ' - ' . strip_tags($forum['name']);
if (!$discuz_uid && !(!$forum['replyperm'] && $allowreply || $forum['replyperm'] && forumperm($forum['replyperm']))) { showmessage('group_nopermission', NULL, 'NOPERM'); } elseif (empty($forum['allowreply'])) { if (!$forum['replyperm'] && !$allowreply) { showmessage('group_nopermission', NULL, 'NOPERM'); } elseif ($forum['replyperm'] && !forumperm($forum['replyperm'])) { showmessage('post_forum_newreply_nopermission', NULL, 'HALTED'); } } if (empty($thread)) { showmessage('thread_nonexistence'); } elseif ($thread['price'] > 0 && $thread['special'] == 0 && !$discuz_uid) { showmessage('group_nopermission', NULL, 'NOPERM'); } checklowerlimit($replycredits); if (!supe_submitcheck() && !submitcheck('replysubmit', 0, $seccodecheck, $secqaacheck)) { if ($thread['special'] == 2 && ((!isset($addtrade) || $thread['authorid'] != $discuz_uid) && !($tradenum = $db->result($db->query("SELECT count(*) FROM {$tablepre}trades WHERE tid='{$tid}'"), 0)))) { showmessage('trade_newreply_nopermission', NULL, 'HALTED'); } include_once language('misc'); if (isset($repquote)) { $thaquote = $db->fetch_first("SELECT tid, fid, author, authorid, first, message, useip, dateline, anonymous, status FROM {$tablepre}posts WHERE pid='{$repquote}' AND invisible='0'"); if ($thaquote['tid'] != $tid) { showmessage('undefined_action', NULL, 'HALTED'); } if (!($thread['price'] && !$thread['special'] && $thaquote['first'])) { $quotefid = $thaquote['fid']; $message = $thaquote['message']; if ($bannedmessages && $thaquote['authorid']) { $author = $db->fetch_first("SELECT groupid FROM {$tablepre}members WHERE uid='{$thaquote['authorid']}'"); if (!$author['groupid'] || $author['groupid'] == 4 || $author['groupid'] == 5) {