装了“主题列表显示评分标<详细积分>”,如何改这段代码:
$querysticky = '';
$query = $db->query("SELECT t.*, p.rate, p.pid FROM {$tablepre}threads t
LEFT JOIN {$tablepre}posts p USING(tid, dateline)
WHERE t.fid='$fid' $filteradd AND $displayorderadd
ORDER BY t.displayorder DESC, t.$orderby $ascdesc
LIMIT ".($filterbool ? $start_limit : $start_limit - $stickycount).", $tpp");
} else {
$querysticky = $db->query("SELECT t.*, p.rate, p.pid FROM {$tablepre}threads t $dotadd2
LEFT JOIN {$tablepre}posts p USING(tid, dateline)
WHERE t.tid IN ($stickytids) AND t.displayorder IN (2, 3)
ORDER BY displayorder DESC, $orderby $ascdesc
LIMIT $start_limit, ".($stickycount - $start_limit < $tpp ? $stickycount - $start_limit : $tpp));
if($tpp - $stickycount + $start_limit > 0) {
$query = $db->query("SELECT t.*, p.rate,p.pid FROM {$tablepre}threads t $dotadd2
LEFT JOIN {$tablepre}posts p USING(tid, dateline)
WHERE t.fid='$fid' $filteradd AND $displayorderadd
ORDER BY displayorder DESC, $orderby $ascdesc
LIMIT ".($tpp - $stickycount + $start_limit)); |