已修正原先的笔误
此帖不是原创
是更改5.5的插件而来
找了一下,没自己喜欢的,干脆修改一下发布这个无错的主题列表显示详细评分
经过自己论坛Discuz! 6.0.0测试无误
插件名称:主题列表显示详细评分For Dz 6.0
适用版本:Discuz 6.0
修改档案: forumdisplay.php
修改模版: forumdisplay.htm
一、修改 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.*, p.rate, p.pid FROM {$tablepre}threads t
- 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 t.*, p.rate,p.pid FROM {$tablepre}threads t
- 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 t.*, p.rate,p.pid FROM {$tablepre}threads t
- 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 = '';
复制代码 查找:下面一行新增加:- $tpids[] = $thread['pid'];
复制代码 查找:- $separatepos = $separatepos ? $separatepos + 1 : ($announcement ? 1 : 0);
复制代码 上面新增:- if (is_array($tpids) && count($tpids)>0){
- $tpids = array_filter($tpids,create_function('$_','return is_numeric($_);'));
- @$pids = implode(",",$tpids);
- if ($pids) {
- @$detail_query = $db->query("SELECT * FROM {$tablepre}ratelog WHERE pid IN ($pids)");
- if ($detail_query){
- while ($row = $db->fetch_array($detail_query)){
- $detail_rate[$row['pid']][$row['extcredits']] += $row['score'];
- }
- } else {
- $detail_rate = array();
- }
- }
- }
复制代码 二、修改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['rate']}-->
- <!--{loop $detail_rate[$thread[pid]] $k $v}-->
- [<font color=#00FF00> $extcredits[$k][title]
- <!--{eval echo sprintf("%+d",$v);}--> </font>]
- <!--{/loop}-->
- <!--{/if}-->
复制代码 演示请见附件:
喜欢的话,有空到我的论坛坐坐吧~
[ 本帖最后由 bistpon1 于 2007-10-17 21:31 编辑 ] |