原帖由 Darth 于 2006-9-25 01:07 发表
这个有问题,只有在第一楼添加评分的才会显示。
其它楼层的评分都不计算在内或显示出来。。
请搂主修改。。
不合实际
原帖由 Ryukyo 于 2006-9-29 12:05 发表
能否现实具体哪个积分加多少分?
例如:有两个积分:金钱和威望
怎么样在列表内显示金钱+10、威望+10
加一查询
一、修改 forumdisplay.php
查找:
- $querysticky = '';
- $query = $db->query("SELECT $dotadd1 t.* FROM {$tablepre}threads t $dotadd2
- 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.* FROM {$tablepre}threads t $dotadd2
- 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.* FROM {$tablepre}threads t $dotadd2
- 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 ".($filter == 'digest' || $filter == 'type' ? $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 = '';
复制代码
查找:
换行,添加:
- $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['rate']}-->
- <!--{loop $detail_rate[$thread[pid]] $k $v}-->
- [<font color="red"> $extcredits[$k][title] <!--{eval echo sprintf("%+d",$v);}--> </font>]
- <!--{/loop}-->
- <!--{/if}-->
- <!--{if $thread['rate'] > 0}-->
- <img src="{IMGDIR}/agree.gif" alt="" />
- <!--{elseif $thread['rate'] < 0}-->
- <img src="{IMGDIR}/disagree.gif" alt="" />
- <!--{/if}-->
复制代码
版权归原发布者,只是应别人要求,修改一下
[ 本帖最后由 Nameless 于 2006-10-30 15:34 编辑 ] |