aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/phpbb/notification/manager.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php
index db92170dd8..b1b096d41d 100644
--- a/phpBB/phpbb/notification/manager.php
+++ b/phpBB/phpbb/notification/manager.php
@@ -186,6 +186,7 @@ class manager
if (!$options['count_total'] || $total_count)
{
$rowset = array();
+ $selected_unread_count = 0;
// Get the main notifications
$sql = 'SELECT n.*, nt.notification_type_name
@@ -200,11 +201,12 @@ class manager
while ($row = $this->db->sql_fetchrow($result))
{
$rowset[$row['notification_id']] = $row;
+ $selected_unread_count += (int) !$row['notification_read'];
}
$this->db->sql_freeresult($result);
// Get all unread notifications
- if ($unread_count && $options['all_unread'] && !empty($rowset))
+ if ($selected_unread_count < $unread_count && $options['all_unread'] && !empty($rowset))
{
$sql = 'SELECT n.*, nt.notification_type_name
FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt