Search queries: fixed broken order

This commit is contained in:
Marcin Kurczewski 2013-11-21 23:19:07 +01:00
parent 9c0ed1e930
commit 6e62a46110
2 changed files with 3 additions and 3 deletions

View file

@ -40,6 +40,7 @@ All of the above can be sorted using additional sorting tags:
- most commented first: [search]order:comments[/search] - most commented first: [search]order:comments[/search]
- loved by most: [search]order:favs[/search] - loved by most: [search]order:favs[/search]
- highest scored: [search]order:score[/search] - highest scored: [search]order:score[/search]
- with most tags: [search]order:tags[/search]
As shown with [search]-order:date[/search], any of them can be reversed in the same way as negating other tags: by placing a dash before the tag. If there is a "min" tag, there’s also its "max" counterpart, e.g. [search]favmax:7[/search]. As shown with [search]-order:date[/search], any of them can be reversed in the same way as negating other tags: by placing a dash before the tag. If there is a "min" tag, there’s also its "max" counterpart, e.g. [search]favmax:7[/search].

View file

@ -303,7 +303,6 @@ class Model_Post_QueryBuilder implements AbstractQueryBuilder
$orderColumn = 'fav_count'; $orderColumn = 'fav_count';
break; break;
case 'score': case 'score':
$orderDir *= -1;
$orderColumn = 'score'; $orderColumn = 'score';
break; break;
case 'tag': case 'tag':
@ -397,9 +396,9 @@ class Model_Post_QueryBuilder implements AbstractQueryBuilder
elseif ($key == 'order') elseif ($key == 'order')
{ {
if ($neg) if ($neg)
$orderToken = $val;
else
$orderToken = '-' . $val; $orderToken = '-' . $val;
else
$orderToken = $val;
} }
else else