diff --git a/ext/index/main.php b/ext/index/main.php
index f7018512..255bbcfc 100644
--- a/ext/index/main.php
+++ b/ext/index/main.php
@@ -109,6 +109,7 @@
*
downvoted_by=Username -- search for a user's dislikes
* upvoted_by_id=UserID -- search for a user's likes by user ID
* downvoted_by_id=UserID -- search for a user's dislikes by user ID
+ * order=score_(ASC, DESC) -- find all images sorted from by score
*
* Image Rating
*
diff --git a/ext/numeric_score/main.php b/ext/numeric_score/main.php
index 70c18061..0c146890 100644
--- a/ext/numeric_score/main.php
+++ b/ext/numeric_score/main.php
@@ -254,6 +254,13 @@ class NumericScore extends Extension {
"images.id in (SELECT image_id FROM numeric_score_votes WHERE user_id=:ns_user_id AND score=-1)",
array("ns_user_id"=>$iid)));
}
+ else if(preg_match("/^order[=|:](numeric_)?(score)[_]?(desc|asc)?$/i", $event->term, $matches)){
+ global $order_sql;
+ $default_order_for_column = "DESC";
+ $sort = isset($matches[3]) ? strtoupper($matches[3]) : $default_order_for_column;
+ $order_sql = "numeric_score $sort";
+ $event->add_querylet(new Querylet("1=1")); //small hack to avoid metatag being treated as normal tag
+ }
}
private function install() {