From c486fe279c472394e82fa2d4b84d73e97d137d3c Mon Sep 17 00:00:00 2001 From: shish Date: Fri, 18 May 2007 01:12:50 +0000 Subject: [PATCH] search by poster name git-svn-id: file:///home/shish/svn/shimmie2/trunk@118 7f39781d-f577-437e-ae19-be835c7a54ca --- core/database.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/database.class.php b/core/database.class.php index 39187e4a..7e28e21f 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -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);