From af738dbc2a48713f59779410955282aa5760b741 Mon Sep 17 00:00:00 2001 From: David M Date: Fri, 4 Jan 2008 18:35:49 +0000 Subject: Ch-ch-ch-changes - Made us more DB independent by making many queries capability based instead of DB specific - Finished PHP5ifying of the acm_file class, now with some (hopefully) enhancements to its performance - Sped up viewforum considerably (also goes towards mcp_forum) I really hope I didn't explode CVS... git-svn-id: file:///svn/phpbb/trunk@8301 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/message_parser.php | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'phpBB/includes/message_parser.php') diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 6e601e1499..82755b1f15 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1251,28 +1251,10 @@ class parse_message extends bbcode_firstpass // NOTE: obtain_* function? chaching the table contents? // For now setting the ttl to 10 minutes - switch ($db->sql_layer) - { - case 'mssql': - case 'mssql_odbc': - $sql = 'SELECT * - FROM ' . SMILIES_TABLE . ' - ORDER BY LEN(code) DESC'; - break; - - case 'firebird': - $sql = 'SELECT * - FROM ' . SMILIES_TABLE . ' - ORDER BY CHAR_LENGTH(code) DESC'; - break; - - // LENGTH supported by MySQL, IBM DB2, Oracle and Access for sure... - default: - $sql = 'SELECT * - FROM ' . SMILIES_TABLE . ' - ORDER BY LENGTH(code) DESC'; - break; - } + $sql = 'SELECT * + FROM ' . SMILIES_TABLE . ' + ORDER BY ' . $db->sql_function('length_varchar', 'code') . ' DESC'; + $result = $db->sql_query($sql, 600); while ($row = $db->sql_fetchrow($result)) -- cgit v1.2.1