Merge pull request #720 from MetallicAchu/master

Added a new search criteria "fullrandom"
This commit is contained in:
Shish 2020-05-13 13:02:11 +01:00 committed by GitHub
commit f7c6b662cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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++;
}