📄 threads.inc.php
字号:
$query = $db->query("SELECT attachment, thumb, remote FROM {$tablepre}attachments WHERE $tidsadd");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
$db->query("DELETE FROM {$tablepre}attachments WHERE $tidsadd");
$db->query("UPDATE {$tablepre}threads SET attachment='0' WHERE $tidsadd");
$db->query("UPDATE {$tablepre}posts SET attachment='0' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'stick') {
$db->query("UPDATE {$tablepre}threads SET displayorder='$stick_level' WHERE $tidsadd");
if($globalstick) {
updatecache('globalstick');
}
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'adddigest') {
$query = $db->query("SELECT tid, authorid, digest FROM {$tablepre}threads WHERE $tidsadd");
while($thread = $db->fetch_array($query)) {
updatecredits($thread['authorid'], $creditspolicy['digest'], $digest_level - $thread['digest'], 'digestposts=digestposts-1');
}
$db->query("UPDATE {$tablepre}threads SET digest='$digest_level' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'addstatus') {
$db->query("UPDATE {$tablepre}threads SET closed='$status' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'supe_pushsetting' && $supe['status']) {
$db->query("UPDATE {$tablepre}threads SET supe_pushstatus='$supe_pushstatus' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
}
$tids && deletethreadcaches($tids);
$cpmsg = $cpmsg ? "alert('$cpmsg');" : '';
?>
<script><?=$cpmsg?>parent.$('threadforum').searchsubmit.click();</script>
<?
}
if(submitcheck('searchsubmit')) {
$sql = '';
if($inforum != '' && $inforum != 'all') {
$sql .= " AND fid='$inforum'";
}
if($intype != '' && $intype != 'all') {
$sql .= " AND typeid='$intype'";
}
if($viewsless != '') {
$sql .= " AND views<'$viewsless'";
}
if($viewsmore != '') {
$sql .= " AND views>'$viewsmore'";
}
if($repliesless != '') {
$sql .= " AND replies<'$repliesless'";
}
if($repliesmore != '') {
$sql .= " AND replies>'$repliesmore'";
}
if($readpermmore != '') {
$sql .= " AND readperm>'$readpermmore'";
}
if($pricemore != '') {
$sql .= " AND price>'$pricemore'";
}
if($beforedays != '') {
$sql .= " AND dateline<'$timestamp'-'$beforedays'*86400";
}
if($noreplydays != '') {
$sql .= " AND lastpost<'$timestamp'-'$noreplydays'*86400";
}
if($starttime != '') {
$starttime = strtotime($starttime);
$sql .= " AND dateline>'$starttime'";
}
if($endtime) {
$endtime = strtotime($endtime);
$sql .= " AND dateline<='$endtime'";
}
if(trim($keywords)) {
$sqlkeywords = '';
$or = '';
$keywords = explode(',', str_replace(' ', '', $keywords));
for($i = 0; $i < count($keywords); $i++) {
$sqlkeywords .= " $or subject LIKE '%".$keywords[$i]."%'";
$or = 'OR';
}
$sql .= " AND ($sqlkeywords)";
}
if(trim($users)) {
$sql .= " AND ".(empty($cins) ? 'BINARY' : '')." author IN ('".str_replace(',', '\',\'', str_replace(' ', '', $users))."')";
}
if($sticky == 1) {
$sql .= " AND displayorder>'0'";
} elseif($sticky == 2) {
$sql .= " AND displayorder='0'";
}
if($digest == 1) {
$sql .= " AND digest>'0'";
} elseif($digest == 2) {
$sql .= " AND digest='0'";
}
if($blog == 1) {
$sql .= " AND blog>'0'";
} elseif($blog == 2) {
$sql .= " AND blog='0'";
}
if($attach == 1) {
$sql .= " AND attachment>'0'";
} elseif($attach == 2) {
$sql .= " AND attachment='0'";
}
if($attach == 1) {
$sql .= " AND attachment>'0'";
} elseif($attach == 2) {
$sql .= " AND attachment='0'";
}
if($rate == 1) {
$sql .= " AND rate>'0'";
} elseif($rate == 2) {
$sql .= " AND rate='0'";
}
if($highlight == 1) {
$sql .= " AND highlight>'0'";
} elseif($highlight == 2) {
$sql .= " AND highlight='0'";
}
if(!empty($special)) {
$specials = $comma = '';
foreach($special as $val) {
$specials .= $comma.'\''.$val.'\'';
$comma = ',';
}
if($specialthread == 1) {
$sql .= " AND special IN ($specials)";
} elseif($specialthread == 2) {
$sql .= " AND special NOT IN ($specials)";
}
}
$fids = array();
$tids = $threadcount = '0';
if($sql) {
if($detail) {
$pagetmp = $page;
do{
$query = $db->query("SELECT fid, tid, readperm, price, subject, authorid, author, views, replies, lastpost FROM {$tablepre}threads WHERE displayorder>='0' $sql LIMIT ".(($pagetmp - 1) * $tpp).",$tpp");
$pagetmp--;
} while(!$db->num_rows($query) && $pagetmp);
$threads = '';
while($thread = $db->fetch_array($query)) {
$thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);
$threads .= "<tr><td align=\"center\" class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"tidarray[]\" value=\"$thread[tid]\" checked>\n".
"<td class=\"altbg2\"><a href=\"viewthread.php?tid=$thread[tid]\" target=\"_blank\">$thread[subject]</a>".($thread['readperm'] ? " - [$lang[threads_readperm] $thread[readperm]]" : '').($thread['price'] ? " - [$lang[threads_price] $thread[price]]" : '')."</td>\n".
"<td align=\"center\" class=\"altbg1\"><a href=\"forumdisplay.php?fid=$thread[fid]\" target=\"_blank\">{$_DCACHE[forums][$thread[fid]][name]}</a></td>\n".
"<td align=\"center\" class=\"altbg2\"><a href=\"viewpro.php?uid=$thread[authorid]\" target=\"_blank\">$thread[author]</a></td>\n".
"<td align=\"center\" class=\"altbg1\">$thread[replies]</td>\n".
"<td align=\"center\" class=\"altbg2\">$thread[views]</td>\n".
"<td align=\"center\" class=\"altbg1\">$thread[lastpost]</td></tr>\n";
}
$threadcount = $db->result($db->query("SELECT count(*) FROM {$tablepre}threads WHERE displayorder>='0' $sql"), 0);
$multi = multi($threadcount, $tpp, $page, "admincp.php?action=threads");
$multi = preg_replace("/href=\"admincp.php\?action=threads&page=(\d+)\"/", "href=\"javascript:page(\\1)\"", $multi);
$multi = str_replace("window.location='admincp.php?action=threads&page='+this.value", "page(this.value)", $multi);
} else {
$query = $db->query("SELECT fid, tid FROM {$tablepre}threads WHERE displayorder>='0' $sql");
while($thread = $db->fetch_array($query)) {
$fids[] = $thread['fid'];
$tids .= ','.$thread['tid'];
}
$threadcount = $db->result($db->query("SELECT count(*) FROM {$tablepre}threads WHERE displayorder>='0' $sql"), 0);
$multi = '';
}
}
$fids = implode(',', array_unique($fids));
?>
<br><form method="post" action="admincp.php?action=threads" target="threadframe">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['threads_result']?> <?=$threadcount?></td>
</tr>
<?
if(!$threadcount) {
echo '<tr><td class="altbg2" colspan="2">'.$lang['threads_thread_nonexistence'].'</td></tr>';
} else {
$typeselect = '';
$query = $db->query("SELECT * FROM {$tablepre}threadtypes ORDER BY displayorder");
while($type = $db->fetch_array($query)) {
$typeselect .= '<option value="'.$type['typeid'].'"> > '.$type['name'].($type['description'] ? ' ('.$type['description'].')' : '').'</option>';
}
if(!$detail) {
echo '<input type="hidden" name="tids" value="'.$tids.'">';
}
echo '<input type="hidden" name="fids" value="'.$fids.'">';
?>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="moveforum" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_move_forum']?></td>
<td class="altbg2"><select name="toforum"><?=forumselect()?></select></td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="movetype" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_move_type']?></td>
<td class="altbg2"><select name="totype"><option value="0"> > <?=$lang['threads_search_type_none']?></option><?=$typeselect?></select></td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="delete" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_delete']?></td>
<td class="altbg2"><input class="checkbox" type="checkbox" name="donotupdatemember" value="1" checked> <?=$lang['threads_delete_no_update_member']?></td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="stick" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_stick']?></td>
<td class="altbg2">
<input class="radio" type="radio" name="stick_level" value="0" checked> <?=$lang['threads_remove']?>
<input class="radio" type="radio" name="stick_level" value="1"> <?=$lang['forums_stick_one']?>
<input class="radio" type="radio" name="stick_level" value="2"> <?=$lang['forums_stick_two']?>
<input class="radio" type="radio" name="stick_level" value="3"> <?=$lang['forums_stick_three']?></td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="adddigest" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_add_digest']?></td>
<td class="altbg2">
<input class="radio" type="radio" name="digest_level" value="0" checked> <?=$lang['threads_remove']?>
<input class="radio" type="radio" name="digest_level" value="1"> <?=$lang['forums_digest_one']?>
<input class="radio" type="radio" name="digest_level" value="2"> <?=$lang['forums_digest_two']?>
<input class="radio" type="radio" name="digest_level" value="3"> <?=$lang['forums_digest_three']?></td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="addstatus" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_open_close']?></td>
<td class="altbg2">
<input class="radio" type="radio" name="status" value="0" checked> <?=$lang['open']?>
<input class="radio" type="radio" name="status" value="1"> <?=$lang['closed']?>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="deleteattach" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_delete_attach']?></td>
<td class="altbg2"> </td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="supe_pushsetting" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_push_supesite']?></td>
<td class="altbg2">
<input class="radio" type="radio" name="supe_pushstatus" value="2" checked> <?=$lang['threads_push']?>
<input class="radio" type="radio" name="supe_pushstatus" value="-2"> <?=$lang['threads_remove_push']?>
</tr>
<?
if($detail) {
?>
</table><br><br><?=$multi?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><input name="chkall" type="checkbox" class="checkbox" checked onclick="checkall(this.form, 'tidarray', 'chkall')"></td><td><?=$lang['subject']?></td><td><?=$lang['forum']?></td><td><?=$lang['author']?></td><td nowrap><?=$lang['threads_replies']?></td><td nowrap><?=$lang['threads_views']?></td><td><?=$lang['threads_lastpost']?></td></tr>
<?=$threads?>
<?
}
}
echo '</table>'.$multi.'<br><center><input class="button" type="submit" name="modsubmit" value="'.$lang['submit'].'" disabled></center></form><iframe name="threadframe" style="display:none"></iframe>';
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -