mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-07 01:06:48 +02:00
This probably broke things :|
#10697 #11421 #11555 #11421 git-svn-id: file:///svn/phpbb/trunk@7666 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user