From 3c7ff1c417bd57ab71057fa3d880d58f1ee65f2a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 30 Jan 2014 22:21:06 +0100 Subject: [PATCH] [ticket/12150] Add options to acp PHPBB3-12150 --- phpBB/adm/style/acp_forums.html | 13 ++++++ phpBB/includes/acp/acp_forums.php | 3 ++ phpBB/language/en/acp/forums.php | 2 + .../data/v310/prune_shadow_topics.php | 44 +++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php 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 @@
+
+

{L_FORUM_PRUNE_SHADOW_TOPICS_EXPLAIN}
+
+
+
+
+

{L_AUTO_PRUNE_FREQ_EXPLAIN}
+
{L_DAYS}
+
+
+

{L_AUTO_PRUNE_DAYS_EXPLAIN}
+
{L_DAYS}
+
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 @@ + 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', + ), + ), + ); + } +}