aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-10-08 21:01:25 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-10-08 21:01:25 +0000
commit2c16ed72489c37102158d5f5038049dce401cf26 (patch)
tree76ba9a392f6b006b22ed20a726cea45b81aadc2c /phpBB
parent1d0e4ee436cf7ca5790d83aac11ed9cf90a4ccda (diff)
downloadforums-2c16ed72489c37102158d5f5038049dce401cf26.tar
forums-2c16ed72489c37102158d5f5038049dce401cf26.tar.gz
forums-2c16ed72489c37102158d5f5038049dce401cf26.tar.bz2
forums-2c16ed72489c37102158d5f5038049dce401cf26.tar.xz
forums-2c16ed72489c37102158d5f5038049dce401cf26.zip
Minor changes to select box
git-svn-id: file:///svn/phpbb/trunk@2944 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/admin/admin_permissions.php4
-rw-r--r--phpBB/admin/admin_viewlogs.php28
-rw-r--r--phpBB/includes/functions_admin.php29
-rw-r--r--phpBB/language/en/lang_admin.php4
-rw-r--r--phpBB/modcp.php4
5 files changed, 33 insertions, 36 deletions
diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php
index b3f0bb7740..82b46bd108 100644
--- a/phpBB/admin/admin_permissions.php
+++ b/phpBB/admin/admin_permissions.php
@@ -472,7 +472,7 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
else
{
- $select_list = make_forum_select('f');
+ $select_list = make_forum_select();
page_header($l_title);
@@ -487,7 +487,7 @@ else
<th align="center"><?php echo $lang['Select_a_Forum']; ?></th>
</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>
</table></form>
diff --git a/phpBB/admin/admin_viewlogs.php b/phpBB/admin/admin_viewlogs.php
index 4fe5448bf4..a44f47dcfb 100644
--- a/phpBB/admin/admin_viewlogs.php
+++ b/phpBB/admin/admin_viewlogs.php
@@ -63,9 +63,16 @@ else
$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
-//
$log_table_sql = ( $mode == 'admin' ) ? LOG_ADMIN_TABLE : LOG_MOD_TABLE;
$l_title = ( $mode == 'admin' ) ? $lang['Admin_logs'] : $lang['Mod_logs'];
$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' );
-//
-// 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
-//
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"; ?>">
<?php
+// Define forum list if we're looking @ mod logs
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">
<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>
</table>
<?php
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index c44aa1df40..2707b5adef 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -20,7 +20,7 @@
***************************************************************************/
// 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;
@@ -34,28 +34,27 @@ function make_forum_select($box_name, $ignore_forum = false)
$forum_list = '';
while ( $row = $db->sql_fetchrow($result) )
{
- if ( ( $auth->acl_get('f_list', $forum_id) || $auth->acl_get('a_') ) && $ignore_forum != $row['forum_id'] )
+ if ( $row['left_id'] < $right )
{
- 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 ));
- }
+ $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'];
- $right = $row['right_id'];
+ if ( ( $auth->acl_get('f_list', $forum_id) || $auth->acl_get('a_') ) && $ignore_forum != $row['forum_id'] )
+ {
+ $selected = ( $row['forum_id'] == $default_forum ) ? ' selected="selected"' : '';
+ $forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $subforum . $row['forum_name'] . '</option>';
}
}
$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;
+ return ( $forum_list == '' ) ? '<option value="-1">' . $lang['No_forums'] . '</option>' : $forum_list;
}
// Synchronise functions for forums/topics
diff --git a/phpBB/language/en/lang_admin.php b/phpBB/language/en/lang_admin.php
index 737f136435..628d909dea 100644
--- a/phpBB/language/en/lang_admin.php
+++ b/phpBB/language/en/lang_admin.php
@@ -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.',
'Confirm_prune_users' => 'Are you sure you wish to prune the selected users?',
'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',
'Permanent' => 'Permanent',
'30_Mins' => '30 Minutes',
'1_Hour' => '1 Hour',
'6_Hours' => '6 Hours',
- 'Other' => 'Other -&gt;',
+ 'Other' => 'Until -&gt;',
'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.',
'Unban_username' => 'Un-ban usernames',
diff --git a/phpBB/modcp.php b/phpBB/modcp.php
index 8dc2105934..1ace157609 100644
--- a/phpBB/modcp.php
+++ b/phpBB/modcp.php
@@ -466,7 +466,7 @@ switch( $mode )
'L_YES' => $lang['Yes'],
'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_HIDDEN_FIELDS' => $hidden_fields)
);
@@ -665,7 +665,7 @@ switch( $mode )
'S_SPLIT_ACTION' => "modcp.$phpEx$SID",
'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++)