1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

[ticket/11103] Display all unread notifications by default

Add unread count to the page title

PHPBB3-11103
This commit is contained in:
Nathan Guse
2012-09-14 18:30:12 -05:00
parent 959c81d00e
commit 7589a3093d
5 changed files with 56 additions and 20 deletions

View File

@@ -4994,6 +4994,14 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
$timezone_name = $user->lang['timezones'][$timezone_name];
}
// Output the notifications
$phpbb_notifications = $phpbb_container->get('notifications');
$notifications = $phpbb_notifications->load_notifications();
foreach ($notifications['notifications'] as $notification)
{
$template->assign_block_vars('notifications', $notification->prepare_for_display());
}
// The following assigns all _common_ variables that may be used at any point in a template.
$template->assign_vars(array(
'SITENAME' => $config['sitename'],
@@ -5008,6 +5016,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'RECORD_USERS' => $l_online_record,
'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
'NUM_UNREAD_NOTIFICATIONS' => $notifications['unread_count'],
'S_USER_NEW_PRIVMSG' => $user->data['user_new_privmsg'],
'S_USER_UNREAD_PRIVMSG' => $user->data['user_unread_privmsg'],
@@ -5119,13 +5128,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'A_COOKIE_SETTINGS' => addslashes('; path=' . $config['cookie_path'] . ((!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']) . ((!$config['cookie_secure']) ? '' : '; secure')),
));
// Output the notifications
$phpbb_notifications = $phpbb_container->get('notifications');
foreach ($phpbb_notifications->load_notifications() as $notification)
{
$template->assign_block_vars('notifications', $notification->prepare_for_display());
}
// application/xhtml+xml not used because of IE
header('Content-type: text/html; charset=UTF-8');