廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 24586 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
香吉士 手機
個人文章 個人相簿 個人日記 個人地圖
特殊貢獻獎 創作大師獎 創作大師獎-2 創作大師獎-3
知名人士
級別: 知名人士 該用戶目前不上站
推文 x234 鮮花 x555
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[7.0][分享] 帖子列表頁顯示評分詳細+威望+金錢  (通用)
【插件資訊】

插件名稱:帖子列表頁顯示評分詳細+威望+金錢
適用版本:7.0
語言編碼:通用
插件作者:不明
版權所屬:不明
原帖連結:http://www.alan888.com/Discuz/viewthread.php?ti...page=1&extra=page%3D2
支持網站:http://allen.ncc.to/index.php

【插件說明】

示範: 主題xxxxxxxxxxxxx [金錢+100][威望+20]





forumdisplay.php


複製程式
if(($start_limit && $start_limit > $stickycount) || !$stickycount || $filterbool) { 
$querysticky = ''; 
$query = $sdb->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 = $sdb->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 = $sdb->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 = ''; 
} 

}


替換成
複製程式
if(($start_limit && $start_limit > $stickycount) || !$stickycount || $filterbool) { 
$querysticky = ''; 
$query = $sdb->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 = $sdb->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 = $sdb->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 = ''; 
} 

}


繼續查找 :
複製程式
$threadlist[] = $thread;

下面加一行:
複製程式
$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 = $sdb->query("SELECT * FROM {$tablepre}ratelog WHERE pid IN ($pids)"); 
if ($detail_query){ 
while ($row = $sdb->fetch_array($detail_query)){ 
$detail_rate[$row['pid']][$row['extcredits']] += $row['score']; 
} 

} else { 
$detail_rate = array(); 
} 

} 


}


templates/default/forumdisplay.htm
查找:
複製程式
 <!--{if $thread['rate'] > 0}--> 

<img src="{IM無法使用之字串R}/agree.gif" alt="{lang rate_credit_add}" title="{lang rate_credit_add}" /> 

<!--{elseif $thread['rate'] < 0}--> 

<img src="{IM無法使用之字串R}/disagree.gif" alt="{lang rate_credit_reduce}" title="{lang rate_credit_reduce}" /> 

<!--{/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}-->

更新緩存。

這樣,評分的詳細會顯示在列表右邊,如果你不想顯示詳細的評分,只想顯示「[+多少分]」這樣的,則將這段代碼刪除即可!
再查找:
複製程式
<li class="wide"><a href="viewthread.php?tid=$tid" $thread['subjectstyles'] target="_blank">$thread[subject]</a><cite>-<a href="space.php?uid=$thread[authorid]" target="_blank">$thread[author]</a></cite></li>

替換成:
複製程式
<li class="wide"><a href="viewthread.php?tid=$tid" $thread['subjectstyles'] target="_blank">$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}--> 

<cite>-<a href="space.php?uid=$thread[authorid]" target="_blank">$thread[author]</a></cite></li>



獻花 x0 回到頂端 [樓 主] From:歐洲 | Posted:2009-09-27 08:41 |
jackychanyc
個人頭像
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x0 鮮花 x0
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

多謝~~~~


獻花 x0 回到頂端 [1 樓] From:香港有線寬頻 | Posted:2009-11-01 02:15 |
asdlkj123852
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x0 鮮花 x6
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

看起來很適合用積分論壇謝謝大大分享


我 找不到人生 的目標!!!!
我 找不到我奮鬥的目標!!!!
我 到底在想甚麼我根本不知道???
獻花 x0 回到頂端 [2 樓] From:台灣大哥大股份有限公司 | Posted:2012-04-26 12:37 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.034663 second(s),query:16 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言