diff options
| author | Henry Sudhof <kellanved@phpbb.com> | 2007-05-23 15:05:46 +0000 |
|---|---|---|
| committer | Henry Sudhof <kellanved@phpbb.com> | 2007-05-23 15:05:46 +0000 |
| commit | 7cffec58d0db3cbed6f6e55785d3accd89efe8aa (patch) | |
| tree | 55bca06e1c8e13b7f57c5fa370bbfd1ca134df8a /phpBB/includes/functions_convert.php | |
| parent | f34547cad7cab847c8ac6aa327573e7cf0b2005d (diff) | |
| download | forums-7cffec58d0db3cbed6f6e55785d3accd89efe8aa.tar forums-7cffec58d0db3cbed6f6e55785d3accd89efe8aa.tar.gz forums-7cffec58d0db3cbed6f6e55785d3accd89efe8aa.tar.bz2 forums-7cffec58d0db3cbed6f6e55785d3accd89efe8aa.tar.xz forums-7cffec58d0db3cbed6f6e55785d3accd89efe8aa.zip | |
This probably broke things :|
#10697
#11421
#11555
#11421
git-svn-id: file:///svn/phpbb/trunk@7666 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_convert.php')
| -rw-r--r-- | phpBB/includes/functions_convert.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 98c1452c23..5da10236c2 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1707,6 +1707,27 @@ function add_default_groups() } } + +/** +* Sync post count. We might need to do this in batches. +*/ +function sync_post_count($offset, $limit) +{ + global $db; + $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id + FROM ' . POSTS_TABLE . ' + WHERE post_postcount = 1 + GROUP BY poster_id + ORDER BY poster_id'; + $result = $db->sql_query_limit($sql, $limit, $offset); + + 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); +} + /** * Add the search bots into the database * This code should be used in execute_last if the source database did not have bots |
