make search by favourite count work

This commit is contained in:
Shish 2009-07-30 03:27:40 +01:00
parent a3f57c8fd6
commit 33a7fde1a4

View File

@ -95,7 +95,7 @@ class Favorites extends SimpleExtension {
if(preg_match("/favorites(<|>|<=|>=|=)(\d+)/", $event->term, $matches)) {
$cmp = $matches[1];
$favorites = $matches[2];
$event->set_querylet(new Querylet("favorites $cmp $favorites"));
$event->add_querylet(new Querylet("images.id IN (SELECT id FROM images WHERE favorites $cmp $favorites)"));
}
else if(preg_match("/favorited_by=(.*)/i", $event->term, $matches)) {
global $database;