diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2012-12-15 10:33:03 -0600 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-12-15 10:33:03 -0600 |
commit | 95bd4d73eb41d677470b0bf77c521ae2a9bb731e (patch) | |
tree | 13ec1309a09b7047d343dba443872b57909091d5 | |
parent | 418988495ba4342e07a38eeffcdf309021b8e727 (diff) | |
download | forums-95bd4d73eb41d677470b0bf77c521ae2a9bb731e.tar forums-95bd4d73eb41d677470b0bf77c521ae2a9bb731e.tar.gz forums-95bd4d73eb41d677470b0bf77c521ae2a9bb731e.tar.bz2 forums-95bd4d73eb41d677470b0bf77c521ae2a9bb731e.tar.xz forums-95bd4d73eb41d677470b0bf77c521ae2a9bb731e.zip |
[ticket/11103] Mark topic/post subscription notification read when approved
PHPBB3-11103
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 14 | ||||
-rw-r--r-- | phpBB/includes/notification/manager.php | 10 |
2 files changed, 13 insertions, 11 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 2a2146db71..24afa1f210 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -615,7 +615,13 @@ function approve_post($post_id_list, $id, $mode) { $phpbb_notifications->delete_notifications('topic_in_queue', $post_data['topic_id']); - $phpbb_notifications->add_notifications('topic', $post_data); + $phpbb_notifications->add_notifications(array( + 'quote', + 'topic', + ), $post_data); + + $phpbb_notifications->mark_notifications_read('quote', $post_data['post_id'], $user->data['user_id']); + $phpbb_notifications->mark_notifications_read('topic', $post_data['topic_id'], $user->data['user_id']); if ($notify_poster) { @@ -631,6 +637,12 @@ function approve_post($post_id_list, $id, $mode) 'bookmark', 'post', ), $post_data); + + $phpbb_notifications->mark_notifications_read(array( + 'quote', + 'bookmark', + 'post', + ),$post_data['post_id'], $user->data['user_id']); if ($notify_poster) { diff --git a/phpBB/includes/notification/manager.php b/phpBB/includes/notification/manager.php index 653446ab73..6bf97a3e71 100644 --- a/phpBB/includes/notification/manager.php +++ b/phpBB/includes/notification/manager.php @@ -226,16 +226,6 @@ class phpbb_notification_manager */ public function mark_notifications_read($item_type, $item_id, $user_id, $time = false) { - if (is_array($item_type)) - { - foreach ($item_type as $type) - { - $this->mark_notifications_read($type, $item_id, $user_id, $time); - } - - return; - } - $time = ($time !== false) ? $time : time(); $sql = 'UPDATE ' . $this->notifications_table . " |