aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2005-05-15 20:17:35 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2005-05-15 20:17:35 +0000
commit918914926b13253ef3a9af40bcdb0ea8b900f497 (patch)
tree2d1e0313e99f45e82a2f5081dfb450de352dad28 /phpBB/adm
parent4c207e5510a77931d3eed6fc065f294c8f675f82 (diff)
downloadforums-918914926b13253ef3a9af40bcdb0ea8b900f497.tar
forums-918914926b13253ef3a9af40bcdb0ea8b900f497.tar.gz
forums-918914926b13253ef3a9af40bcdb0ea8b900f497.tar.bz2
forums-918914926b13253ef3a9af40bcdb0ea8b900f497.tar.xz
forums-918914926b13253ef3a9af40bcdb0ea8b900f497.zip
- request_var updates
- added group selection to pm filter - fixed activation/deletion of inactive user accounts in admin index - fixed some color swatch bugs git-svn-id: file:///svn/phpbb/trunk@5152 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/adm')
-rw-r--r--phpBB/adm/admin_attachments.php4
-rw-r--r--phpBB/adm/admin_bbcodes.php10
-rw-r--r--phpBB/adm/admin_groups.php4
-rw-r--r--phpBB/adm/index.php35
-rw-r--r--phpBB/adm/swatch.php12
5 files changed, 46 insertions, 19 deletions
diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php
index 02a024f541..1b538593bc 100644
--- a/phpBB/adm/admin_attachments.php
+++ b/phpBB/adm/admin_attachments.php
@@ -361,8 +361,8 @@ if ($submit && $mode == 'ext_groups')
if ($submit && $mode == 'orphan')
{
- $delete_files = (isset($_POST['delete'])) ? array_keys(request_var('delete', '')) : array();
- $add_files = (isset($_POST['add'])) ? array_keys(request_var('add', '')) : array();
+ $delete_files = (isset($_POST['delete'])) ? array_keys(request_var('delete', array('' => 0))) : array();
+ $add_files = (isset($_POST['add'])) ? array_keys(request_var('add', array('' => 0))) : array();
$post_ids = request_var('post_id', 0);
foreach ($delete_files as $delete)
diff --git a/phpBB/adm/admin_bbcodes.php b/phpBB/adm/admin_bbcodes.php
index 642e863d92..782191de87 100644
--- a/phpBB/adm/admin_bbcodes.php
+++ b/phpBB/adm/admin_bbcodes.php
@@ -186,7 +186,7 @@ switch ($mode)
if ($mode == 'create')
{
- // TODO: look for SQL incompatibilities
+ /* TODO: look for SQL incompatibilities
// NOTE: I'm sure there was another simpler (and obvious) way of finding a suitable bbcode_id
$sql = 'SELECT b1.bbcode_id
FROM ' . BBCODES_TABLE . ' b1, ' . BBCODES_TABLE . ' b2
@@ -197,6 +197,12 @@ switch ($mode)
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
+*/
+ $sql = 'SELECT MAX(bbcode_id) as bbcode_id
+ FROM ' . BBCODES_TABLE;
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
if ($row)
{
@@ -327,7 +333,7 @@ function build_regexp($msg_bbcode, $msg_html)
$tokens = array(
'URL' => array(
- '!([a-z0-9]+://)?(.*?[^ \t\n\r<"]*)!ise' => "(('\$1') ? '\$1\$2' : 'http://\$2')"
+ '!([a-z0-9]+://)?([^?].*?[^ \t\n\r<"]*)!ie' => "(('\$1') ? '\$1\$2' : 'http://\$2')"
),
'LOCAL_URL' => array(
'!([^:]+/[^ \t\n\r<"]*)!' => '$1'
diff --git a/phpBB/adm/admin_groups.php b/phpBB/adm/admin_groups.php
index ae61af33f9..9187b66ddc 100644
--- a/phpBB/adm/admin_groups.php
+++ b/phpBB/adm/admin_groups.php
@@ -41,8 +41,8 @@ if (!$auth->acl_get('a_group'))
$mode = request_var('mode', '');
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''));
$group_id = request_var('g', 0);
-$mark_ary = request_var('mark', 0);
-$name_ary = request_var('usernames', '');
+$mark_ary = request_var('mark', array(0));
+$name_ary = request_var('usernames', array('' => 0));
$leader = request_var('leader', 0);
$default = request_var('default', 0);
$start = request_var('start', 0);
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index c7fd63253b..a1f683b4bb 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -129,7 +129,7 @@ else if ($pane == 'left')
elseif ($pane == 'right')
{
$action = request_var('action', '');
- $mark = (isset($_REQUEST['mark'])) ? implode(', ', request_var('mark', 0)) : '';
+ $mark = (isset($_REQUEST['mark'])) ? implode(', ', request_var('mark', array(0))) : '';
if ($mark)
{
@@ -142,16 +142,37 @@ elseif ($pane == 'right')
trigger_error($user->lang['NO_ADMIN']);
}
- $sql = ($action == 'activate') ? 'UPDATE ' . USERS_TABLE . ' SET user_type = ' . USER_NORMAL . " WHERE user_id IN ($mark)" : 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)";
- $db->sql_query($sql);
+ $sql = 'SELECT username
+ FROM ' . USERS_TABLE . "
+ WHERE user_id IN ($mark)";
+ $result = $db->sql_query($sql);
+
+ $user_affected = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $user_affected[] = $row['username'];
+ }
+ $db->sql_freeresult($result);
+
+ if ($action == 'activate')
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . ' SET user_type = ' . USER_NORMAL . " WHERE user_id IN ($mark)"
+ $db->sql_query($sql);
+ }
+ else if ($action == 'delete')
+ {
+ $sql = 'DELETE FROM ' . USER_GROUP_TABLE . " WHERE user_id IN ($mark)";
+ $db->sql_query($sql);
+ $sql = 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)";
+ $db->sql_query($sql);
+ }
- if (!$delete)
+ if ($action != 'delete')
{
set_config('num_users', $config['num_users'] + $db->sql_affectedrows(), true);
}
- $log_action = ($activate) ? 'log_index_activate' : 'log_index_delete';
- add_log('admin', $log_action, $db->sql_affectedrows());
+ add_log('admin', 'LOG_INDEX_' . strtoupper($action), implode(', ', $user_affected));
break;
case 'remind':
@@ -617,7 +638,7 @@ elseif ($pane == 'right')
}
-?><option value="delete"><?php echo $user->lang['DELETE']; ?></option> <input class="btnlite" type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;</td>
+?><option value="delete"><?php echo $user->lang['DELETE']; ?></option></select> <input class="btnlite" type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;</td>
</tr>
<?php
diff --git a/phpBB/adm/swatch.php b/phpBB/adm/swatch.php
index d11f2edd25..fe43870a3d 100644
--- a/phpBB/adm/swatch.php
+++ b/phpBB/adm/swatch.php
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
-<title>phpBB 2.2 Color Swatch</title>
+<title>phpBB3 Color Swatch</title>
<style type="text/css">
td {
@@ -37,17 +37,17 @@ td {
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
document.write('<td bgcolor="#' + color + '" onmouseover="this.className=\'over\'" onmouseout="this.className=\'out\'">');
- document.write('<a href="javascript:cell(\'' + color + '\');"><img src="../images/spacer.gif" width="15" height="12" border="0" alt="#' + color + '" title="#' + color + '" /></a>');
- document.writeln('</td>');
+ document.write('<a href="javascript:cell(\'' + color + '\');"><img src="../images/spacer.gif" width="15" height="12" border="0" alt="#' + color + '" title="#' + color + '" \/><\/a>');
+ document.writeln('<\/td>');
}
}
- document.writeln('</tr>');
+ document.writeln('<\/tr>');
}
- document.writeln('</table>');
+ document.writeln('<\/table>');
function cell(color)
{
- opener.document.forms['<?php echo htmlspecialchars(addslashes($_GET['form'])); ?>'].<?php echo htmlspecialchars(addslashes($_GET['name'])); ?>.value = '#' + color;
+ opener.document.forms['<?php echo htmlspecialchars(addslashes($_GET['form'])); ?>'].<?php echo htmlspecialchars(addslashes($_GET['name'])); ?>.value = color;
}
//-->
</script>