mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-04 07:47:34 +02:00
[ticket/11103] ACP option to enable/disable notifications output in header
PHPBB3-11103
This commit is contained in:
@@ -314,6 +314,7 @@ class acp_board
|
||||
'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int:0', 'type' => 'text:4:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
|
||||
|
||||
'legend2' => 'GENERAL_OPTIONS',
|
||||
'load_notifications' => array('lang' => 'LOAD_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'load_db_track' => array('lang' => 'YES_POST_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'load_anon_lastread' => array('lang' => 'YES_ANON_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
@@ -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'],
|
||||
|
Reference in New Issue
Block a user