Fixed small postgresql issue
authorMarcel Werk <burntime@woltlab.com>
Tue, 26 Jun 2012 13:43:37 +0000 (15:43 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 26 Jun 2012 13:43:37 +0000 (15:43 +0200)
wcfsetup/install/files/lib/acp/page/IndexPage.class.php

index 354d40ad2a759bfc41d31117ed77161afd83b850..a7f180ff60e221d08b55f57b96d394995692795d 100755 (executable)
@@ -95,14 +95,10 @@ class IndexPage extends AbstractPage {
                
                $this->calculateHealth();
                
-               $sql = "SELECT
-                               languageItem
-                       FROM
-                               wcf".WCF_N."_language_item
-                       WHERE
-                               languageCategoryID = ?
-                       ORDER BY
-                               rand()";
+               $sql = "SELECT          languageItem
+                       FROM            wcf".WCF_N."_language_item
+                       WHERE           languageCategoryID = ?
+                       ORDER BY        ".(WCF::getDB()->getDBType() == 'wcf\system\database\PostgreSQLDatabase' ? 'RANDOM()' : 'RAND()');
                $statement = WCF::getDB()->prepareStatement($sql, 1);
                // TODO: Change category
                $statement->execute(array(LanguageFactory::getInstance()->getCategory('wcf.global')->languageCategoryID));