From 81aaa278b1f408ed29be2e31115279b6e868bad6 Mon Sep 17 00:00:00 2001 From: Bart van Bragt Date: Thu, 23 Aug 2001 18:16:35 +0000 Subject: [PATCH] Adapted for admin_forums git-svn-id: file:///svn/phpbb/trunk@926 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/prune.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/prune.php b/phpBB/includes/prune.php index fe00b77b5a..33bcfe9cc7 100644 --- a/phpBB/includes/prune.php +++ b/phpBB/includes/prune.php @@ -28,8 +28,12 @@ function prune($forum_id, $prune_date) FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t WHERE t.forum_id = $forum_id AND t.topic_type = " . POST_NORMAL . " - AND p.post_id = t.topic_last_post_id - AND p.post_time < $prune_date"; + AND p.post_id = t.topic_last_post_id"; + // Do we want to delete everything in the forum? + if ($prune_date != FALSE) + { + $sql .= " AND p.post_time < $prune_date"; + } if(!$result_topics = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't obtain lists of topics to prune.", "", __LINE__, __FILE__, $sql); @@ -39,9 +43,13 @@ function prune($forum_id, $prune_date) $sql = "SELECT p.post_id FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t WHERE p.forum_id = $forum_id - AND p.post_time < $prune_date AND t.topic_id = p.topic_id AND t.topic_type = " . POST_NORMAL; + // Do we want to delete everything in the forum? + if ($prune_date != FALSE) + { + $sql .= " AND p.post_time < $prune_date"; + } if(!$result_posts = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't obtain list of posts to prune.", "", __LINE__, __FILE__, $sql); @@ -171,4 +179,4 @@ function auto_prune($forum_id = 0) return; } -?> \ No newline at end of file +?>