aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/session.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2005-05-05 16:55:05 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2005-05-05 16:55:05 +0000
commitb576d6af0a9c0c78f379ca09069648d87364e1a0 (patch)
treeeb73ff0919d865a420a2dd4cc71409f59da76ebd /phpBB/includes/session.php
parent16e50db4baf39877fe3e02a13dfc57983b12f414 (diff)
downloadforums-b576d6af0a9c0c78f379ca09069648d87364e1a0.tar
forums-b576d6af0a9c0c78f379ca09069648d87364e1a0.tar.gz
forums-b576d6af0a9c0c78f379ca09069648d87364e1a0.tar.bz2
forums-b576d6af0a9c0c78f379ca09069648d87364e1a0.tar.xz
forums-b576d6af0a9c0c78f379ca09069648d87364e1a0.zip
- some cross-db related changes
- putting active bots array into cache git-svn-id: file:///svn/phpbb/trunk@5140 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r--phpBB/includes/session.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 768f1dddd1..c85fa7a393 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -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);