Feature #728
Search Extend: Comments
| Status: | Closed | Start: | 08/02/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | default extensions | |||
| Target version: | 2.3 | |||
Description
in ext\comment\main.php between line 156 and 157 add
if(is_a($event, 'SearchTermParseEvent')) {
$matches = array();
if(preg_match("/comments(<|>|<=|>=|=)(\d+)/", $event->term, $matches)) {
$cmp = $matches[1];
$comments = $matches[2];
$event->add_querylet(new Querylet("images.id IN (SELECT DISTINCT image_id FROM comments GROUP BY image_id HAVING count(image_id) $cmp $comments)"));
}
else if(preg_match("/commented_by=(.*)/i", $event->term, $matches)) {
global $database;
$user = User::by_name($matches[1]);
if(!is_null($user)) {
$user_id = $user->id;
}
else {
$user_id = -1;
}
$event->add_querylet(new Querylet("images.id IN (SELECT image_id FROM comments WHERE owner_id = $user_id)"));
}
else if(preg_match("/commented_by_userid=([0-9]+)/i", $event->term, $matches)) {
$user_id = int_escape($matches[1]);
$event->add_querylet(new Querylet("images.id IN (SELECT image_id FROM comments WHERE owner_id = $user_id)"));
}
}
Tell me the truth shish...you hate me :P jejeje
History
Updated by Shish Moom 109 days ago
added in db7708b6
Tell me the truth shish...you hate me :P jejeje
I do really want to get the 2.3 issue list empty; but when an issue is easy to fix or comes with a patch, that makes things better without taking lots of time \o/