diff --git a/phpBB/includes/notifications/type/pm.php b/phpBB/includes/notifications/type/pm.php index df7b42564c..75c79e35e6 100644 --- a/phpBB/includes/notifications/type/pm.php +++ b/phpBB/includes/notifications/type/pm.php @@ -85,25 +85,21 @@ class phpbb_notifications_type_pm extends phpbb_notifications_type_base $notify_users = array(); - foreach (array_keys($pm['recipients']) as $user_id) + $sql = 'SELECT * + FROM ' . USER_NOTIFICATIONS_TABLE . " + WHERE item_type = '" . self::get_item_type() . "' + AND " . $db->sql_in_set('user_id', array_keys($pm['recipients'])); + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { - $recipient = $service->get_user($user_id); - - if ($recipient['user_notify_pm']) + if (!isset($rowset[$row['user_id']])) { - $notify_users[$recipient['user_id']] = array(); - - if ($recipient['user_notify_type'] == NOTIFY_EMAIL || $recipient['user_notify_type'] == NOTIFY_BOTH) - { - $notify_users[$recipient['user_id']][] = 'email'; - } - - if ($recipient['user_notify_type'] == NOTIFY_IM || $recipient['user_notify_type'] == NOTIFY_BOTH) - { - $notify_users[$recipient['user_id']][] = 'jabber'; - } + $notify_users[$row['user_id']] = array(); } + + $notify_users[$row['user_id']][] = $row['method']; } + $db->sql_freeresult($result); return $notify_users; } diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 2228bc7931..709d2a90b0 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -37,7 +37,6 @@ class ucp_prefs case 'personal': add_form_key('ucp_prefs_personal'); $data = array( - 'notifymethod' => request_var('notifymethod', $user->data['user_notify_type']), 'dateformat' => request_var('dateformat', $user->data['user_dateformat'], true), 'lang' => basename(request_var('lang', $user->data['user_lang'])), 'style' => request_var('style', (int) $user->data['user_style']), @@ -46,17 +45,9 @@ class ucp_prefs 'viewemail' => request_var('viewemail', (bool) $user->data['user_allow_viewemail']), 'massemail' => request_var('massemail', (bool) $user->data['user_allow_massemail']), 'hideonline' => request_var('hideonline', (bool) !$user->data['user_allow_viewonline']), - 'notifypm' => request_var('notifypm', (bool) $user->data['user_notify_pm']), - 'popuppm' => request_var('popuppm', (bool) $user->optionget('popuppm')), 'allowpm' => request_var('allowpm', (bool) $user->data['user_allow_pm']), ); - if ($data['notifymethod'] == NOTIFY_IM && (!$config['jab_enable'] || !$user->data['user_jabber'] || !@extension_loaded('xml'))) - { - // Jabber isnt enabled, or no jabber field filled in. Update the users table to be sure its correct. - $data['notifymethod'] = NOTIFY_BOTH; - } - if ($submit) { if ($config['override_user_style']) @@ -81,15 +72,11 @@ class ucp_prefs if (!sizeof($error)) { - $user->optionset('popuppm', $data['popuppm']); - $sql_ary = array( 'user_allow_pm' => $data['allowpm'], 'user_allow_viewemail' => $data['viewemail'], 'user_allow_massemail' => $data['massemail'], 'user_allow_viewonline' => ($auth->acl_get('u_hideonline')) ? !$data['hideonline'] : $user->data['user_allow_viewonline'], - 'user_notify_type' => $data['notifymethod'], - 'user_notify_pm' => $data['notifypm'], 'user_options' => $user->data['user_options'], 'user_dateformat' => $data['dateformat'], @@ -135,15 +122,10 @@ class ucp_prefs $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', - 'S_NOTIFY_EMAIL' => ($data['notifymethod'] == NOTIFY_EMAIL) ? true : false, - 'S_NOTIFY_IM' => ($data['notifymethod'] == NOTIFY_IM) ? true : false, - 'S_NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false, 'S_VIEW_EMAIL' => $data['viewemail'], 'S_MASS_EMAIL' => $data['massemail'], 'S_ALLOW_PM' => $data['allowpm'], 'S_HIDE_ONLINE' => $data['hideonline'], - 'S_NOTIFY_PM' => $data['notifypm'], - 'S_POPUP_PM' => $data['popuppm'], 'DATE_FORMAT' => $data['dateformat'], 'A_DATE_FORMAT' => addslashes($data['dateformat']), diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html index 29c01e03b9..f03cb2af38 100644 --- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html +++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html @@ -38,31 +38,7 @@ - - -
-
-
- - - -
-
-
-
-
- - -
-
-
-
-
- - -
-