mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/10605] Turn $undelivered_user into a real array of counters.
PHPBB3-10605
This commit is contained in:
parent
e8830f605f
commit
2203bc204e
1 changed files with 12 additions and 4 deletions
|
@ -1113,7 +1113,15 @@ function phpbb_delete_user_pms($user_id)
|
|||
{
|
||||
// Undelivered messages
|
||||
$undelivered_msg[] = $row['msg_id'];
|
||||
$undelivered_user[$row['user_id']][] = true;
|
||||
|
||||
if (isset($undelivered_user[$row['user_id']]))
|
||||
{
|
||||
++$undelivered_user[$row['user_id']];
|
||||
}
|
||||
else
|
||||
{
|
||||
$undelivered_user[$row['user_id']] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$delete_rows[$row['msg_id']] = true;
|
||||
|
@ -1135,11 +1143,11 @@ function phpbb_delete_user_pms($user_id)
|
|||
}
|
||||
|
||||
unset($undelivered_user[$user_id]);
|
||||
foreach ($undelivered_user as $_user_id => $ary)
|
||||
foreach ($undelivered_user as $_user_id => $count)
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ',
|
||||
user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . '
|
||||
SET user_new_privmsg = user_new_privmsg - ' . $count . ',
|
||||
user_unread_privmsg = user_unread_privmsg - ' . $count . '
|
||||
WHERE user_id = ' . $_user_id;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue