[教學]人氣指數 for phpBB2.0.0

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
頭像
Denny-Chang
星球公民
星球公民
文章: 45
註冊時間: 2002-04-13 20:41
來自: 台灣西木
聯繫:

[教學]人氣指數 for phpBB2.0.0

文章 Denny-Chang »

第一步

開啟viewtopic.php,找到\r

代碼: 選擇全部

$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
在下面加上

代碼: 選擇全部

   // 
   // RPG Ranking Hack by OOHOO 
   // 
   $user_id = $postrow[$i]['user_id']; 

   if($user_id != ANONYMOUS ) 
   { 
         $sql = "SELECT COUNT(topic_id) AS count_topics, " . 
                "SUM(topic_replies) AS sum_topic_replies, " . 
                "SUM(topic_views) AS sum_topic_views " . 
                "FROM " . TOPICS_TABLE . " " . 
                "WHERE topic_poster = " . $user_id; 

         $result = $db->sql_query($sql); 
         $rr_row = $db->sql_fetchrow($result); 

         // 發表的主題總數 
         $count_topics = $rr_row['count_topics']; 

         // 所有主題的回應總數 
         $sum_topic_replies = $rr_row['sum_topic_replies']; 

         // 主題人氣(觀看數) 
         $sum_topic_views = $rr_row['sum_topic_views']; 

         $profiledata = get_userdata($postrow[$i]['user_id']); 

         // 發文總數 
         $sum_posts = $profiledata['user_posts']; 

         // 回應文章總數 = 發文總數 - 發表的主題總數 
         $count_replies = $sum_posts - $count_topics; 

         // 魅力值 = (發表的主題總數*100 + 所有主題的回應總數*50 + 回應文章數*75 + 主題人氣(觀看數)*2) / (50 + 發文總數) 
         $rr_hack = ($count_topics * 100 + $sum_topic_replies * 50 + $count_replies * 75 + $sum_topic_views * 2) / (50 + $sum_posts); 

         // 取小數點後一位 
         $rr_hack = '人氣指數: <b><font color="#FF6633">' . sprintf("%01.2f", $rr_hack) . '</font></b>'; 
   } 
   else 
   { 
      $rr_hack = ""; 
   } 
接著找到\r

代碼: 選擇全部

'DELETE' => $delpost,
在下面加上

代碼: 選擇全部

'RR_HACK' => $rr_hack, // RPG Ranking Hack by OOHOO
第二步

開啟/templates/template_dirXX/viewtopic_body.tpl,找到\r

代碼: 選擇全部

{postrow.POSTER_JOINED}<br /> 
{postrow.POSTER_POSTS}<br /> 
{postrow.POSTER_FROM}</span><br />
在適當位置加上

代碼: 選擇全部

{postrow.RR_HACK}<br />
完成
我是 "Denny Chang" ,也稱 "小白豬" ,請多多指教!! ^^
主題已鎖定

回到「非官方認證外掛」