版區主題顯示評分【完美整齊版】for D6.0.0 or D6.1.0
根據自己的需要去做了修改;有相同需要的人,enjoy it ...
演示請看附圖。
第一步;
編輯【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 = '';替換為
複製內容到剪貼簿
代碼:
/*
$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 = '';再查找
複製內容到剪貼簿
代碼:
$threadlist[] = $thread;下一行加上
複製內容到剪貼簿
代碼:
$tpids[] = $thread['pid'];再查找
複製內容到剪貼簿
代碼:
$separatepos = $separatepos ? $separatepos + 1 : ($announcement ? 1 : 0);在上面加上
複製內容到剪貼簿
代碼:
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.htm】
查找
複製內容到剪貼簿
代碼:
<!--{if $thread['rate'] > 0}-->
<img src="{IMGDIR}/agree.gif" alt="" />
<!--{elseif $thread['rate'] < 0}-->
<img src="{IMGDIR}/disagree.gif" alt="" />
<!--{/if}-->刪除
再查找
複製內容到剪貼簿
代碼:
<!--{if $thread['digest'] > 0}-->
<img src="{IMGDIR}/digest_$thread[digest].gif" alt="{lang thread_digest} $thread[digest]" />
<!--{/if}-->下一行加入
複製內容到剪貼簿
代碼:
<!--{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}-->
<!--{elseif $thread['rate'] < 0}-->
<!--{/if}-->儲存、上傳
有使用成功的人,也請別忘了留個言。
演示;
[
本帖最後由 70297 於 2008-11-25 06:34 PM 編輯 ]