aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_admin.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-03-23 17:59:26 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-03-23 17:59:26 +0000
commit2e244a1eebc109da7a8c6ab4395a1d7e0923dd30 (patch)
tree1ec7ba838f1e23e42e4f884e6ca640d51f4122c0 /phpBB/includes/functions_admin.php
parent41a532e6082c7219f886b63a4d2c8cd25afbcf22 (diff)
downloadforums-2e244a1eebc109da7a8c6ab4395a1d7e0923dd30.tar
forums-2e244a1eebc109da7a8c6ab4395a1d7e0923dd30.tar.gz
forums-2e244a1eebc109da7a8c6ab4395a1d7e0923dd30.tar.bz2
forums-2e244a1eebc109da7a8c6ab4395a1d7e0923dd30.tar.xz
forums-2e244a1eebc109da7a8c6ab4395a1d7e0923dd30.zip
#5181
git-svn-id: file:///svn/phpbb/trunk@7221 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r--phpBB/includes/functions_admin.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index bd62366989..e9319dac33 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -495,7 +495,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
/**
* Remove topic(s)
*/
-function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true)
+function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true, $call_delete_posts = true)
{
global $db, $config;
@@ -518,8 +518,9 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
$where_clause = $db->sql_in_set($where_type, $where_ids);
}
+ // Making sure that delete_posts does not call delete_topics again...
$return = array(
- 'posts' => delete_posts($where_type, $where_ids, false, true, $post_count_sync)
+ 'posts' => ($call_delete_posts) ? delete_posts($where_type, $where_ids, false, true, $post_count_sync, false) : 0,
);
$sql = 'SELECT topic_id, forum_id, topic_approved
@@ -581,7 +582,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
/**
* Remove post(s)
*/
-function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true)
+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;
@@ -726,9 +727,9 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
}
// We actually remove topics now to not be inconsistent (the delete_topics function calls this function too)
- if (sizeof($remove_topics))
+ if (sizeof($remove_topics) && $call_delete_topics)
{
- delete_topics('topic_id', $remove_topics, $auto_sync, $post_count_sync);
+ delete_topics('topic_id', $remove_topics, $auto_sync, $post_count_sync, false);
}
return sizeof($post_ids);