strnorm bits

This commit is contained in:
Shish 2011-01-22 15:51:55 +00:00
parent 141e8fa106
commit 3896c71a9a

View File

@ -594,8 +594,11 @@ class Image {
else if(count($tag_querylets) == 1 && $tag_querylets[0]->positive) {
$query = new Querylet($database->engine->scoreql_to_sql("
SELECT images.* FROM images
JOIN image_tags ON images.id = image_tags.image_id
WHERE tag_id = (SELECT tags.id FROM tags WHERE SCORE_STRNORM(tag) = SCORE_STRNORM(:tag))
WHERE images.id IN (
SELECT image_id FROM image_tags WHERE tag_id = (
SELECT tags.id FROM tags WHERE SCORE_STRNORM(tag) = SCORE_STRNORM(:tag)
)
)
"), array("tag"=>$tag_querylets[0]->tag));
if(strlen($img_search->sql) > 0) {
@ -898,7 +901,9 @@ class Tag {
assert(is_string($tag));
global $database;
$newtag = $database->get_one("SELECT newtag FROM aliases WHERE oldtag=:tag", array("tag"=>$tag));
$newtag = $database->get_one(
$database->engine->scoreql_to_sql("SELECT newtag FROM aliases WHERE SCORE_STRNORM(oldtag)=SCORE_STRNORM(:tag)"),
array("tag"=>$tag));
if(!empty($newtag)) {
return $newtag;
} else {