1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +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:
Henry Sudhof
2007-05-23 15:05:46 +00:00
parent f34547cad7
commit 7cffec58d0
6 changed files with 159 additions and 5 deletions

View File

@@ -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