列印

版區主題顯示評分【完美整齊版】for D6.0.0 or D6.1.0

版區主題顯示評分【完美整齊版】for D6.0.0 or D6.1.0

版區主題顯示評分【完美整齊版】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 編輯 ]
附件: 您所在的用戶組無法下載或查看附件
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

..................失敗+1...
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP



論壇聲明
  • 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
    如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
    請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!
最佳瀏覽解析度:不低於 1024 (最佳 1280 以上).(支援 IE 7, Mozilla Firefox, Safari, Chrome)
The Best Surfing Resolution: No Lower than 1024 (Best: above 1280).(IE 7, Mozilla Firefox, Safari, Chrome Supported)