From 7454d5c2d526f237bf24825b80edf6c9f1750fc6 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 15 Sep 2012 14:33:15 -0500 Subject: [ticket/11103] Topic/Post in queue notification Also, bug fixes and cleanup PHPBB3-11103 --- phpBB/includes/notifications/service.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/notifications/service.php') diff --git a/phpBB/includes/notifications/service.php b/phpBB/includes/notifications/service.php index 6e7b160e0f..777fa9a42f 100644 --- a/phpBB/includes/notifications/service.php +++ b/phpBB/includes/notifications/service.php @@ -262,7 +262,7 @@ class phpbb_notifications_service { foreach ($item_type as $type) { - $this->add_notifications($type, $data); + $this->add_notifications_for_users($type, $data, $notify_users); } return; @@ -353,7 +353,7 @@ class phpbb_notifications_service { foreach ($item_type as $type) { - $this->add_notifications($type, $data); + $this->update_notifications($type, $data); } return; @@ -386,12 +386,22 @@ class phpbb_notifications_service /** * Delete a notification * - * @param string $item_type Type identifier + * @param string|array $item_type Type identifier or array of item types (only acceptable if the $item_id is identical for the specified types) * @param int|array $item_id Identifier within the type (or array of ids) * @param array $data Data specific for this type that will be updated */ public function delete_notifications($item_type, $item_id) { + if (is_array($item_type)) + { + foreach ($item_type as $type) + { + $this->delete_notifications($type, $item_id); + } + + return; + } + $this->get_item_type_class_name($item_type); $sql = 'DELETE FROM ' . NOTIFICATIONS_TABLE . " @@ -400,6 +410,7 @@ class phpbb_notifications_service $this->db->sql_query($sql); } +/* public function add_subscription($item_type, $item_id, $method = '') { $this->get_item_type_class_name($item_type); @@ -413,6 +424,7 @@ class phpbb_notifications_service )); $this->db->sql_query($sql); } +*/ /** * Load user helper -- cgit v1.2.1