1 頁 (共 1 頁)

[修正] 用戶文章百分比

發表於 : 2006-06-13 , 0:20
yehrussell
[修正] 用戶文章百分比

http://phpbb-tw.net/phpbb/viewtopic.php?t=36037

代碼: 選擇全部

############################################################## 
## MOD Title: Percentage Post Fix 
## MOD Author: kp3011 < asv83.lr4087@gmail.com > ( Jisp Cheung ) http://269m.no-ip.org/ 
## MOD Description: It fixes the error of [X% of total] in viewprofile.php, which calculates 
##          the percentage of posts of a member of the PRESENT number of posts, but 
##          not the total number of posts of all members. Before this fix is done, 
##          problems like [101% of total] may occur, because of forum prune. 
## MOD Version: 1.0.0 
## 
## Installation Level: Easy 
## Installation Time: 1 Minute 
## Files To Edit: includes/functions 
## Included Files: n/a 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
##   Nil 
############################################################## 
## MOD History: 
## 
##   2005-06-19 - Version 1.0.0 
##      - Initial Release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/functions.php 
# 
#-----[ FIND ]------------------------------------------ 
# 
      case 'postcount': 
      case 'topiccount': 
         $sql = "SELECT SUM(forum_topics) AS topic_total, SUM(forum_posts) AS post_total 
            FROM " . FORUMS_TABLE; 
         break; 
# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
      case 'postcount': 
         $sql = "SELECT SUM(" . USERS_TABLE . ".user_posts) AS post_total FROM " . USERS_TABLE; 
         break; 

      case 'topiccount': 
         $sql = "SELECT SUM(" . FORUMS_TABLE . ".forum_topics) AS topic_total FROM " . FORUMS_TABLE; 
         break; 
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM



註: 正在通過官方的認證
例如你進入到某用戶的"個人資料",裡面 [討論區文章總數的 x%] 可能是錯誤的! 因為這個百分比是以用戶文章總數除以論壇文章總數, 而不是所有用戶文章總數
當自動刪文使用時,這個錯誤隨時會令到您的文章佔論壇文章超過百分之 100 !

Re: [修正] 用戶文章百分比

發表於 : 2006-06-13 , 0:24
yehrussell
剛修正