Type: Functional upgrading Software: shimmie2 Module: comments Reference: http://trac.shishnet.org/shimmie2/browser/branches/branch_2.2/ext/comment/main.php Verified: Yes Solved: Yes Official res.: Unknown Author: Daniel Marschall Date: 2008-10-19 Why not adding some search term features? I have added the following search terms: - "comments" - "commented_by" - "commented_by_userno" ("userno" because if the search term would be "...userid" or "...user_id", then the board would think that "id=..." was asked; this is also something that should be changed by improving the regular expressions) ~ ext/comment/main.php # Find event condition if(is_a($event, 'SetupBuildingEvent')) { # Add after this if(is_a($event, 'SearchTermParseEvent')) { $matches = array(); if(preg_match("/comments(<|>|<=|>=|=)(\d+)/", $event->term, $matches)) { $cmp = $matches[1]; $comments = $matches[2]; $event->set_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 = $database->get_user_by_name($matches[1]); if(!is_null($user)) { $user_id = $user->id; } else { $user_id = -1; } $event->set_querylet(new Querylet("images.id IN (SELECT image_id FROM comments WHERE owner_id = $user_id)")); } else if(preg_match("/commented_by_userno=([0-9]+)/i", $event->term, $matches)) { $user_id = int_escape($matches[1]); $event->set_querylet(new Querylet("images.id IN (SELECT image_id FROM comments WHERE owner_id = $user_id)")); } } # Line 146