From 58d146cac61a8c574346ee794a04bdfeaab9215d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 2 Oct 2005 18:15:12 +0000 Subject: - move some functions from global functions file to functions_display (those only needed in posting and viewtopic/forum) git-svn-id: file:///svn/phpbb/trunk@5240 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acm/acm_main.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acm') diff --git a/phpBB/includes/acm/acm_main.php b/phpBB/includes/acm/acm_main.php index b174dab92b..bdb8189bd7 100644 --- a/phpBB/includes/acm/acm_main.php +++ b/phpBB/includes/acm/acm_main.php @@ -273,9 +273,24 @@ class cache extends acm } else { - $sql = 'SELECT user_id, bot_agent, bot_ip - FROM ' . BOTS_TABLE . ' - WHERE bot_active = 1'; + switch (SQL_LAYER) + { + case 'mssql': + case 'mssql_odbc': + $sql = 'SELECT user_id, bot_agent, bot_ip + FROM ' . BOTS_TABLE . ' + WHERE bot_active = 1 + ORDER BY LEN(bot_agent) DESC'; + break; + + // LENGTH supported by MySQL, IBM DB2 and Oracle for sure... + default: + $sql = 'SELECT user_id, bot_agent, bot_ip + FROM ' . BOTS_TABLE . ' + WHERE bot_active = 1 + ORDER BY LENGTH(bot_agent) DESC'; + break; + } $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) -- cgit v1.2.1