From 9f595e62734a6f9ef247067d31145b4a7f20619c Mon Sep 17 00:00:00 2001 From: shish Date: Tue, 8 Apr 2008 17:16:56 +0000 Subject: [PATCH] backport git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.2@788 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/numeric_score/main.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/numeric_score/main.php b/contrib/numeric_score/main.php index ce227028..d5c30396 100644 --- a/contrib/numeric_score/main.php +++ b/contrib/numeric_score/main.php @@ -59,6 +59,15 @@ class NumericScore extends Extension { if(is_a($event, 'ParseLinkTemplateEvent')) { $event->replace('$score', $event->image->numeric_score); } + + if(is_a($event, 'SearchTermParseEvent')) { + $matches = array(); + if(preg_match("/score(<|=|>)(\d+)/", $event->term, $matches)) { + $cmp = $matches[1]; + $score = $matches[2]; + $event->set_querylet(new Querylet("AND (numeric_score $cmp $score)")); + } + } } private function install() {