📄 moderate.inc.php
字号:
$uids = 0;
while($member = $db->fetch_array($query)) {
$uids .= ','.$member['uid'];
}
$db->query("DELETE FROM {$tablepre}members WHERE uid IN ($uids)");
$numdeleted = $db->affected_rows();
$db->query("DELETE FROM {$tablepre}memberfields WHERE uid IN ($uids)");
$db->query("DELETE FROM {$tablepre}validating WHERE uid IN ($uids)");
cpmsg('members_delete_succeed');
}
}
} else {
require_once DISCUZ_ROOT.'./include/forum.func.php';
require_once DISCUZ_ROOT.'./include/post.func.php';
$fids = 0;
$recyclebins = array();
if($adminid == 3) {
$query = $db->query("SELECT m.fid, f.recyclebin FROM {$tablepre}moderators m LEFT JOIN {$tablepre}forums f ON f.fid=m.fid WHERE m.uid='$discuz_uid'");
while($forum = $db->fetch_array($query)) {
$fids .= ','.$forum['fid'];
$recyclebins[$forum['fid']] = $forum['recyclebin'];
}
} else {
$query = $db->query("SELECT fid, recyclebin FROM {$tablepre}forums WHERE status='1' AND type<>'group'");
while($forum = $db->fetch_array($query)) {
$recyclebins[$forum['fid']] = $forum['recyclebin'];
}
}
$fidadd = $fids ? array('fids' => "fid IN ($fids)", 'and' => ' AND ', 't' => 't.', 'p' => 'p.') : array();
}
if($action == 'modthreads') {
shownav('menu_moderate_modthreads');
$validatedthreads = array();
if(submitcheck('modsubmit')) {
$moderation = array('validate' => array(), 'delete' => array(), 'ignore' => array());
if(is_array($mod)) {
foreach($mod as $tid => $action) {
$moderation[$action][] = intval($tid);
}
}
$threadsmod = 0;
if($moderation['delete']) {
$deletetids = '0';
$recyclebintids = '0';
$query = $db->query("SELECT tid, fid FROM {$tablepre}threads WHERE tid IN ('".implode('\',\'', $moderation['delete'])."') $fidadd[and]$fidadd[fids]");
while($thread = $db->fetch_array($query)) {
if($recyclebins[$thread['fid']]) {
$recyclebintids .= ','.$thread['tid'];
} else {
$deletetids .= ','.$thread['tid'];
}
}
if($recyclebintids) {
$db->query("UPDATE {$tablepre}threads SET displayorder='-1', moderated='1' WHERE tid IN ($recyclebintids)");
updatemodworks('MOD', $db->affected_rows());
$db->query("UPDATE {$tablepre}posts SET invisible='-1' WHERE tid IN ($recyclebintids)");
updatemodlog($recyclebintids, 'DEL');
}
$query = $db->query("SELECT attachment FROM {$tablepre}attachments WHERE tid IN ($deletetids)");
while($attach = $db->fetch_array($query)) {
@unlink($attachdir.'/'.$attach['attachment']);
}
$db->query("DELETE FROM {$tablepre}threads WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}posts WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}polloptions WHERE tid IN ($deletetids)");
$db->query("DELETE FROM {$tablepre}polls WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}attachments WHERE tid IN ($deletetids)", 'UNBUFFERED');
}
if($moderation['validate']) {
$forums = array();
$validatetids = '\''.implode('\',\'', $moderation['validate']).'\'';
$tids = $supe_pushtids = $comma = $comma2 = '';
$authoridarray = $moderatedthread = array();
$query = $db->query("SELECT t.fid, t.tid, t.authorid, t.subject, t.author, t.dateline, t.supe_pushstatus, ff.postcredits, ff.supe_pushsetting FROM {$tablepre}threads t
LEFT JOIN {$tablepre}forumfields ff USING(fid)
WHERE t.tid IN ($validatetids) AND t.displayorder='-2' $fidadd[and]$fidadd[t]$fidadd[fids]");
while($thread = $db->fetch_array($query)) {
$supe_pushsetting = unserialize($thread['supe_pushsetting']);
if($supe_status && $thread['supe_pushstatus'] == 0 && $supe_allowpushthread && $supe_pushsetting['status'] == '1') {
$supe_pushtids .= $comma2.$thread['tid'];
$comma2 = ',';
}
$tids .= $comma.$thread['tid'];
$comma = ',';
if($thread['postcredits']) {
updatepostcredits('+', $thread['authorid'], unserialize($thread['postcredits']));
} else {
$authoridarray[] = $thread['authorid'];
}
$forums[] = $thread['fid'];
$validatedthreads[] = $thread;
}
if($supe_pushtids) {
$db->query("UPDATE {$tablepre}threads SET supe_pushstatus='1' WHERE tid IN ($supe_pushtids)");
}
if($tids) {
if($authoridarray) {
updatepostcredits('+', $authoridarray, $creditspolicy['post']);
}
$db->query("UPDATE {$tablepre}posts SET invisible='0' WHERE tid IN ($tids)");
$db->query("UPDATE {$tablepre}threads SET displayorder='0', moderated='1' WHERE tid IN ($tids)");
$threadsmod = $db->affected_rows();
foreach(array_unique($forums) as $fid) {
updateforumcount($fid);
}
updatemodworks('MOD', $threadsmod);
updatemodlog($tids, 'MOD');
}
}
}
if(!empty($validatedthreads)) {
?>
<form id="topicadmin" name="topicadmin" method="POST" action="topicadmin.php" target="_blank">
<input type="hidden" name="tid" value="">
<input type="hidden" name="fid" value="">
<input type="hidden" name="action" value="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="5"><?=$lang['moderate_validate_list']?></td></tr>
<tr class="category" align="center"><td>Tid</td><td><?=$lang['subject']?></td><td><?=$lang['author']?></td><td><?=$lang['dateline']?></td><td><?=$lang['front_moderation']?></td></tr>
<?
foreach($validatedthreads as $thread) {
echo '<tr><td width="8%" class="altbg1">'.$thread['tid'].'</td>'.
'<td width="45%" class="altbg2"><a href="viewthread.php?tid='.$thread['tid'].'" target="_blank">'.$thread['subject'].'</a></td>'.
'<td width="12%" class="altbg1"><a href="viewpro.php?uid='.$thread['authorid'].'" target="_blank">'.$thread['author'].'</a></td>'.
'<td width="20%" class="altbg2">'.gmdate("$dateformat $timeformat", $thread['dateline'] + 3600 * $timeoffset).'</td>'.
'<td width="15%" class="altbg1"><select name="action2" id="action2" onchange="if(this.options[this.selectedIndex].value != \'\') {$(\'topicadmin\').action.value= this.options[this.selectedIndex].value; $(\'topicadmin\').tid.value='.$thread['tid'].'; $(\'topicadmin\').fid.value='.$thread['fid'].'; $(\'topicadmin\').submit();}">
<option value="" selected>'.$lang['admin_modoptions'].'</option>
<option value="delete">'.$lang['admin_delthread'].'</option>
<option value="close">'.$lang['admin_close'].'</option>
<option value="move">'.$lang['admin_move'].'</option>
<option value="copy">'.$lang['admin_copy'].'</option>
<option value="highlight">'.$lang['admin_highlight'].'</option>
<option value="digest">'.$lang['admin_digest'].'</option>
<option value="stick">'.$lang['admin_stick'].'</option>
<option value="merge">'.$lang['admin_merge'].'</option>
<option value="bump">'.$lang['admin_bump'].'</option>
<option value="repair">'.$lang['admin_repair'].'</option>
</select></td></tr>';
}
echo '</table></form><br>';
}
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
$page = !ispage($page) ? 1 : $page;
$start_limit = ($page - 1) * 10;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}threads WHERE $fidadd[fids]$fidadd[and] displayorder='-2'");
$multipage = multi($db->result($query, 0), $tpp, $page, 'admincp.php?action=modthreads');
$threads = '';
$query = $db->query("SELECT f.name AS forumname, f.allowsmilies, f.allowhtml, f.allowbbcode, f.allowimgcode,
t.tid, t.fid, t.author, t.authorid, t.subject, t.dateline, t.attachment,
p.pid, p.message, p.useip, p.attachment, p.htmlon, p.smileyoff, p.bbcodeoff
FROM {$tablepre}threads t
LEFT JOIN {$tablepre}posts p ON p.tid=t.tid
LEFT JOIN {$tablepre}forums f ON f.fid=t.fid
WHERE $fidadd[t]$fidadd[fids]$fidadd[and] t.displayorder='-2'
ORDER BY t.dateline DESC LIMIT $start_limit, 20");
while($thread = $db->fetch_array($query)) {
if($thread['authorid'] && $thread['author']) {
$thread['author'] = "<a href=\"viewpro.php?uid=$thread[authorid]\" target=\"_blank\">$thread[author]</a>";
} elseif($thread['authorid'] && !$thread['author']) {
$thread['author'] = "<a href=\"viewpro.php?uid=$thread[authorid]\" target=\"_blank\">$lang[anonymous]</a>";
} else {
$thread['author'] = $lang['guest'];
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -