aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Friedman <maf675@gmail.com>2013-10-16 10:26:33 -0700
committerMatt Friedman <maf675@gmail.com>2013-10-16 10:26:33 -0700
commitab8ac5e284e6d260ed0731677a30270b034fc1a4 (patch)
treec7ac73ed05666816ea4651a2306b5bc09db934dc
parentbd58c31ee0a361ba34afa28a0012c24bd77c84b7 (diff)
downloadforums-ab8ac5e284e6d260ed0731677a30270b034fc1a4.tar
forums-ab8ac5e284e6d260ed0731677a30270b034fc1a4.tar.gz
forums-ab8ac5e284e6d260ed0731677a30270b034fc1a4.tar.bz2
forums-ab8ac5e284e6d260ed0731677a30270b034fc1a4.tar.xz
forums-ab8ac5e284e6d260ed0731677a30270b034fc1a4.zip
[ticket/11921] Directly inject unread messages count into the template
PHPBB3-11921
-rw-r--r--phpBB/includes/functions.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index d1614386b6..ad5e3c05ce 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -5225,10 +5225,9 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
$l_online_time = $user->lang('VIEW_ONLINE_TIMES', (int) $config['load_online_time']);
}
- $privmsgs_count = 0;
$s_privmsg_new = false;
- // Obtain number of unread private messages if user is logged in
+ // Check for new private messages if user is logged in
if (!empty($user->data['is_registered']))
{
if ($user->data['user_new_privmsg'])
@@ -5251,11 +5250,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
{
$s_privmsg_new = false;
}
-
- if ($user->data['user_unread_privmsg'] && $user->data['user_unread_privmsg'] != $user->data['user_new_privmsg'])
- {
- $privmsgs_count = (int) $user->data['user_unread_privmsg'];
- }
}
$forum_id = request_var('f', 0);
@@ -5345,7 +5339,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'TOTAL_USERS_ONLINE' => $l_online_users,
'LOGGED_IN_USER_LIST' => $online_userlist,
'RECORD_USERS' => $l_online_record,
- 'PRIVATE_MESSAGE_COUNT' => $privmsgs_count,
+ 'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0,
'HIDDEN_FIELDS_FOR_JUMPBOX' => $hidden_fields_for_jumpbox,
'UNREAD_NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '',