mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 05:13:54 -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
|
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) {
|
if ($userdata['user_unread_privmsg'] != $real_unread_pm_count) {
|
||||||
$userdata['user_unread_privmsg'] = $real_unread_pm_count;
|
$userdata['user_unread_privmsg'] = $real_unread_pm_count;
|
||||||
|
|
|
@ -668,11 +668,11 @@ if ($mode == 'read') {
|
||||||
do {
|
do {
|
||||||
switch ($row['privmsgs_type']) {
|
switch ($row['privmsgs_type']) {
|
||||||
case PRIVMSGS_NEW_MAIL:
|
case PRIVMSGS_NEW_MAIL:
|
||||||
$update_users['new'][$row['privmsgs_to_userid']]++;
|
($update_users['new'][$row['privmsgs_to_userid']] ??= 0) + 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PRIVMSGS_UNREAD_MAIL:
|
case PRIVMSGS_UNREAD_MAIL:
|
||||||
$update_users['unread'][$row['privmsgs_to_userid']]++;
|
($update_users['unread'][$row['privmsgs_to_userid']] ??= 0) + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while ($row = DB()->sql_fetchrow($result));
|
} while ($row = DB()->sql_fetchrow($result));
|
||||||
|
@ -778,7 +778,7 @@ if ($mode == 'read') {
|
||||||
|
|
||||||
if ($submit) {
|
if ($submit) {
|
||||||
if (!empty($_POST['username'])) {
|
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) {
|
if (!$to_userdata || $to_userdata['user_id'] == GUEST_UID) {
|
||||||
$error = true;
|
$error = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue