From: Alexander Ebert Date: Mon, 9 Jul 2018 15:52:43 +0000 (+0200) Subject: Support for random order in article list boxes X-Git-Tag: 5.2.0_Alpha_1~364^2~132 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b007f09506dd21ac7728f7f71c43ee6eed36aa17;p=GitHub%2FWoltLab%2FWCF.git Support for random order in article list boxes See #2592 --- diff --git a/wcfsetup/install/files/lib/system/box/ArticleListBoxController.class.php b/wcfsetup/install/files/lib/system/box/ArticleListBoxController.class.php index 86c7c8a45a..5816a6b4a7 100644 --- a/wcfsetup/install/files/lib/system/box/ArticleListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/ArticleListBoxController.class.php @@ -40,7 +40,8 @@ class ArticleListBoxController extends AbstractDatabaseObjectListBoxController { public $validSortFields = [ 'time', 'comments', - 'views' + 'views', + 'random' ]; /** @@ -69,6 +70,10 @@ class ArticleListBoxController extends AbstractDatabaseObjectListBoxController { break; } + if ($this->sortField === 'random') { + $this->sortField = 'RAND()'; + } + return $objectList; } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 2374b15c71..0cc4b527b8 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2342,6 +2342,7 @@ Benutzerkontos nun in vollem Umfang nutzen.]]> + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 577a961cc3..6c66d6e6f4 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2278,6 +2278,7 @@ full extend.]]> +