count pages by the aliased-to tag, not what the user typed

This commit is contained in:
Shish 2012-02-12 07:30:16 +00:00
parent 4133c72727
commit edbb8943d2

View file

@ -157,9 +157,10 @@ class Image {
return $total; return $total;
} }
else if(count($tags) == 1 && !preg_match("/[:=><]/", $tags[0])) { else if(count($tags) == 1 && !preg_match("/[:=><]/", $tags[0])) {
$term = Tag::resolve_alias($tags[0]);
return $database->get_one( return $database->get_one(
$database->engine->scoreql_to_sql("SELECT count FROM tags WHERE SCORE_STRNORM(tag) = SCORE_STRNORM(:tag)"), $database->engine->scoreql_to_sql("SELECT count FROM tags WHERE SCORE_STRNORM(tag) = SCORE_STRNORM(:tag)"),
array("tag"=>$tags[0])); array("tag"=>$term));
} }
else { else {
$querylet = Image::build_search_querylet($tags); $querylet = Image::build_search_querylet($tags);