列印

6.0 主題列表 forumdisplay 顯示評分標記

6.0 主題列表 forumdisplay 顯示評分標記

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 編輯 ]
附件: 您所在的用戶組無法下載或查看附件
Hack 安裝錯誤, 80% 來自粗心, 請專心安裝
Linux0911 打造您的個性論壇

本人現在忙於研究所, 沒多的時間管論壇, 有問題別發 pm 給我, 謝謝~
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

請問Linux0911大,修改後大姆指圖示也跟著標題變動,
1.能不能改回預設是固定在作者的左方,
2.另外如果想將評分標記圖示取消而用評分數取代它的位置該如何修改呢
謝謝!
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

回覆 1# Linux0911 的帖子

謝謝分享
馬上來試試看了
如有問題再回來報告

[ 本帖最後由 天空星星 於 2008-11-6 11:31 PM 編輯 ]
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

可以做到分類嗎?例如: [威望+100] [金錢+100]
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

回覆 4# 帛琉保羅 的帖子

是可以分開類別的啊  

Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

安裝成功,已經可以分類了!
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

引用:
原帖由 帛琉保羅 於 2008-7-19 01:48 PM 發表
安裝成功,已經可以分類了!
恭喜你囉!
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

我想將評分顯示能靠右
該如何更改??
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

回覆 8# cd369 的帖子

自己做一個 div, 然後寫 text-align: right 試試看
Hack 安裝錯誤, 80% 來自粗心, 請專心安裝
Linux0911 打造您的個性論壇

本人現在忙於研究所, 沒多的時間管論壇, 有問題別發 pm 給我, 謝謝~
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)