Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14361

Unread PM Count Allowed to Go Negative

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 3.1.6
    • Private Messages (PM)
    • None
    • MySQL 10.0.22-MariaDB

      I don't know how it occurred, but I currently have a negative unread / new Private Message count. It isn't really a big deal, but it won't go away until either I reset the count manually or possibly get a new PM or two.

      It seems like this could be a simple cosmetic fix in includes/functions.php

      Find:

      'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0,
      'S_USER_NEW_PRIVMSG' => $user->data['user_new_privmsg'],
      'S_USER_UNREAD_PRIVMSG' => $user->data['user_unread_privmsg'],
      

      Change to:

      'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg']) && $user->data['user_unread_privmsg'] > 0) ? $user->data['user_unread_privmsg'] : 0,
      'S_USER_NEW_PRIVMSG' => ($user->data['user_new_privmsg'] > 0) ? $user->data['user_new_privmsg'] : 0,
      'S_USER_UNREAD_PRIVMSG' => ($user->data['user_unread_privmsg'] > 0) ? $user->data['user_unread_privmsg'] : 0,
      

            Marc Marc
            Ectoman AJ Quick [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: