清心国度's Archiver

yeonglih 发表于 2007-8-30 16:48

6.0主题列表显示评分标记..

从5.5的改过来的..

在:
forumdisplay.php 查找复制内容到剪贴板代码:
$querysticky = '';
.
.



$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}-->

删除

在查找:
<span id="thread_$thread[tid]"><a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]>$thread[subject]</a></span>


<a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]>$thread[subject]</a>

后面加上:

<!--{if $thread['rate'] > 0}-->[<b><font color=red>+$thread['rate']</font></b>]<!--{elseif $thread['rate'] < 0}-->[<b><font color=red>$thread['rate']</font></b>]<!--{/if}-->

完成.
;[/code]


附件
304.JPG (79.97 KB)
2007-8-30 16:07

·慢慢的· 发表于 2007-10-22 10:10

谢谢分享。。

yeonglih 发表于 2007-11-13 22:46

不用客气

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.