diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-08-01 15:29:47 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-08-01 15:29:47 +0000 |
commit | ced8624b8e86bc6aac143163e538f87376319079 (patch) | |
tree | 7479c2699efb9bd9c6785e0f5ecd4f792d8ca59e /phpBB/includes/acp/acp_main.php | |
parent | 541dbf8af07874e9507249a7e62cc3c32475d475 (diff) | |
download | forums-ced8624b8e86bc6aac143163e538f87376319079.tar forums-ced8624b8e86bc6aac143163e538f87376319079.tar.gz forums-ced8624b8e86bc6aac143163e538f87376319079.tar.bz2 forums-ced8624b8e86bc6aac143163e538f87376319079.tar.xz forums-ced8624b8e86bc6aac143163e538f87376319079.zip |
- fixing some bugs
- shortening some db columns to meet the requirements
- correctly increase/decrease user post counts
- fix the topic title length bug(s)
git-svn-id: file:///svn/phpbb/trunk@6224 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_main.php')
-rw-r--r-- | phpBB/includes/acp/acp_main.php | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 5588f0dae9..4aedb63df6 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -209,37 +209,17 @@ class acp_main trigger_error($user->lang['NO_ADMIN']); } - $post_count_ary = $auth->acl_getf('f_postcount'); - $forum_read_ary = $auth->acl_getf('f_read'); - - $forum_ary = array(); - foreach ($post_count_ary as $forum_id => $allowed) - { - if ($allowed['f_postcount'] && $forum_read_ary[$forum_id]['f_read']) - { - $forum_ary[] = $forum_id; - } - } + $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id + FROM ' . POSTS_TABLE . ' + WHERE post_postcount = 1 + GROUP BY poster_id'; + $result = $db->sql_query($sql); - if (!sizeof($forum_ary)) - { - $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0'); - } - else + while ($row = $db->sql_fetchrow($result)) { - $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id - FROM ' . POSTS_TABLE . ' - WHERE poster_id <> ' . ANONYMOUS . ' - AND forum_id IN (' . implode(', ', $forum_ary) . ') - GROUP BY poster_id'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['poster_id']}"); - } - $db->sql_freeresult($result); + $db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['poster_id']}"); } + $db->sql_freeresult($result); add_log('admin', 'LOG_RESYNC_POSTCOUNTS'); |