mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Fix broken PM (Private messages) (#1085)
This commit is contained in:
parent
618a93e056
commit
5f8d7faf83
2 changed files with 4 additions and 4 deletions
|
@ -91,7 +91,7 @@ if ($logged_in && empty($gen_simple_header) && !defined('IN_ADMIN')) {
|
|||
GROUP BY privmsgs_to_userid
|
||||
");
|
||||
|
||||
$real_unread_pm_count = (int)$row['pm_count'] ?? 0;
|
||||
$real_unread_pm_count = (int)($row['pm_count'] ?? 0);
|
||||
|
||||
if ($userdata['user_unread_privmsg'] != $real_unread_pm_count) {
|
||||
$userdata['user_unread_privmsg'] = $real_unread_pm_count;
|
||||
|
|
|
@ -668,11 +668,11 @@ if ($mode == 'read') {
|
|||
do {
|
||||
switch ($row['privmsgs_type']) {
|
||||
case PRIVMSGS_NEW_MAIL:
|
||||
$update_users['new'][$row['privmsgs_to_userid']]++;
|
||||
($update_users['new'][$row['privmsgs_to_userid']] ??= 0) + 1;
|
||||
break;
|
||||
|
||||
case PRIVMSGS_UNREAD_MAIL:
|
||||
$update_users['unread'][$row['privmsgs_to_userid']]++;
|
||||
($update_users['unread'][$row['privmsgs_to_userid']] ??= 0) + 1;
|
||||
break;
|
||||
}
|
||||
} while ($row = DB()->sql_fetchrow($result));
|
||||
|
@ -778,7 +778,7 @@ if ($mode == 'read') {
|
|||
|
||||
if ($submit) {
|
||||
if (!empty($_POST['username'])) {
|
||||
$to_userdata = get_userdata($_POST['username']);
|
||||
$to_userdata = get_userdata($_POST['username'], true);
|
||||
|
||||
if (!$to_userdata || $to_userdata['user_id'] == GUEST_UID) {
|
||||
$error = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue