randomized sort order of related articles
authorMarcel Werk <burntime@woltlab.com>
Mon, 23 Nov 2020 14:19:48 +0000 (15:19 +0100)
committerMarcel Werk <burntime@woltlab.com>
Mon, 23 Nov 2020 14:19:48 +0000 (15:19 +0100)
wcfsetup/install/files/lib/page/AbstractArticlePage.class.php

index 3b364bbc5cc3cd7ab4f0339ad407b5d7dc24d31d..8f007ad0dce63f0e84cac95996f88325ae8af5f3 100644 (file)
@@ -150,7 +150,7 @@ abstract class AbstractArticlePage extends AbstractPage {
                                        " . $conditionBuilder . "
                                        GROUP BY        tag_to_object.objectID
                                        HAVING          COUNT(*) >= " . round(count($this->tags) * ARTICLE_RELATED_ARTICLES_MATCH_THRESHOLD / 100) . "
-                                       ORDER BY        count DESC, MAX(article.time) DESC";
+                                       ORDER BY        count DESC, RAND()";
                                $statement = WCF::getDB()->prepareStatement($sql, ARTICLE_RELATED_ARTICLES);
                                $statement->execute($conditionBuilder->getParameters());
                                $articleIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);