diff options
author | the_systech <the_systech@users.sourceforge.net> | 2001-08-31 20:58:31 +0000 |
---|---|---|
committer | the_systech <the_systech@users.sourceforge.net> | 2001-08-31 20:58:31 +0000 |
commit | 5c6eb1e14918762ef657d8c93d83d2fafd2b36e0 (patch) | |
tree | 15bcb3ff97965492ee693793f9863b42c0c1eb22 /phpBB/includes/prune.php | |
parent | ddf104d7817deb77c92de40653790ceab64f2c45 (diff) | |
download | forums-5c6eb1e14918762ef657d8c93d83d2fafd2b36e0.tar forums-5c6eb1e14918762ef657d8c93d83d2fafd2b36e0.tar.gz forums-5c6eb1e14918762ef657d8c93d83d2fafd2b36e0.tar.bz2 forums-5c6eb1e14918762ef657d8c93d83d2fafd2b36e0.tar.xz forums-5c6eb1e14918762ef657d8c93d83d2fafd2b36e0.zip |
Additions for forum auto_pruning, and fix for form submission on edits
git-svn-id: file:///svn/phpbb/trunk@956 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/prune.php')
-rw-r--r-- | phpBB/includes/prune.php | 28 |
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 +?> |