From 10d46395d75eea10aff41ccad732d0b7b2c2acbc Mon Sep 17 00:00:00 2001 From: MetallicAchu <40928922+MetallicAchu@users.noreply.github.com> Date: Thu, 7 May 2020 08:10:15 +0300 Subject: [PATCH] Update main.php Added order[=|:]fullrandom so user doesn't need to choose a new seed every time. Thus the list will change on a daily basis without user interaction, giving a more dynamic feel to the website --- ext/index/main.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/index/main.php b/ext/index/main.php index f1500412..0ab9ed67 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -250,7 +250,15 @@ class Index extends Extension $seed = $matches[1]; Image::$order_sql = "RAND($seed)"; $event->add_querylet(new Querylet("1=1")); //small hack to avoid metatag being treated as normal tag - } + } elseif (preg_match("/^order[=|:]fullrandom$/i", $event->term, $matches)) { + //order[=|:]fullrandom will use today's date as seed, thus allowing for a dynamic randomized list without outside intervention. + //This way the list will change every day, giving a more dynamic feel to the imageboard. + //recommended to change homepage to "post/list/order:fullrandom/1" + $seed = date("Ymd"); + Image::$order_sql = "RAND($seed)"; + $event->add_querylet(new Querylet("1=1")); + } + //fullrandom is new $this->stpen++; }