aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-10-05 13:43:03 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2012-10-05 13:43:03 -0500
commit0bab8ff777bcb82361b75441c085ee2e510db5cc (patch)
tree51406c04033cefb2e86ba0b7e5149096bcf665af /phpBB/includes/functions.php
parent2d69707a88fdb618730243cbe65ebc055cf68bae (diff)
downloadforums-0bab8ff777bcb82361b75441c085ee2e510db5cc.tar
forums-0bab8ff777bcb82361b75441c085ee2e510db5cc.tar.gz
forums-0bab8ff777bcb82361b75441c085ee2e510db5cc.tar.bz2
forums-0bab8ff777bcb82361b75441c085ee2e510db5cc.tar.xz
forums-0bab8ff777bcb82361b75441c085ee2e510db5cc.zip
[ticket/11103] ACP option to enable/disable notifications output in header
PHPBB3-11103
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 9513c6919f..795bfb77bf 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4993,13 +4993,17 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
}
// Output the notifications
- $notifications = $phpbb_notifications->load_notifications(array(
- 'all_unread' => true,
- 'limit' => 5,
- ));
- foreach ($notifications['notifications'] as $notification)
+ if ($config['load_notifications'])
{
- $template->assign_block_vars('notifications', $notification->prepare_for_display());
+ $notifications = $phpbb_notifications->load_notifications(array(
+ 'all_unread' => true,
+ 'limit' => 5,
+ ));
+
+ 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.
@@ -5016,8 +5020,9 @@ 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,
- 'UNREAD_NOTIFICATIONS_COUNT' => $notifications['unread_count'],
- 'NOTIFICATIONS_COUNT' => $user->lang('NOTIFICATIONS_COUNT', $notifications['unread_count']),
+ 'UNREAD_NOTIFICATIONS_COUNT' => ($config['load_notifications']) ? $notifications['unread_count'] : '',
+ 'NOTIFICATIONS_COUNT' => ($config['load_notifications']) ? $user->lang('NOTIFICATIONS_COUNT', $notifications['unread_count']) : '',
+ 'S_NOTIFICATIONS_DISPLAY' => $config['load_notifications'],
'S_USER_NEW_PRIVMSG' => $user->data['user_new_privmsg'],
'S_USER_UNREAD_PRIVMSG' => $user->data['user_unread_privmsg'],