1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 03:34:04 +02:00

dumdidum... sorry. ;)

git-svn-id: file:///svn/phpbb/trunk@8147 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2007-10-05 14:36:34 +00:00
parent e6c79242e6
commit 7de5bb3498
77 changed files with 1052 additions and 570 deletions

View File

@@ -1,13 +1,21 @@
<?php
/**
/**
*
* @package acp
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* @package acp
*/
@@ -51,7 +59,7 @@ class acp_bots
{
$sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')';
$sql = 'UPDATE ' . BOTS_TABLE . "
$sql = 'UPDATE ' . BOTS_TABLE . "
SET bot_active = 1
WHERE bot_id $sql_id";
$db->sql_query($sql);
@@ -65,7 +73,7 @@ class acp_bots
{
$sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')';
$sql = 'UPDATE ' . BOTS_TABLE . "
$sql = 'UPDATE ' . BOTS_TABLE . "
SET bot_active = 0
WHERE bot_id $sql_id";
$db->sql_query($sql);
@@ -82,8 +90,8 @@ class acp_bots
// We need to delete the relevant user, usergroup and bot entries ...
$sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')';
$sql = 'SELECT bot_name, user_id
FROM ' . BOTS_TABLE . "
$sql = 'SELECT bot_name, user_id
FROM ' . BOTS_TABLE . "
WHERE bot_id $sql_id";
$result = $db->sql_query($sql);
@@ -97,7 +105,7 @@ class acp_bots
$db->sql_transaction('begin');
$sql = 'DELETE FROM ' . BOTS_TABLE . "
$sql = 'DELETE FROM ' . BOTS_TABLE . "
WHERE bot_id $sql_id";
$db->sql_query($sql);
@@ -200,9 +208,9 @@ class acp_bots
// New bot? Create a new user and group entry
if ($action == 'add')
{
$sql = 'SELECT group_id, group_colour
FROM ' . GROUPS_TABLE . "
WHERE group_name = 'BOTS'
$sql = 'SELECT group_id, group_colour
FROM ' . GROUPS_TABLE . "
WHERE group_name = 'BOTS'
AND group_type = " . GROUP_SPECIAL;
$result = $db->sql_query($sql);
$group_row = $db->sql_fetchrow($result);
@@ -215,22 +223,22 @@ class acp_bots
$user_id = user_add(array(
'user_type' => (int) USER_IGNORE,
'group_id' => (int) $group_row['group_id'],
'username' => (string) $bot_row['bot_name'],
'user_type' => (int) USER_IGNORE,
'group_id' => (int) $group_row['group_id'],
'username' => (string) $bot_row['bot_name'],
'user_regdate' => time(),
'user_password' => '',
'user_colour' => (string) $group_row['group_colour'],
'user_email' => '',
'user_lang' => (string) $bot_row['bot_lang'],
'user_lang' => (string) $bot_row['bot_lang'],
'user_style' => (int) $bot_row['bot_style'],
'user_allow_massemail' => 0,
));
$sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' => (int) $user_id,
'bot_name' => (string) $bot_row['bot_name'],
'bot_active' => (int) $bot_row['bot_active'],
'bot_name' => (string) $bot_row['bot_name'],
'bot_active' => (int) $bot_row['bot_active'],
'bot_agent' => (string) $bot_row['bot_agent'],
'bot_ip' => (string) $bot_row['bot_ip'])
);
@@ -240,8 +248,8 @@ class acp_bots
}
else if ($bot_id)
{
$sql = 'SELECT user_id, bot_name
FROM ' . BOTS_TABLE . "
$sql = 'SELECT user_id, bot_name
FROM ' . BOTS_TABLE . "
WHERE bot_id = $bot_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -267,8 +275,8 @@ class acp_bots
$db->sql_query($sql);
$sql = 'UPDATE ' . BOTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
'bot_name' => (string) $bot_row['bot_name'],
'bot_active' => (int) $bot_row['bot_active'],
'bot_name' => (string) $bot_row['bot_name'],
'bot_active' => (int) $bot_row['bot_active'],
'bot_agent' => (string) $bot_row['bot_agent'],
'bot_ip' => (string) $bot_row['bot_ip'])
) . " WHERE bot_id = $bot_id";
@@ -292,7 +300,7 @@ class acp_bots
}
else if ($bot_id)
{
$sql = 'SELECT b.*, u.user_lang, u.user_style
$sql = 'SELECT b.*, u.user_lang, u.user_style
FROM ' . BOTS_TABLE . ' b, ' . USERS_TABLE . " u
WHERE b.bot_id = $bot_id
AND u.user_id = b.user_id";
@@ -358,7 +366,7 @@ class acp_bots
'S_BOT_OPTIONS' => $s_options)
);
$sql = 'SELECT b.bot_id, b.bot_name, b.bot_active, u.user_lastvisit
$sql = 'SELECT b.bot_id, b.bot_name, b.bot_active, u.user_lastvisit
FROM ' . BOTS_TABLE . ' b, ' . USERS_TABLE . ' u
WHERE u.user_id = b.user_id
ORDER BY u.user_lastvisit DESC, b.bot_name ASC';