aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/prune.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/prune.php')
-rw-r--r--phpBB/includes/prune.php28
1 files changed, 13 insertions, 15 deletions
diff --git a/phpBB/includes/prune.php b/phpBB/includes/prune.php
index b820f24359..9224e71a25 100644
--- a/phpBB/includes/prune.php
+++ b/phpBB/includes/prune.php
@@ -158,25 +158,23 @@ function auto_prune($forum_id = 0)
while($row = $db->sql_fetchrow($result))
{
- $forum_id = $row['forum_id'];
-
- $prune_date = time() - ($row['prune_days'] * $one_day);
-
- $pruned = prune($forum_id, $prune_date);
-
- $next_prune = time() + ($row['prune_freq'] * $one_day);
-
- $sql = "UPDATE " . FORUMS_TABLE . "
- SET prune_next = $next_prune
- WHERE forum_id = $forum_id";
- if(!$db->sql_query($sql))
+ if($row['prune_freq'] > 0 && $row['prune_days'] > 0)
{
- message_die(GENERAL_ERROR, "Auto-Prune: Couldn't update forum table.", __LINE__, __FILE__);
+ $forum_id = $row['forum_id'];
+ $prune_date = time() - ($row['prune_days'] * $one_day);
+ $pruned = prune($forum_id, $prune_date);
+ $next_prune = time() + ($row['prune_freq'] * $one_day);
+ $sql = "UPDATE " . FORUMS_TABLE . "
+ SET prune_next = $next_prune
+ WHERE forum_id = $forum_id";
+ if(!$db->sql_query($sql))
+ {
+ message_die(GENERAL_ERROR, "Auto-Prune: Couldn't update forum table.", __LINE__, __FILE__);
+ }
}
-
}
return;
}
-?> \ No newline at end of file
+?>