from:
http://www.discuz.net/thread-724811-1-1.html
6.0 主題列表顯示評分標記..
從 5.5 的改過來的..
在:
forumdisplay.
php
查找
複製內容到剪貼簿
代碼:
$querysticky = '';
$query = $db->query("SELECT t.* FROM {$tablepre}threads t
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.* FROM {$tablepre}threads t
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.* FROM {$tablepre}threads t
WHERE t.fid='$fid' $filteradd AND $displayorderadd
ORDER BY displayorder DESC, $orderby $ascdesc
LIMIT ".($tpp - $stickycount + $start_limit));
} else {
$query = '';替換成
複製內容到剪貼簿
代碼:
// 主題列表 forumdisplay 顯示評分標記 - START
/*
$querysticky = '';
$query = $db->query("SELECT t.* FROM {$tablepre}threads t
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.* FROM {$tablepre}threads t
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.* FROM {$tablepre}threads t
WHERE t.fid='$fid' $filteradd AND $displayorderadd
ORDER BY displayorder DESC, $orderby $ascdesc
LIMIT ".($tpp - $stickycount + $start_limit));
} else {
$query = '';
*/
$querysticky = '';
$query = $db->query("SELECT $dotadd1 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 t.displayorder DESC, t.$orderby $ascdesc
LIMIT ".($filterbool ? $start_limit : $start_limit - $stickycount).", $tpp");
} else {
$querysticky = $db->query("SELECT $dotadd1 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 $dotadd1 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));
} else {
$query = '';
// 主題列表 forumdisplay 顯示評分標記 - END繼續查找
複製內容到剪貼簿
代碼:
$threadlist[] = $thread;在下面一行加
複製內容到剪貼簿
代碼:
// 主題列表 forumdisplay 顯示評分標記 - START
$tpids[] = $thread['pid'];
// 主題列表 forumdisplay 顯示評分標記 - END查找:
複製內容到剪貼簿
代碼:
$separatepos = $separatepos ? $separatepos + 1 : ($announcement ? 1 : 0);上面加上:
複製內容到剪貼簿
代碼:
// 主題列表 forumdisplay 顯示評分標記 - START
if (is_array($tpids)){
$pids = implode(",",$tpids);
$detail_query = $db->query("SELECT * FROM {$tablepre}ratelog WHERE pid IN ($pids)");
while ($row = $db->fetch_array($detail_query)){
$detail_rate[$row['pid']][$row['extcredits']] += $row['score'];
}
}
// 主題列表 forumdisplay 顯示評分標記 - END修改 forumdisplay.htm
查找:
複製內容到剪貼簿
代碼:
<!--{if $thread['rate'] > 0}-->
<img src="{IMGDIR}/agree.gif" alt="" />
<!--{elseif $thread['rate'] < 0}-->
<img src="{IMGDIR}/disagree.gif" alt="" />
<!--{/if}-->刪除
在查找:
複製內容到剪貼簿
代碼:
<span id="thread_$thread[tid]"><a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]>$thread[subject]</a></span>下面加上:
複製內容到剪貼簿
代碼:
<!--// 主題列表 forumdisplay 顯示評分標記 - START-->
<!--{if $thread['rate']}-->
<!--{loop $detail_rate[$thread[pid]] $k $v}-->
[ <span style="color: red"> $extcredits[$k][title] <!--{eval echo sprintf("%+d",$v);}--> </span> ]
<!--{/loop}-->
<!--{/if}-->
<!--{if $thread['rate'] > 0}-->
<img src="{IMGDIR}/agree.gif" alt="" />
<!--{elseif $thread['rate'] < 0}-->
<img src="{IMGDIR}/disagree.gif" alt="" />
<!--{/if}-->
<!--// 主題列表 forumdisplay 顯示評分標記 - END-->完成.
[ 本帖最後由 sakuramoon 於 2007-8-30 16:13 編輯 ]