diff --git a/core/database.class.php b/core/database.class.php index 69d54e9e..53ed4b4d 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -75,6 +75,7 @@ class MySQL extends DBEngine { $data = str_replace("SCORE_DATETIME", "DATETIME", $data); $data = str_replace("SCORE_NOW", "\"1970-01-01\"", $data); $data = str_replace("SCORE_STRNORM", "", $data); + $data = str_replace("SCORE_ILIKE", "LIKE", $data); return $data; } @@ -96,6 +97,7 @@ class PostgreSQL extends DBEngine { $data = str_replace("SCORE_DATETIME", "TIMESTAMP", $data); $data = str_replace("SCORE_NOW", "current_time", $data); $data = str_replace("SCORE_STRNORM", "lower", $data); + $data = str_replace("SCORE_ILIKE", "ILIKE", $data); return $data; } @@ -142,6 +144,7 @@ class SQLite extends DBEngine { $data = str_replace("SCORE_BOOL", "CHAR(1)", $data); $data = str_replace("SCORE_NOW", "\"1970-01-01\"", $data); $data = str_replace("SCORE_STRNORM", "", $data); + $data = str_replace("SCORE_ILIKE", "LIKE", $data); $cols = array(); $extras = ""; foreach(explode(",", $data) as $bit) { diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index dcdf3b2c..1e71be3b 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -141,7 +141,7 @@ class TagList implements Extension { $tag_data = $database->get_col(" SELECT DISTINCT - substr(tag, 1, 1) + SCORE_STRNORM(substr(tag, 1, 1)) FROM tags WHERE count >= :tags_min ORDER BY tag @@ -183,7 +183,7 @@ class TagList implements Extension { FLOOR(LOG(2.7, LOG(2.7, count - :tags_min + 1)+1)*1.5*100)/100 AS scaled FROM tags WHERE count >= :tags_min - AND tag LIKE :starts_with + AND tag SCORE_ILIKE :starts_with ORDER BY tag ", array("tags_min"=>$tags_min, "starts_with"=>$starts_with)); @@ -215,7 +215,7 @@ class TagList implements Extension { SELECT tag, count FROM tags WHERE count >= :tags_min - AND tag LIKE :starts_with + AND tag SCORE_ILIKE :starts_with ORDER BY tag ", array("tags_min"=>$tags_min, "starts_with"=>$starts_with));