aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--phpBB/includes/acp/acp_board.php1
-rw-r--r--phpBB/includes/functions.php21
-rw-r--r--phpBB/install/database_update.php5
-rw-r--r--phpBB/install/schemas/schema_data.sql1
-rw-r--r--phpBB/language/en/acp/common.php2
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html2
6 files changed, 24 insertions, 8 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 322e1c55d8..aed27d7122 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -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),
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'],
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index b3a1213bb1..9cb0785c89 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2746,6 +2746,11 @@ function change_database_data(&$no_updates, $version)
$config->set('site_home_text', '');
}
+ if (!isset($config['load_notifications']))
+ {
+ $config->set('load_notifications', 1);
+ }
+
break;
}
}
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index dbb5fd7481..0d47f4995e 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -175,6 +175,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jquery_cdn',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jumpbox', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_moderators', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_notifications', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_guests', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', '5');
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 5eb10d50b3..0096a84878 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -250,6 +250,8 @@ $lang = array_merge($lang, array(
'IP' => 'User IP',
'IP_HOSTNAME' => 'IP addresses or hostnames',
+ 'LOAD_NOTIFICATIONS' => 'Display Notifications',
+ 'LOAD_NOTIFICATIONS_EXPLAIN' => 'Display the notifications list on every page (typically in the header).',
'LOGGED_IN_AS' => 'You are logged in as:',
'LOGIN_ADMIN' => 'To administer the board you must be an authenticated user.',
'LOGIN_ADMIN_CONFIRM' => 'To administer the board you must re-authenticate yourself.',
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index 690caea36b..2f789f3f2c 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -130,6 +130,7 @@
<!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
<ul class="linklist leftside">
+ <!-- IF S_NOTIFICATIONS_DISPLAY -->
<li>
[ <a href="#" id="notification_list_button" title="{NOTIFICATIONS_COUNT}">{NOTIFICATIONS_COUNT}</a> ] &bull;
<div id="notification_list">
@@ -149,6 +150,7 @@
</ul>
</div>
</li>
+ <!-- ENDIF -->
<li class="icon-ucp">
<a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="e">{L_PROFILE}</a>
<!-- IF S_DISPLAY_SEARCH --> &bull;