1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-10-29 06:26:22 +01:00

- some cross-db related changes

- putting active bots array into cache


git-svn-id: file:///svn/phpbb/trunk@5140 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2005-05-05 16:55:05 +00:00
parent 16e50db4ba
commit b576d6af0a
11 changed files with 206 additions and 120 deletions

View File

@@ -138,12 +138,10 @@ class session
$bot = false;
// Pull bot information from DB and loop through it
$sql = 'SELECT user_id, bot_agent, bot_ip
FROM ' . BOTS_TABLE . '
WHERE bot_active = 1';
$result = $db->sql_query($sql);
$active_bots = array();
obtain_bots($active_bots);
while ($row = $db->sql_fetchrow($result))
foreach ($active_bots as $row)
{
if ($row['bot_agent'] && preg_match('#' . preg_quote($row['bot_agent'], '#') . '#i', $this->browser))
{
@@ -168,7 +166,6 @@ class session
break;
}
}
$db->sql_freeresult($result);
// Garbage collection ... remove old sessions updating user information
// if necessary. It means (potentially) 11 queries but only infrequently
@@ -586,7 +583,7 @@ class user extends session
$style = ($style) ? $style : ((!$config['override_user_style'] && $this->data['user_id'] != ANONYMOUS) ? $this->data['user_style'] : $config['default_style']);
}
// TODO: DISTINCT making problems with DBMS not able to distinct TEXT fields
// TODO: DISTINCT making problems with DBMS not able to distinct TEXT fields, test grouping
switch (SQL_LAYER)
{
case 'mssql':
@@ -596,16 +593,18 @@ class user extends session
WHERE s.style_id IN ($style, " . $config['default_style'] . ')
AND t.template_id = s.template_id
AND c.theme_id = s.theme_id
AND i.imageset_id = s.imageset_id';
AND i.imageset_id = s.imageset_id
GROUP BY s.style_id';
break;
default:
$sql = 'SELECT DISTINCT s.style_id, t.*, c.*, i.*
$sql = 'SELECT s.style_id, t.*, c.*, i.*
FROM ' . STYLES_TABLE . ' s, ' . STYLES_TPL_TABLE . ' t, ' . STYLES_CSS_TABLE . ' c, ' . STYLES_IMAGE_TABLE . " i
WHERE s.style_id IN ($style, " . $config['default_style'] . ')
AND t.template_id = s.template_id
AND c.theme_id = s.theme_id
AND i.imageset_id = s.imageset_id';
AND i.imageset_id = s.imageset_id
GROUP BY s.style_id';
break;
}
$result = $db->sql_query($sql, 3600);