aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_privmsgs.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-03-27 17:32:55 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-03-27 17:32:55 +0200
commitb9324577aca6f7f7632b609e975e510e25d8ec86 (patch)
treee2909c1413687b2acb4fb7c2398d96d8154616ac /phpBB/includes/functions_privmsgs.php
parent0397b462174887bda3fea4bcebf9a26f6b591a3e (diff)
downloadforums-b9324577aca6f7f7632b609e975e510e25d8ec86.tar
forums-b9324577aca6f7f7632b609e975e510e25d8ec86.tar.gz
forums-b9324577aca6f7f7632b609e975e510e25d8ec86.tar.bz2
forums-b9324577aca6f7f7632b609e975e510e25d8ec86.tar.xz
forums-b9324577aca6f7f7632b609e975e510e25d8ec86.zip
[ticket/10605] Reset userÂīs pm count to 0 when deleting his PMs
PHPBB3-10605
Diffstat (limited to 'phpBB/includes/functions_privmsgs.php')
-rw-r--r--phpBB/includes/functions_privmsgs.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index dd81e8f92d..14a6d83b2a 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1169,7 +1169,17 @@ function phpbb_delete_user_pms($user_id)
$db->sql_query($sql);
}
- unset($undelivered_user[$user_id]);
+ // Reset the userīs pm count to 0
+ if (isset($undelivered_user[$user_id]))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_new_privmsg = 0,
+ user_unread_privmsg = 0
+ WHERE user_id = ' . $user_id;
+ $db->sql_query($sql);
+ unset($undelivered_user[$user_id]);
+ }
+
foreach ($undelivered_user as $_user_id => $count)
{
$sql = 'UPDATE ' . USERS_TABLE . '