1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 17:56:52 +02:00

Merge branch '3.3.x'

This commit is contained in:
Marc Alexander
2023-10-01 14:00:51 +02:00
5 changed files with 188 additions and 24 deletions

View File

@@ -521,11 +521,15 @@ class content_visibility
$postcounts[$num_posts][] = $poster_id;
}
$postcount_change = 0;
// Update users postcounts
foreach ($postcounts as $num_posts => $poster_ids)
{
if (in_array($visibility, array(ITEM_REAPPROVE, ITEM_DELETED)))
{
$postcount_change -= $num_posts;
$sql = 'UPDATE ' . $this->users_table . '
SET user_posts = 0
WHERE ' . $this->db->sql_in_set('user_id', $poster_ids) . '
@@ -540,6 +544,8 @@ class content_visibility
}
else
{
$postcount_change += $num_posts;
$sql = 'UPDATE ' . $this->users_table . '
SET user_posts = user_posts + ' . $num_posts . '
WHERE ' . $this->db->sql_in_set('user_id', $poster_ids);
@@ -547,6 +553,11 @@ class content_visibility
}
}
if ($postcount_change != 0)
{
$this->config->increment('num_posts', $postcount_change, false);
}
$update_topic_postcount = true;
// Sync the first/last topic information if needed