Added order:time support to post searching

This commit is contained in:
Marcin Kurczewski 2014-09-30 15:07:52 +02:00
parent 57dc7c5fad
commit ac78f3b4b8
3 changed files with 4 additions and 1 deletions

1
TODO
View file

@ -25,7 +25,6 @@ everything related to posts:
- special:disliked - special:disliked
- special:fav - special:fav
- search order - search order
- order:time
- order:comment_count - order:comment_count
- order:comment_time - order:comment_time
- order:file_size - order:file_size

View file

@ -8,6 +8,7 @@ class PostFilter extends BasicFilter implements IFilter
const ORDER_FAV_COUNT = 'favCount'; const ORDER_FAV_COUNT = 'favCount';
const ORDER_TAG_COUNT = 'tagCount'; const ORDER_TAG_COUNT = 'tagCount';
const ORDER_SCORE = 'score'; const ORDER_SCORE = 'score';
const ORDER_LAST_EDIT_TIME = 'lastEditTime';
const REQUIREMENT_TAG = 'tag'; const REQUIREMENT_TAG = 'tag';
const REQUIREMENT_ID = 'id'; const REQUIREMENT_ID = 'id';

View file

@ -46,6 +46,9 @@ class PostSearchParser extends AbstractSearchParser
elseif ($token === 'tag_count') elseif ($token === 'tag_count')
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_TAG_COUNT; return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_TAG_COUNT;
elseif ($token === 'time')
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_LAST_EDIT_TIME;
elseif ($token === 'score') elseif ($token === 'score')
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_SCORE; return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_SCORE;