mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 16:27:38 +02:00
Changed forum_link_track to forum_flags for storage of additional info [ pruning related ], moved lang selection into DB, other minor changes, still working on admin_prune, per forum styling for posting
git-svn-id: file:///svn/phpbb/trunk@3989 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -82,6 +82,9 @@ switch ($mode)
|
||||
$enable_prune = (!empty($_POST['enable_prune'])) ? 1 : 0;
|
||||
$prune_days = (isset($_POST['prune_days'])) ? intval($_POST['prune_days']) : 7;
|
||||
$prune_freq = (isset($_POST['prune_freq'])) ? intval($_POST['prune_freq']) : 1;
|
||||
$prune_old_polls = (!empty($_POST['prune_old_polls'])) ? 1 : 0;
|
||||
$prune_announce = (!empty($_POST['prune_announce'])) ? 1 : 0;
|
||||
$prune_sticky = (!empty($_POST['prune_sticky'])) ? 1 : 0;
|
||||
$forum_password = (isset($_POST['forum_password'])) ? htmlspecialchars(stripslashes($_POST['forum_password'])) : '';
|
||||
$forum_password_confirm = (isset($_POST['forum_password_confirm'])) ? htmlspecialchars(stripslashes($_POST['forum_password_confirm'])) : '';
|
||||
|
||||
@@ -106,6 +109,17 @@ switch ($mode)
|
||||
$error[] = $user->lang['FORUM_DATA_NEGATIVE'];
|
||||
}
|
||||
|
||||
// Set forum flags
|
||||
// 1 = link tracking
|
||||
// 2 = prune old polls
|
||||
// 4 = prune announcements
|
||||
// 8 = prune stickies
|
||||
$forum_flags = 0;
|
||||
$forum_flags += ($forum_link_track) ? 1 : 0;
|
||||
$forum_flags += ($prune_old_polls) ? 2 : 0;
|
||||
$forum_flags += ($prune_announce) ? 4 : 0;
|
||||
$forum_flags += ($prune_sticky) ? 8 : 0;
|
||||
|
||||
// What are we going to do tonight Brain? The same thing we do everynight,
|
||||
// try to take over the world ... or decide whether to continue update
|
||||
// and if so, whether it's a new forum/cat/link or an existing one
|
||||
@@ -166,12 +180,12 @@ switch ($mode)
|
||||
'forum_type' => (int) $forum_type,
|
||||
'forum_status' => (int) $forum_status,
|
||||
'forum_link' => (string) $forum_link,
|
||||
'forum_link_track' => (int) $forum_link_track,
|
||||
'forum_password' => (string) $forum_password,
|
||||
'forum_topics_per_page' => (int) $forum_topics_per_page,
|
||||
'forum_style' => (int) $forum_style,
|
||||
'forum_image' => (string) $forum_image,
|
||||
'display_on_index' => (int) $display_on_index,
|
||||
'forum_flags' => (int) $forum_flags,
|
||||
'enable_icons' => (int) $enable_icons,
|
||||
'enable_prune' => (int) $enable_prune,
|
||||
'prune_days' => (int) $prune_days,
|
||||
@@ -229,12 +243,12 @@ switch ($mode)
|
||||
'forum_type' => (int) $forum_type,
|
||||
'forum_status' => (int) $forum_status,
|
||||
'forum_link' => (string) $forum_link,
|
||||
'forum_link_track' => (int) $forum_link_track,
|
||||
'forum_topics_per_page' => (int) $forum_topics_per_page,
|
||||
'forum_password' => (string) $forum_password,
|
||||
'forum_style' => (int) $forum_style,
|
||||
'forum_image' => (string) $forum_image,
|
||||
'display_on_index' => (int) $display_on_index,
|
||||
'forum_flags' => (int) $forum_flags,
|
||||
'enable_icons' => (int) $enable_icons,
|
||||
'enable_prune' => (int) $enable_prune,
|
||||
'prune_days' => (int) $prune_days,
|
||||
@@ -305,17 +319,24 @@ switch ($mode)
|
||||
|
||||
$statuslist = '<option value="' . ITEM_UNLOCKED . '"' . (($forum_status == ITEM_UNLOCKED) ? ' selected="selected"' : '') . '>' . $user->lang['UNLOCKED'] . '</option><option value="' . ITEM_LOCKED . '"' . (($forum_status == ITEM_LOCKED) ? ' selected="selected"' : '') . '>' . $user->lang['LOCKED'] . '</option>';
|
||||
|
||||
$topic_icons_yes = ($enable_icons) ? 'checked="checked"' : '';
|
||||
$topic_icons_no = (!$enable_icons) ? 'checked="checked"' : '';
|
||||
$topic_icons_yes = ($enable_icons) ? ' checked="checked"' : '';
|
||||
$topic_icons_no = (!$enable_icons) ? ' checked="checked"' : '';
|
||||
|
||||
$display_index_yes = ($display_on_index) ? 'checked="checked"' : '';
|
||||
$display_index_no = (!$display_on_index) ? 'checked="checked"' : '';
|
||||
$display_index_yes = ($display_on_index) ? ' checked="checked"' : '';
|
||||
$display_index_no = (!$display_on_index) ? ' checked="checked"' : '';
|
||||
|
||||
$prune_enable_yes = ($prune_enabled) ? 'checked="checked"' : '';
|
||||
$prune_enable_no = (!$prune_enabled) ? 'checked="checked"' : '';
|
||||
$prune_enable_yes = ($enable_prune) ? ' checked="checked"' : '';
|
||||
$prune_enable_no = (!$enable_prune) ? ' checked="checked"' : '';
|
||||
|
||||
$forum_link_track_yes = ($forum_link_track) ? 'checked="checked"' : '';
|
||||
$forum_link_track_no = (!$forum_link_track) ? 'checked="checked"' : '';
|
||||
$prune_old_polls_yes = ($forum_flags & 2) ? ' checked="checked"' : '';
|
||||
$prune_old_polls_no = (!($forum_flags & 2)) ? ' checked="checked"' : '';
|
||||
$prune_announce_yes = ($forum_flags & 4) ? ' checked="checked"' : '';
|
||||
$prune_announce_no = (!($forum_flags & 4)) ? ' checked="checked"' : '';
|
||||
$prune_sticky_yes = ($forum_flags & 8) ? ' checked="checked"' : '';
|
||||
$prune_sticky_no = (!($forum_flags & 8)) ? ' checked="checked"' : '';
|
||||
|
||||
$forum_link_track_yes = ($forum_flags & 1) ? ' checked="checked"' : '';
|
||||
$forum_link_track_no = (!($forum_flags & 1)) ? ' checked="checked"' : '';
|
||||
|
||||
$navigation = '<a href="admin_forums.' . $phpEx . $SID . '">' . $user->lang['FORUM_INDEX'] . '</a>';
|
||||
|
||||
@@ -479,6 +500,18 @@ switch ($mode)
|
||||
<td class="row1"><?php echo $user->lang['AUTO_PRUNE_DAYS'] ?>: <br /><span class="gensmall"><?php echo $user->lang['AUTO_PRUNE_DAYS_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input class="post" type="text" name="prune_days" value="<?php echo $prune_days ?>" size="5" /> <?php echo $user->lang['DAYS']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_OLD_POLLS'] ?>: <br /><span class="gensmall"><?php echo $user->lang['PRUNE_OLD_POLLS_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="prune_old_polls" value="1"<?php echo $prune_old_polls_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_old_polls" value="0"<?php echo $prune_old_polls_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_ANNOUNCEMENTS'] ?>: </td>
|
||||
<td class="row2"><input type="radio" name="prune_announce" value="1"<?php echo $prune_announce_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_announce" value="0"<?php echo $prune_announce_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_STICKY'] ?>: </td>
|
||||
<td class="row2"><input type="radio" name="prune_sticky" value="1"<?php echo $prune_sticky_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_sticky" value="0"<?php echo $prune_sticky_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['FORUM_TOPICS_PAGE'] ?>: <br /><span class="gensmall"><?php echo $user->lang['FORUM_TOPICS_PAGE_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="text" name="topics_per_page" value="<?php echo $forum_topics_per_page; ?>" size="3" maxlength="3" /></td>
|
||||
|
@@ -44,7 +44,7 @@ if (!$auth->acl_get('a_prune'))
|
||||
}
|
||||
|
||||
// Get the forum ID for pruning
|
||||
$forum_id = (isset($_REQUEST['f'])) ? intval($_REQUEST['f']) : -1;
|
||||
$forum_id = (isset($_REQUEST['f'])) ? intval($_REQUEST['f']) : 0;
|
||||
|
||||
// Check for submit to be equal to Prune. If so then proceed with the pruning.
|
||||
if (isset($_POST['doprune']))
|
||||
@@ -140,20 +140,23 @@ adm_page_header($user->lang['PRUNE']);
|
||||
|
||||
// If they haven't selected a forum for pruning yet then
|
||||
// display a select box to use for pruning.
|
||||
if ($forum_id == -1)
|
||||
if (!$forum_id)
|
||||
{
|
||||
|
||||
// Output a selection table if no forum id has been specified.
|
||||
$select_list = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select(false, false, false);
|
||||
$select_list = make_forum_select(false, false, false);
|
||||
|
||||
?>
|
||||
|
||||
<form method="post" action="admin_prune.<?php echo $phpEx . $SID; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th align="center"><?php echo $user->lang['SELECT_FORUM']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"> <select name="f"><?php echo $select_list; ?></select> <input type="submit" value="<?php echo $user->lang['LOOK_UP_FORUM']; ?>" class="mainoption" /> </td>
|
||||
<td class="row1" align="center"><select name="f[]" multiple="true" size="5"><?php echo $select_list; ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" align="center"><input class="mainoption" type="submit" value="<?php echo $user->lang['LOOK_UP_FORUM']; ?>" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
@@ -176,15 +179,28 @@ else
|
||||
|
||||
<h2><?php echo $user->lang['FORUM'] . ': <i>' . $forum_name; ?></i></h2>
|
||||
|
||||
<form method="post" action="admin_prune.<?php echo $phpEx . $SID; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th class="th"><?php echo $user->lang['FORUM_PRUNE']; ?></th>
|
||||
<th colspan="2"><?php echo $user->lang['FORUM_PRUNE']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo sprintf($user->lang['PRUNE_NOT_POSTED'], '<input type="text" name="prunedays" size="4" />'); ?></td>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_NOT_POSTED']; ?></td>
|
||||
<td class="row2"><input type="text" name="prune_days" size="4" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" align="center"><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="submit" name="doprune" value="<?php echo $user->lang['DO_PRUNE']; ?>" class="mainoption"></td>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_OLD_POLLS'] ?>: <br /><span class="gensmall"><?php echo $user->lang['PRUNE_OLD_POLLS_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="prune_old_polls" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_old_polls" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_ANNOUNCEMENTS'] ?>: </td>
|
||||
<td class="row2"><input type="radio" name="prune_announce" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_announce" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_STICKY'] ?>: </td>
|
||||
<td class="row2"><input type="radio" name="prune_sticky" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_sticky" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption"></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
|
Reference in New Issue
Block a user