diff options
| author | Nathan Guse <nathaniel.guse@gmail.com> | 2012-10-29 18:09:20 -0500 |
|---|---|---|
| committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-10-29 18:09:20 -0500 |
| commit | e549b7663da47d7518b93074e513c7e1d034bf52 (patch) | |
| tree | de8b250ab18d550e597c7d093a0633a6f2004bed /phpBB/includes/ucp/ucp_notifications.php | |
| parent | eddb56f8426161923d8870ca5f8f899c342075db (diff) | |
| download | forums-e549b7663da47d7518b93074e513c7e1d034bf52.tar forums-e549b7663da47d7518b93074e513c7e1d034bf52.tar.gz forums-e549b7663da47d7518b93074e513c7e1d034bf52.tar.bz2 forums-e549b7663da47d7518b93074e513c7e1d034bf52.tar.xz forums-e549b7663da47d7518b93074e513c7e1d034bf52.zip | |
[ticket/11103] Set basic notifications to be enabled by default
Now, if there is no row for the user in the user_notifications table,
the user will receive basic notifications. If the user wishes to not
receive notifications, a row must be added with notify = 0.
For other methods besides the basic (e.g. email, jabber) a row must
still be added with notify = 1 for them to receive notifications
PHPBB3-11103
Diffstat (limited to 'phpBB/includes/ucp/ucp_notifications.php')
| -rw-r--r-- | phpBB/includes/ucp/ucp_notifications.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index 8749c88ba1..8810ac9ce6 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -32,7 +32,7 @@ class ucp_notifications switch ($mode) { case 'notification_options': - $subscriptions = $phpbb_notifications->get_subscriptions(false, true); + $subscriptions = $phpbb_notifications->get_global_subscriptions(false); // Add/remove subscriptions if ($request->is_set_post('submit')) @@ -48,15 +48,6 @@ class ucp_notifications { foreach($subscription_types as $type => $data) { - if ($request->is_set_post($type . '_notification') && !isset($subscriptions[$type])) - { - $phpbb_notifications->add_subscription($type); - } - else if (!$request->is_set_post($type . '_notification') && isset($subscriptions[$type])) - { - $phpbb_notifications->delete_subscription($type); - } - foreach($notification_methods as $method) { if ($request->is_set_post($type . '_' . $method) && (!isset($subscriptions[$type]) || !in_array($method, $subscriptions[$type]))) @@ -68,6 +59,15 @@ class ucp_notifications $phpbb_notifications->delete_subscription($type, 0, $method); } } + + if ($request->is_set_post($type . '_notification') && !isset($subscriptions[$type])) + { + $phpbb_notifications->add_subscription($type); + } + else if (!$request->is_set_post($type . '_notification') && isset($subscriptions[$type])) + { + $phpbb_notifications->delete_subscription($type); + } } } @@ -78,7 +78,7 @@ class ucp_notifications $this->output_notification_methods('notification_methods', $phpbb_notifications, $template, $user); - $this->output_notification_types('notification_types', $phpbb_notifications, $template, $user); + $this->output_notification_types($subscriptions, 'notification_types', $phpbb_notifications, $template, $user); $this->tpl_name = 'ucp_notifications'; $this->page_title = 'UCP_NOTIFICATION_OPTIONS'; @@ -165,10 +165,9 @@ class ucp_notifications * @param phpbb_template $template * @param phpbb_user $user */ - public function output_notification_types($block = 'notification_types', phpbb_notification_manager $phpbb_notifications, phpbb_template $template, phpbb_user $user) + public function output_notification_types($subscriptions, $block = 'notification_types', phpbb_notification_manager $phpbb_notifications, phpbb_template $template, phpbb_user $user) { $notification_methods = $phpbb_notifications->get_subscription_methods(); - $subscriptions = $phpbb_notifications->get_subscriptions(false, true); foreach($phpbb_notifications->get_subscription_types() as $group => $subscription_types) { |
