aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_admin.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-09-09 17:43:10 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2012-09-09 17:43:10 -0500
commit12e46e48c80191d0e4ee134257375ea40c13da60 (patch)
tree717a9b51741e8349249ad6f275ec422834810479 /phpBB/includes/functions_admin.php
parent2c31e82b60aebd650d288079b6dcd420e414e266 (diff)
downloadforums-12e46e48c80191d0e4ee134257375ea40c13da60.tar
forums-12e46e48c80191d0e4ee134257375ea40c13da60.tar.gz
forums-12e46e48c80191d0e4ee134257375ea40c13da60.tar.bz2
forums-12e46e48c80191d0e4ee134257375ea40c13da60.tar.xz
forums-12e46e48c80191d0e4ee134257375ea40c13da60.zip
[ticket/11103] Remove notifications to posts/topics when they are deleted
PHPBB3-11103
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r--phpBB/includes/functions_admin.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 5e2ee8c8f6..6845ae14e3 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -619,6 +619,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true, $call_delete_posts = true)
{
global $db, $config;
+ global $phpbb_container;
$approved_topics = 0;
$forum_ids = $topic_ids = array();
@@ -715,6 +716,10 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
set_config_count('num_topics', $approved_topics * (-1), true);
}
+ // Delete notifications
+ $notifications = $phpbb_container->get('notifications');
+ $notifications->delete_notifications('topic', $topic_ids);
+
return $return;
}
@@ -724,6 +729,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true, $call_delete_topics = true)
{
global $db, $config, $phpbb_root_path, $phpEx, $auth, $user;
+ global $phpbb_container;
if ($where_type === 'range')
{
@@ -892,6 +898,10 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
delete_topics('topic_id', $remove_topics, $auto_sync, $post_count_sync, false);
}
+ // Delete notifications
+ $notifications = $phpbb_container->get('notifications');
+ $notifications->delete_notifications('post', $post_ids);
+
return sizeof($post_ids);
}