主题列表显示评分完美版+永诚版主已阅图片美化版for DZ!6.0/6.1
-------------------------------------------------------------------------------------
插件名称:主题列表显示评分完美版for DZ!6.0/6.1(一楼)
永诚版主已阅图片美化版for DZ!6.0/6.1(二楼)
插件原作者:未知
插件修订者:fucenyuan
版 权 所有:深圳永诚娱乐社区(www.ycdgxt.cn)
其 他 说明:通过DZ6.0/6.1正式版测试
演 示 地址:(DZ6.1)http://www.ycsmvod.cn/bbs5/forum-2-1.html
(DZ6.0)http://www.ycdgxt.cn
---------------------------------------------------------------------------------------
主题列表显示评分标记for DZ!6.0/6.1
附:DZ6.1的演示地址:
http://www.ycsmvod.cn/bbs5/forum-2-1.html
打开: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}-->
复制代码 这样,评分的详细会显示在列表右边,如果你不想显示详细的评分,只想显示“[+多少分]”这样的,则将这段代码删除即可!
再查找:- <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>
复制代码 后面(即</span>前面)插入:- <!--{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}-->
复制代码 完成.
记得更新缓存··!
[ 本帖最后由 fucenyuan 于 2008-5-13 02:21 编辑 ] |