search by poster name

git-svn-id: file:///home/shish/svn/shimmie2/trunk@118 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-05-18 01:12:50 +00:00
parent 0c30124dbd
commit c486fe279c

View file

@ -121,6 +121,17 @@ class Database {
$val = parse_shorthand_int($matches[3]);
$img_search->append(new Querylet("AND ($col $cmp $val)"));
}
else if(preg_match("/poster=(.*)/i", $term, $matches)) {
global $database;
$user = $database->get_user_by_name($matches[1]);
if(!is_null($user)) {
$user_id = $user->id;
}
else {
$user_id = -1;
}
$img_search->append(new Querylet("AND (owner_id = $user_id)"));
}
else {
$term = str_replace("*", "%", $term);
$term = str_replace("?", "_", $term);