aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorBart van Bragt <bartvb@users.sourceforge.net>2001-08-23 18:16:35 +0000
committerBart van Bragt <bartvb@users.sourceforge.net>2001-08-23 18:16:35 +0000
commit81aaa278b1f408ed29be2e31115279b6e868bad6 (patch)
tree7f5e00ea9746f5b014ddc33934f350dad4cc2b6b /phpBB/includes
parent7dbfbde723e06419fba8d029db3962fc476fadbe (diff)
downloadforums-81aaa278b1f408ed29be2e31115279b6e868bad6.tar
forums-81aaa278b1f408ed29be2e31115279b6e868bad6.tar.gz
forums-81aaa278b1f408ed29be2e31115279b6e868bad6.tar.bz2
forums-81aaa278b1f408ed29be2e31115279b6e868bad6.tar.xz
forums-81aaa278b1f408ed29be2e31115279b6e868bad6.zip
Adapted for admin_forums
git-svn-id: file:///svn/phpbb/trunk@926 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/prune.php16
1 files 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
+?>