diff options
-rw-r--r-- | phpBB/adm/style/acp_forums.html | 13 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 3 | ||||
-rw-r--r-- | phpBB/language/en/acp/forums.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php | 44 |
4 files changed, 62 insertions, 0 deletions
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index e8b20007dc..4a534d0592 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -278,6 +278,19 @@ <dd><label><input type="radio" class="radio" name="prune_sticky" value="1"<!-- IF S_PRUNE_STICKY --> id="prune_sticky" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="prune_sticky" value="0"<!-- IF not S_PRUNE_STICKY --> id="prune_sticky" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> + <dl> + <dt><label for="enable_shadow_topic_prune">{L_FORUM_PRUNE_SHADOW_TOPICS}{L_COLON}</label><br /><span>{L_FORUM_PRUNE_SHADOW_TOPICS_EXPLAIN}</span></dt> + <dd><label><input type="radio" class="radio" name="enable_shadow_topic_prune" value="1"<!-- IF S_PRUNE_ENABLE --> id="enable_shadow_topic_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label> + <label><input type="radio" class="radio" name="enable_shadow_topic_prune" value="0"<!-- IF not S_PRUNE_ENABLE --> id="enable_shadow_topic_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> + </dl> + <dl> + <dt><label for="prune_shadow_topic_freq">{L_AUTO_PRUNE_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt> + <dd><input type="number" id="prune_shadow_topic_freq" name="prune_shadow_topic_freq" value="{PRUNE_FREQ}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd> + </dl> + <dl> + <dt><label for="prune_shadow_topic_days">{L_AUTO_PRUNE_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_DAYS_EXPLAIN}</span></dt> + <dd><input type="number" id="prune_shadow_topic_days" name="prune_shadow_topic_days" value="{PRUNE_DAYS}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd> + </dl> </fieldset> </div> diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index a1af8c489d..4cefc04608 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -457,6 +457,9 @@ class acp_forums 'prune_days' => 7, 'prune_viewed' => 7, 'prune_freq' => 1, + 'enable_shadow_topic_prune' => false, + 'prune_shadow_topic_days' => 7, + 'prune_shadow_topic_freq' => 1, 'forum_flags' => FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS, 'forum_options' => 0, 'forum_password' => '', diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index 756cb7ae0f..f452dad8a0 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -101,6 +101,8 @@ $lang = array_merge($lang, array( 'FORUM_PASSWORD_OLD' => 'The forum password is using an old hashing method and should be changed.', 'FORUM_PASSWORD_MISMATCH' => 'The passwords you entered did not match.', 'FORUM_PRUNE_SETTINGS' => 'Forum prune settings', + 'FORUM_PRUNE_SHADOW_TOPICS' => 'Enable auto-pruning of shadow topics', + 'FORUM_PRUNE_SHADOW_TOPICS_EXPLAIN' => 'Prunes the forum of shadow topics, set the frequency/age parameters below.', 'FORUM_RESYNCED' => 'Forum ā%sā successfully resynced', 'FORUM_RULES_EXPLAIN' => 'Forum rules are displayed at any page within the given forum.', 'FORUM_RULES_LINK' => 'Link to forum rules', diff --git a/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php b/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php new file mode 100644 index 0000000000..0aca897946 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php @@ -0,0 +1,44 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class prune_shadow_topics extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'enable_shadow_topic_prune' => array('BOOL', 0, 'after' => 'prune_freq'), + 'prune_shadow_topic_days' => array('UINT', 7, 'after' => 'enable_shadow_topic_prune'), + 'prune_shadow_topic_freq' => array('UINT', 1, 'after' => 'prune_shadow_topic_freq'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array( + 'enable_shadow_topic_prune', + 'prune_shadow_topic_days', + 'prune_shadow_topic_freq', + ), + ), + ); + } +} |