From 505c8155e25ac7b4cccdd2fd5bb8f5e073ee4198 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 6 May 2023 14:09:52 +0300 Subject: initial for random_order --- init.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.php b/init.php index 6312651..6397b5f 100644 --- a/init.php +++ b/init.php @@ -1,5 +1,5 @@ add_hook($host::HOOK_HEADLINES_CUSTOM_SORT_MAP, $this); @@ -8,13 +8,13 @@ class Scored_Oldest_First extends Plugin { function hook_headlines_custom_sort_map() { return [ - "dates_reverse_scored" => "Oldest first (with score)" + "random_order" => "Random" ]; } function hook_headlines_custom_sort_override($order) { - if ($order == "dates_reverse_scored") { - return [ "score DESC, updated", false ]; + if ($order == "random_order") { + return [ "RANDOM()", false ]; } else { return [ "", false ]; } @@ -22,7 +22,7 @@ class Scored_Oldest_First extends Plugin { function about() { return array(null, - "Consider article score while sorting by oldest first", + "Return headlines in random order", "fox", false, ""); -- cgit v1.2.3