aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-10-28 00:45:06 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-10-28 00:45:06 +0000
commit98f17b0f75d8561c0be180d5e9c2f9b3c166e2a6 (patch)
tree44641456607736ae901108316068c5b7dbb04851 /phpBB
parent34921891bb5a73425ffaf2b67bf97125a93f796b (diff)
downloadforums-98f17b0f75d8561c0be180d5e9c2f9b3c166e2a6.tar
forums-98f17b0f75d8561c0be180d5e9c2f9b3c166e2a6.tar.gz
forums-98f17b0f75d8561c0be180d5e9c2f9b3c166e2a6.tar.bz2
forums-98f17b0f75d8561c0be180d5e9c2f9b3c166e2a6.tar.xz
forums-98f17b0f75d8561c0be180d5e9c2f9b3c166e2a6.zip
Removed function, replaced missing functionality
git-svn-id: file:///svn/phpbb/trunk@2979 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/usercp_viewprofile.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/includes/usercp_viewprofile.php b/phpBB/includes/usercp_viewprofile.php
index aee53196f3..4acb24d03d 100644
--- a/phpBB/includes/usercp_viewprofile.php
+++ b/phpBB/includes/usercp_viewprofile.php
@@ -61,9 +61,15 @@ $memberdays = max(1, round( ( time() - $regdate ) / 86400 ));
$posts_per_day = $profiledata['user_posts'] / $memberdays;
// Get the users percentage of total posts
-if ( $profiledata['user_posts'] != 0 )
+if ( $profiledata['user_posts'] )
{
- $total_posts = get_db_stat('postcount');
+ $sql = "SELECT SUM(forum_posts) AS total
+ FROM " . FORUMS_TABLE;
+ $result = $db->sql_query($sql);
+
+ $total_posts = ($row = $db->sql_fetchrow($result)) ? $row['total'] : 0;
+ $db->sql_freeresult($result);
+
$percentage = ( $total_posts ) ? min(100, ($profiledata['user_posts'] / $total_posts) * 100) : 0;
}
else