[修正] 用戶文章百分比

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

版主: 版主管理群

主題已鎖定
kp3011
竹貓忠實會員
竹貓忠實會員
文章: 384
註冊時間: 2004-05-15 21:16
來自: HKG

[修正] 用戶文章百分比

文章 kp3011 »

代碼: 選擇全部

############################################################## 
## 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%] 可能是錯誤的! 因為這個百分比是以用戶文章總數除以論壇文章總數, 而不是所有用戶文章總數\r
當自動刪文使用時,這個錯誤隨時會令到您的文章佔論壇文章超過百分之 100 !
●架設主機作業系統:CentOS 4.7
●您的 phpBB2 版本:phpBB 3.0.4
●您的 domain(網域名稱):www.hkbf.org | forum.hkbrda.org
主題已鎖定

回到「非官方認證外掛」