人氣指數 for phpBB2.0.0

主題已鎖定
頭像
櫻井綾乃
.※.稜鏡之森の守護使者.※.
.※.稜鏡之森の守護使者.※.
文章: 1331
註冊時間: 週二 2006-03-07 09:08
個人狀態: 論壇爆走中...
性別: 醜醜的大美女
來自: 雲上天國
表達感謝: 68 次
擁有感謝: 837 次
星座:
聯繫:

人氣指數 for phpBB2.0.0

文章 櫻井綾乃 »

參考自竹貓...
http://phpbb-tw.net/phpbb/viewtopic.php?t=5387

--------------------------------------------------------------------------
第一步

開啟viewtopic.php,找到

代碼: 選擇全部

$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 = ""; 
   }  
接著找到

代碼: 選擇全部

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

代碼: 選擇全部

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


綾乃 os.使用utf8碼者需將這個檔案再將以轉碼.不然會顯示亂碼

第二步

開啟/templates/template_dirXX/viewtopic_body.tpl,找到
綾乃 os.正確是找到/templates/你使用的風格檔/viewtopic_body.tpl

代碼: 選擇全部

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

代碼: 選擇全部

{postrow.RR_HACK}<br /> 
完成
如果.....
也許.....
這些都是事後的想法
如果會想著當初怎麼做也許會有什麼結果
不如在當初就做出正確的決定.....
有些事不去嚐試是不會真的體會他的奧妙的~
主題已鎖定

回到「PHPBB2-外掛列表」