diff --git a/data/help.md b/data/help.md index 6593e963..c5ff7830 100644 --- a/data/help.md +++ b/data/help.md @@ -40,6 +40,7 @@ All of the above can be sorted using additional sorting tags: - most commented first: [search]order:comments[/search] - loved by most: [search]order:favs[/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]. diff --git a/src/Models/Model_Post_QueryBuilder.php b/src/Models/Model_Post_QueryBuilder.php index fb11f624..29a242b9 100644 --- a/src/Models/Model_Post_QueryBuilder.php +++ b/src/Models/Model_Post_QueryBuilder.php @@ -303,7 +303,6 @@ class Model_Post_QueryBuilder implements AbstractQueryBuilder $orderColumn = 'fav_count'; break; case 'score': - $orderDir *= -1; $orderColumn = 'score'; break; case 'tag': @@ -397,9 +396,9 @@ class Model_Post_QueryBuilder implements AbstractQueryBuilder elseif ($key == 'order') { if ($neg) - $orderToken = $val; - else $orderToken = '-' . $val; + else + $orderToken = $val; } else