mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/12150] Use shorter column names for prune settings
All columns were renamed from having prune_shadow_topics as namebase to just prune_shadow. A missing column was also added to the migration file's remove_schema() method. PHPBB3-12150
This commit is contained in:
parent
5866f08919
commit
d83d819827
7 changed files with 36 additions and 35 deletions
|
@ -279,17 +279,17 @@
|
|||
<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_SHADOW_TOPIC_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_SHADOW_TOPIC_ENABLE --> id="enable_shadow_topic_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
<dt><label for="enable_shadow_prune">{L_FORUM_PRUNE_SHADOW}{L_COLON}</label><br /><span>{L_FORUM_PRUNE_SHADOW_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="enable_shadow_prune" value="1"<!-- IF S_PRUNE_SHADOW_ENABLE --> id="enable_shadow_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="enable_shadow_prune" value="0"<!-- IF not S_PRUNE_SHADOW_ENABLE --> id="enable_shadow_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>
|
||||
<dt><label for="prune_shadow_freq">{L_AUTO_PRUNE_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt>
|
||||
<dd><input type="number" id="prune_shadow_freq" name="prune_shadow_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>
|
||||
<dt><label for="prune_shadow_days">{L_AUTO_PRUNE_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_DAYS_EXPLAIN}</span></dt>
|
||||
<dd><input type="number" id="prune_shadow_days" name="prune_shadow_days" value="{PRUNE_DAYS}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
|
|
@ -138,15 +138,15 @@ class acp_forums
|
|||
'enable_prune' => request_var('enable_prune', false),
|
||||
'enable_post_review' => request_var('enable_post_review', true),
|
||||
'enable_quick_reply' => request_var('enable_quick_reply', false),
|
||||
'enable_shadow_topic_prune' => request_var('enable_shadow_topic_prune', false),
|
||||
'enable_shadow_prune' => request_var('enable_shadow_prune', false),
|
||||
'prune_days' => request_var('prune_days', 7),
|
||||
'prune_viewed' => request_var('prune_viewed', 7),
|
||||
'prune_freq' => request_var('prune_freq', 1),
|
||||
'prune_old_polls' => request_var('prune_old_polls', false),
|
||||
'prune_announce' => request_var('prune_announce', false),
|
||||
'prune_sticky' => request_var('prune_sticky', false),
|
||||
'prune_shadow_topic_days' => request_var('prune_shadow_topic_days', 7),
|
||||
'prune_shadow_topic_freq' => request_var('prune_shadow_topic_freq', 1),
|
||||
'prune_shadow_days' => request_var('prune_shadow_days', 7),
|
||||
'prune_shadow_freq' => request_var('prune_shadow_freq', 1),
|
||||
'forum_password' => request_var('forum_password', '', true),
|
||||
'forum_password_confirm'=> request_var('forum_password_confirm', '', true),
|
||||
'forum_password_unset' => request_var('forum_password_unset', false),
|
||||
|
@ -460,9 +460,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,
|
||||
'enable_shadow_prune' => false,
|
||||
'prune_shadow_days' => 7,
|
||||
'prune_shadow_freq' => 1,
|
||||
'forum_flags' => FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS,
|
||||
'forum_options' => 0,
|
||||
'forum_password' => '',
|
||||
|
@ -642,8 +642,8 @@ class acp_forums
|
|||
'PRUNE_FREQ' => $forum_data['prune_freq'],
|
||||
'PRUNE_DAYS' => $forum_data['prune_days'],
|
||||
'PRUNE_VIEWED' => $forum_data['prune_viewed'],
|
||||
'PRUNE_SHADOW_TOPIC_FREQ' => $forum_data['prune_shadow_topic_freq'],
|
||||
'PRUNE_SHADOW_TOPIC_DAYS' => $forum_data['prune_shadow_topic_days'],
|
||||
'PRUNE_SHADOW_FREQ' => $forum_data['prune_shadow_freq'],
|
||||
'PRUNE_SHADOW_DAYS' => $forum_data['prune_shadow_days'],
|
||||
'TOPICS_PER_PAGE' => $forum_data['forum_topics_per_page'],
|
||||
'FORUM_RULES_LINK' => $forum_data['forum_rules_link'],
|
||||
'FORUM_RULES' => $forum_data['forum_rules'],
|
||||
|
@ -676,7 +676,7 @@ class acp_forums
|
|||
'S_DISPLAY_SUBFORUM_LIST' => ($forum_data['display_subforum_list']) ? true : false,
|
||||
'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false,
|
||||
'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false,
|
||||
'S_PRUNE_SHADOW_TOPIC_ENABLE' => ($forum_data['enable_shadow_topic_prune']) ? true : false,
|
||||
'S_PRUNE_SHADOW_ENABLE' => ($forum_data['enable_shadow_prune']) ? true : false,
|
||||
'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false,
|
||||
'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_POLL) ? true : false,
|
||||
'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_ANNOUNCE) ? true : false,
|
||||
|
|
|
@ -676,7 +676,7 @@ $lang = array_merge($lang, array(
|
|||
|
||||
'LOG_PRUNE' => '<strong>Pruned forums</strong><br />» %s',
|
||||
'LOG_AUTO_PRUNE' => '<strong>Auto-pruned forums</strong><br />» %s',
|
||||
'LOG_PRUNE_SHADOW_TOPIC' => '<strong>Auto-pruned shadow topics</strong><br />» %s',
|
||||
'LOG_PRUNE_SHADOW' => '<strong>Auto-pruned shadow topics</strong><br />» %s',
|
||||
'LOG_PRUNE_USER_DEAC' => '<strong>Users deactivated</strong><br />» %s',
|
||||
'LOG_PRUNE_USER_DEL_DEL' => '<strong>Users pruned and posts deleted</strong><br />» %s',
|
||||
'LOG_PRUNE_USER_DEL_ANON' => '<strong>Users pruned and posts retained</strong><br />» %s',
|
||||
|
|
|
@ -101,8 +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_PRUNE_SHADOW' => 'Enable auto-pruning of shadow topics',
|
||||
'FORUM_PRUNE_SHADOW_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',
|
||||
|
|
|
@ -73,9 +73,9 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
|
|||
include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext);
|
||||
}
|
||||
|
||||
if ($this->forum_data['prune_shadow_topic_days'])
|
||||
if ($this->forum_data['prune_shadow_days'])
|
||||
{
|
||||
$this->auto_prune_shadow_topics($this->forum_data['forum_id'], 'shadow', $this->forum_data['forum_flags'], $this->forum_data['prune_shadow_topic_days'], $this->forum_data['prune_shadow_topic_freq']);
|
||||
$this->auto_prune_shadow_topics($this->forum_data['forum_id'], 'shadow', $this->forum_data['forum_flags'], $this->forum_data['prune_shadow_days'], $this->forum_data['prune_shadow_freq']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
|
|||
*/
|
||||
public function should_run()
|
||||
{
|
||||
return $this->forum_data['enable_shadow_topic_prune'] && $this->forum_data['prune_shadow_topic_next'] < time();
|
||||
return $this->forum_data['enable_shadow_prune'] && $this->forum_data['prune_shadow_next'] < time();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -136,7 +136,7 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
|
|||
{
|
||||
$forum_id = $request->variable('f', 0);
|
||||
|
||||
$sql = 'SELECT forum_id, prune_shadow_topic_next, enable_shadow_topic_prune, prune_shadow_topic_days, forum_flags, prune_shadow_topic_freq
|
||||
$sql = 'SELECT forum_id, prune_shadow_next, enable_shadow_prune, prune_shadow_days, forum_flags, prune_shadow_freq
|
||||
FROM ' . FORUMS_TABLE . "
|
||||
WHERE forum_id = $forum_id";
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
@ -176,11 +176,11 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
|
|||
prune($forum_id, $prune_mode, $prune_date, $prune_flags, true);
|
||||
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET prune_shadow_topic_next = $next_prune
|
||||
SET prune_shadow_next = $next_prune
|
||||
WHERE forum_id = $forum_id";
|
||||
$this->db->sql_query($sql);
|
||||
|
||||
add_log('admin', 'LOG_PRUNE_SHADOW_TOPIC', $row['forum_name']);
|
||||
add_log('admin', 'LOG_PRUNE_SHADOW', $row['forum_name']);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -21,10 +21,10 @@ class prune_shadow_topics extends \phpbb\db\migration\migration
|
|||
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'),
|
||||
'prune_shadow_topic_next' => array('INT:11', 0, 'after' => 'prune_shadow_topic_freq'),
|
||||
'enable_shadow_prune' => array('BOOL', 0, 'after' => 'prune_freq'),
|
||||
'prune_shadow_days' => array('UINT', 7, 'after' => 'enable_shadow_prune'),
|
||||
'prune_shadow_freq' => array('UINT', 1, 'after' => 'prune_shadow_freq'),
|
||||
'prune_shadow_next' => array('INT:11', 0, 'after' => 'prune_shadow_freq'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -35,9 +35,10 @@ class prune_shadow_topics extends \phpbb\db\migration\migration
|
|||
return array(
|
||||
'drop_columns' => array(
|
||||
$this->table_prefix . 'forums' => array(
|
||||
'enable_shadow_topic_prune',
|
||||
'prune_shadow_topic_days',
|
||||
'prune_shadow_topic_freq',
|
||||
'enable_shadow_prune',
|
||||
'prune_shadow_days',
|
||||
'prune_shadow_freq',
|
||||
'prune_shadow_next',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -27,9 +27,9 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas
|
|||
$crawler = self::submit($form);
|
||||
$form = $crawler->selectButton('update')->form(array(
|
||||
'forum_perm_from' => 2,
|
||||
'enable_shadow_topic_prune' => true,
|
||||
'prune_shadow_topic_freq' => 1,
|
||||
'prune_shadow_topic_days' => 1,
|
||||
'enable_shadow_prune' => true,
|
||||
'prune_shadow_freq' => 1,
|
||||
'prune_shadow_days' => 1,
|
||||
));
|
||||
$crawler = self::submit($form);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue