Minor changes to select box

git-svn-id: file:///svn/phpbb/trunk@2944 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-10-08 21:01:25 +00:00
parent 1d0e4ee436
commit 2c16ed7248
5 changed files with 34 additions and 37 deletions

View file

@ -472,7 +472,7 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
else else
{ {
$select_list = make_forum_select('f'); $select_list = make_forum_select();
page_header($l_title); page_header($l_title);
@ -487,7 +487,7 @@ else
<th align="center"><?php echo $lang['Select_a_Forum']; ?></th> <th align="center"><?php echo $lang['Select_a_Forum']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" align="center">&nbsp;<?php echo $select_list; ?> &nbsp;<input type="submit" value="<?php echo $lang['Look_up_Forum']; ?>" class="mainoption" />&nbsp;</td> <td class="row1" align="center">&nbsp;<select name="f"><?php echo $select_list; ?></select> &nbsp;<input type="submit" value="<?php echo $lang['Look_up_Forum']; ?>" class="mainoption" />&nbsp;</td>
</tr> </tr>
</table></form> </table></form>

View file

@ -63,9 +63,16 @@ else
$mode = 'admin'; $mode = 'admin';
} }
// if ( isset($_POST['f']) || isset($_GET['f']) )
{
$forum_id = ( isset($_POST['f']) ) ? $_POST['f'] : $_GET['f'];
}
else
{
$forum_id = 0;
}
// Define some vars depending on which logs we're looking at // Define some vars depending on which logs we're looking at
//
$log_table_sql = ( $mode == 'admin' ) ? LOG_ADMIN_TABLE : LOG_MOD_TABLE; $log_table_sql = ( $mode == 'admin' ) ? LOG_ADMIN_TABLE : LOG_MOD_TABLE;
$l_title = ( $mode == 'admin' ) ? $lang['Admin_logs'] : $lang['Mod_logs']; $l_title = ( $mode == 'admin' ) ? $lang['Admin_logs'] : $lang['Mod_logs'];
$l_title_explain = ( $mode == 'admin' ) ? $lang['Admin_logs_explain'] : $lang['Mod_logs_explain']; $l_title_explain = ( $mode == 'admin' ) ? $lang['Admin_logs_explain'] : $lang['Mod_logs_explain'];
@ -141,19 +148,7 @@ $sort_order_options = ( $sort_dir == 'a' ) ? '<option value="a" selected="select
$sort_sql = $sort_by[$sort_key] . ' ' . ( ( $sort_dir == 'd' ) ? 'DESC' : 'ASC' ); $sort_sql = $sort_by[$sort_key] . ' ' . ( ( $sort_dir == 'd' ) ? 'DESC' : 'ASC' );
//
// Define forum list if we're looking @ mod logs
//
$forum_box = '';
if ( $mode == 'mod' )
{
include($phpbb_root_path . '/includes/functions_admin.'.$phpEx);
$forum_box = make_forum_select('f');
}
//
// Output page // Output page
//
page_header($l_title); page_header($l_title);
?> ?>
@ -165,13 +160,16 @@ page_header($l_title);
<form method="post" action="<?php echo "admin_viewlogs.$phpEx$SID&amp;mode=$mode"; ?>"> <form method="post" action="<?php echo "admin_viewlogs.$phpEx$SID&amp;mode=$mode"; ?>">
<?php <?php
// Define forum list if we're looking @ mod logs
if ( $mode == 'mod' ) if ( $mode == 'mod' )
{ {
include($phpbb_root_path . '/includes/functions_admin.'.$phpEx);
$forum_box = make_forum_select($forum_id);
?> ?>
<table width="100%" cellpadding="1" cellspacing="1" border="0"> <table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr> <tr>
<td align="right"><?php echo $lang['Select_forum']; ?>: <?php echo $forum_box; ?> <input class="liteoption" type="submit" value="<?php echo $lang['Go']; ?>" /></td> <td align="right"><?php echo $lang['Select_forum']; ?>: <select name="f" onchange="this.form.submit()"><?php echo $forum_box; ?></select> <input class="liteoption" type="submit" value="<?php echo $lang['Go']; ?>" /></td>
</tr> </tr>
</table> </table>
<?php <?php

View file

@ -20,7 +20,7 @@
***************************************************************************/ ***************************************************************************/
// Simple version of jumpbox, just lists authed forums // Simple version of jumpbox, just lists authed forums
function make_forum_select($box_name, $ignore_forum = false) function make_forum_select($default_forum = false, $ignore_forum = false)
{ {
global $db, $userdata, $auth, $lang; global $db, $userdata, $auth, $lang;
@ -34,28 +34,27 @@ function make_forum_select($box_name, $ignore_forum = false)
$forum_list = ''; $forum_list = '';
while ( $row = $db->sql_fetchrow($result) ) while ( $row = $db->sql_fetchrow($result) )
{ {
if ( $row['left_id'] < $right )
{
$subforum .= '&nbsp;&nbsp;&nbsp;';
}
else if ( $row['left_id'] > $right + 1 )
{
$subforum = substr($subforum, 0, -18 * ( $row['left_id'] - $right + 1 ));
}
$right = $row['right_id'];
if ( ( $auth->acl_get('f_list', $forum_id) || $auth->acl_get('a_') ) && $ignore_forum != $row['forum_id'] ) if ( ( $auth->acl_get('f_list', $forum_id) || $auth->acl_get('a_') ) && $ignore_forum != $row['forum_id'] )
{ {
if ( $row['left_id'] < $right ) $selected = ( $row['forum_id'] == $default_forum ) ? ' selected="selected"' : '';
{ $forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $subforum . $row['forum_name'] . '</option>';
$subforum .= '&nbsp;&nbsp;&nbsp;';
}
else if ( $row['left_id'] > $right + 1 )
{
$subforum = substr($subforum, 0, -18 * ( $row['left_id'] - $right + 1 ));
}
$forum_list .= '<option value="' . $row['forum_id'] . '">' . $subforum . $row['forum_name'] . '</option>';
$right = $row['right_id'];
} }
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$forum_list = ( $forum_list == '' ) ? '<option value="-1">' . $lang['No_forums'] . '</option>' : '<select name="' . $box_name . '">' . $forum_list . '</select>'; return ( $forum_list == '' ) ? '<option value="-1">' . $lang['No_forums'] . '</option>' : $forum_list;
return $forum_list;
} }
// Synchronise functions for forums/topics // Synchronise functions for forums/topics

View file

@ -251,13 +251,13 @@ $lang = array_merge($lang, array(
'Delete_user_posts_explain' => 'Setting this to yes will remove all posts made by the pruned users.', 'Delete_user_posts_explain' => 'Setting this to yes will remove all posts made by the pruned users.',
'Confirm_prune_users' => 'Are you sure you wish to prune the selected users?', 'Confirm_prune_users' => 'Are you sure you wish to prune the selected users?',
'Success_user_prune' => 'The selected users have been pruned successfully', 'Success_user_prune' => 'The selected users have been pruned successfully',
'Ban_explain' => 'Here you can control the banning of users by name, IP or email address. These methods prevent a user reaching any part of the board. You can give a short (255 character) reason for the ban if you wish. This will be displayed in the admin log. The length of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select <u>Other</u> for the ban length and enter a date in yyyy-mm-dd format.', 'Ban_explain' => 'Here you can control the banning of users by name, IP or email address. These methods prevent a user reaching any part of the board. You can give a short (255 character) reason for the ban if you wish. This will be displayed in the admin log. The length of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select <u>Until</u> for the ban length and enter a date in yyyy-mm-dd format.',
'Ban_length' => 'Length of ban', 'Ban_length' => 'Length of ban',
'Permanent' => 'Permanent', 'Permanent' => 'Permanent',
'30_Mins' => '30 Minutes', '30_Mins' => '30 Minutes',
'1_Hour' => '1 Hour', '1_Hour' => '1 Hour',
'6_Hours' => '6 Hours', '6_Hours' => '6 Hours',
'Other' => 'Other -&gt;', 'Other' => 'Until -&gt;',
'Ban_reason' => 'Reason for ban', 'Ban_reason' => 'Reason for ban',
'Ban_username_explain' => 'You can ban multiple users in one go by entering each name on a new line. Use the <u>Find a Username</u> facility to look up and add one or more users automatically.', 'Ban_username_explain' => 'You can ban multiple users in one go by entering each name on a new line. Use the <u>Find a Username</u> facility to look up and add one or more users automatically.',
'Unban_username' => 'Un-ban usernames', 'Unban_username' => 'Un-ban usernames',

View file

@ -466,7 +466,7 @@ switch( $mode )
'L_YES' => $lang['Yes'], 'L_YES' => $lang['Yes'],
'L_NO' => $lang['No'], 'L_NO' => $lang['No'],
'S_FORUM_SELECT' => make_forum_select('new_forum', $forum_id), 'S_FORUM_SELECT' => '<select name="new_forum">' . make_forum_select(0, $forum_id) . '</select>',
'S_MODCP_ACTION' => append_sid("modcp.$phpEx"), 'S_MODCP_ACTION' => append_sid("modcp.$phpEx"),
'S_HIDDEN_FIELDS' => $hidden_fields) 'S_HIDDEN_FIELDS' => $hidden_fields)
); );
@ -665,7 +665,7 @@ switch( $mode )
'S_SPLIT_ACTION' => "modcp.$phpEx$SID", 'S_SPLIT_ACTION' => "modcp.$phpEx$SID",
'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_FORUM_SELECT' => make_forum_select("new_forum_id")) 'S_FORUM_SELECT' => '<select name="new_forum_id">' . make_forum_select() . '</select>')
); );
for($i = 0; $i < $total_posts; $i++) for($i = 0; $i < $total_posts; $i++)