s/fullrandom/dailyshuffle/, and run formatter
This commit is contained in:
parent
f7c6b662cd
commit
1e76fb239e
@ -245,20 +245,19 @@ class Index extends Extension
|
|||||||
Image::$order_sql = "images.$ord $sort";
|
Image::$order_sql = "images.$ord $sort";
|
||||||
$event->add_querylet(new Querylet("1=1")); //small hack to avoid metatag being treated as normal tag
|
$event->add_querylet(new Querylet("1=1")); //small hack to avoid metatag being treated as normal tag
|
||||||
} elseif (preg_match("/^order[=|:]random[_]([0-9]{1,4})$/i", $event->term, $matches)) {
|
} elseif (preg_match("/^order[=|:]random[_]([0-9]{1,4})$/i", $event->term, $matches)) {
|
||||||
//order[=|:]random requires a seed to avoid duplicates
|
// requires a seed to avoid duplicates
|
||||||
//since the tag can't be changed during the parseevent, we instead generate the seed during submit using js
|
// since the tag can't be changed during the parseevent, we instead generate the seed during submit using js
|
||||||
$seed = $matches[1];
|
$seed = $matches[1];
|
||||||
Image::$order_sql = "RAND($seed)";
|
Image::$order_sql = "RAND($seed)";
|
||||||
$event->add_querylet(new Querylet("1=1")); //small hack to avoid metatag being treated as normal tag
|
$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)) {
|
} elseif (preg_match("/^order[=|:]dailyshuffle$/i", $event->term, $matches)) {
|
||||||
//order[=|:]fullrandom will use today's date as seed, thus allowing for a dynamic randomized list without outside intervention.
|
// 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.
|
// 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"
|
// recommended to change homepage to "post/list/order:dailyshuffle/1"
|
||||||
$seed = date("Ymd");
|
$seed = date("Ymd");
|
||||||
Image::$order_sql = "RAND($seed)";
|
Image::$order_sql = "RAND($seed)";
|
||||||
$event->add_querylet(new Querylet("1=1"));
|
$event->add_querylet(new Querylet("1=1"));
|
||||||
}
|
}
|
||||||
//fullrandom is new
|
|
||||||
|
|
||||||
$this->stpen++;
|
$this->stpen++;
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ class Upload extends Extension
|
|||||||
if ($this->is_full) {
|
if ($this->is_full) {
|
||||||
throw new UploadException("Can not replace Image: disk nearly full");
|
throw new UploadException("Can not replace Image: disk nearly full");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to get the image ID
|
// Try to get the image ID
|
||||||
if ($event->count_args() >= 1) {
|
if ($event->count_args() >= 1) {
|
||||||
$image_id = int_escape($event->get_arg(0));
|
$image_id = int_escape($event->get_arg(0));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user