optional setting to set pool order with the pool metatag

example: pool:10:3 (pool #10 with order 3)
This commit is contained in:
Daku 2014-05-08 20:32:02 +01:00
parent 77769d2c17
commit df6b9245ec

View File

@ -325,7 +325,7 @@ class Pools extends Extension {
public function onTagTermParse(TagTermParseEvent $event) {
$matches = array();
if(preg_match("/^pool[=|:](.*)$/i", $event->term, $matches)) {
if(preg_match("/^pool[=|:]([^:]*):?([0-9]*)$/i", $event->term, $matches)) {
global $user;
$poolTag = (string) str_replace("_", " ", $matches[1]);
@ -337,7 +337,8 @@ class Pools extends Extension {
}
if($pool ? $this->have_permission($user, $pool) : FALSE){
$this->add_post($pool['id'], $event->id, true);
$image_order = ($matches[2] ?: 0);
$this->add_post($pool['id'], $event->id, true, $image_order);
}
}