search votes by IDs, in case of username weirdness
This commit is contained in:
parent
278b2ef510
commit
7f741f6b99
@ -91,6 +91,18 @@ class NumericScore implements Extension {
|
||||
"images.id in (SELECT image_id FROM numeric_score_votes WHERE user_id=? AND score=-1)",
|
||||
array($duser->id)));
|
||||
}
|
||||
if(preg_match("/^upvoted_by_id=(\d+)$/", $event->term, $matches)) {
|
||||
$iid = int_escape($matches[1]);
|
||||
$event->add_querylet(new Querylet(
|
||||
"images.id in (SELECT image_id FROM numeric_score_votes WHERE user_id=? AND score=1)",
|
||||
array($iid)));
|
||||
}
|
||||
if(preg_match("/^downvoted_by_id=(\d+)$/", $event->term, $matches)) {
|
||||
$iid = int_escape($matches[1]);
|
||||
$event->add_querylet(new Querylet(
|
||||
"images.id in (SELECT image_id FROM numeric_score_votes WHERE user_id=? AND score=-1)",
|
||||
array($iid)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user