search by hash, from artanis

git-svn-id: file:///home/shish/svn/shimmie2/trunk@162 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-06-25 16:40:47 +00:00
parent baf57f5c74
commit f25ed214c6

View file

@ -132,6 +132,12 @@ class Database {
}
$img_search->append(new Querylet("AND (owner_id = $user_id)"));
}
else if(preg_match("/hash=([0-9a-fA-F]*)/i",$term,$matches)) {
$hash = strtolower($matches[1]);
if(!is_null($hash)) {
$img_search->append(new Querylet("AND (hash = '$hash')"));
}
}
else {
$term = str_replace("*", "%", $term);
$term = str_replace("?", "_", $term);