diff options
author | 3Di <three3di@hotmail.it> | 2018-10-26 18:33:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-26 18:33:30 +0200 |
commit | 379900b4eda527d91c2e3252db5e3b89038bc425 (patch) | |
tree | 6c8db1854d475b2b15c1b5c98c77e5f9f9fa1ff3 /phpBB/phpbb/cron/task/core | |
parent | 001f32da95d4f8697ccc9a6107afc8dc68cbe48e (diff) | |
parent | fd95355c6129043e09d189c193ff5d1abde8db96 (diff) | |
download | forums-379900b4eda527d91c2e3252db5e3b89038bc425.tar forums-379900b4eda527d91c2e3252db5e3b89038bc425.tar.gz forums-379900b4eda527d91c2e3252db5e3b89038bc425.tar.bz2 forums-379900b4eda527d91c2e3252db5e3b89038bc425.tar.xz forums-379900b4eda527d91c2e3252db5e3b89038bc425.zip |
Merge pull request #2 from phpbb/3.2.x
3.2.x
Diffstat (limited to 'phpBB/phpbb/cron/task/core')
-rw-r--r-- | phpBB/phpbb/cron/task/core/prune_all_forums.php | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/phpBB/phpbb/cron/task/core/prune_all_forums.php b/phpBB/phpbb/cron/task/core/prune_all_forums.php index b47939ccbe..5005f5b894 100644 --- a/phpBB/phpbb/cron/task/core/prune_all_forums.php +++ b/phpBB/phpbb/cron/task/core/prune_all_forums.php @@ -55,21 +55,26 @@ class prune_all_forums extends \phpbb\cron\task\base include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); } - $sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq - FROM ' . FORUMS_TABLE . " - WHERE enable_prune = 1 - AND prune_next < " . time(); + $sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, enable_shadow_prune, prune_shadow_days, prune_shadow_freq, prune_shadow_next, forum_flags, prune_freq + FROM ' . FORUMS_TABLE; $result = $this->db->sql_query($sql); while ($row = $this->db->sql_fetchrow($result)) { - if ($row['prune_days']) + if ($row['enable_prune'] && $row['prune_next'] < time()) { - auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']); - } + if ($row['prune_days']) + { + auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']); + } - if ($row['prune_viewed']) + if ($row['prune_viewed']) + { + auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']); + } + } + if ($row['enable_shadow_prune'] && $row['prune_shadow_next'] < time() && $row['prune_shadow_days']) { - auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']); + auto_prune($row['forum_id'], 'shadow', $row['forum_flags'], $row['prune_shadow_days'], $row['prune_shadow_freq']); } } $this->db->sql_freeresult($result); |