case sensitivity blargh

This commit is contained in:
Shish 2012-01-01 17:13:50 +00:00
parent 0c96603861
commit 5b717870d1
2 changed files with 14 additions and 15 deletions

View File

@ -204,6 +204,10 @@ function make_link($page=null, $query=null) {
* @retval string * @retval string
*/ */
function modify_current_url($changes) { function modify_current_url($changes) {
return modify_url($_SERVER['QUERY_STRING'], $changes);
}
function modify_url($url, $changes) {
// SHIT: PHP is officially the worst web API ever because it does not // SHIT: PHP is officially the worst web API ever because it does not
// have a built-in function to do this. // have a built-in function to do this.
@ -212,7 +216,7 @@ function modify_current_url($changes) {
// whatever data the user supplied. Thankfully, 4.0.3 added an extra option to // whatever data the user supplied. Thankfully, 4.0.3 added an extra option to
// give it an array to use... // give it an array to use...
$params = array(); $params = array();
parse_str($_SERVER['QUERY_STRING'], $params); parse_str($url, $params);
if(isset($changes['q'])) { if(isset($changes['q'])) {
$base = $changes['q']; $base = $changes['q'];

View File

@ -136,16 +136,13 @@ class TagList implements Extension {
$tags_min = $this->get_tags_min(); $tags_min = $this->get_tags_min();
$cache_key = "data/tag_inits-" . md5("tc" . $tags_min) . ".html"; $tag_data = $database->get_col($database->engine->scoreql_to_sql("
if(file_exists($cache_key)) {return file_get_contents($cache_key);}
$tag_data = $database->get_col("
SELECT DISTINCT SELECT DISTINCT
SCORE_STRNORM(substr(tag, 1, 1)) SCORE_STRNORM(substr(tag, 1, 1))
FROM tags FROM tags
WHERE count >= :tags_min WHERE count >= :tags_min
ORDER BY substr(tag, 1, 1) ORDER BY SCORE_STRNORM(substr(tag, 1, 1))
", array("tags_min"=>$tags_min)); "), array("tags_min"=>$tags_min));
$html = ""; $html = "";
foreach($tag_data as $a) { foreach($tag_data as $a) {
@ -153,8 +150,6 @@ class TagList implements Extension {
} }
$html .= "<p><hr>"; $html .= "<p><hr>";
if(SPEED_HAX) {file_put_contents($cache_key, $html);}
return $html; return $html;
} }
// }}} // }}}
@ -178,15 +173,15 @@ class TagList implements Extension {
if(file_exists($cache_key)) {return file_get_contents($cache_key);} if(file_exists($cache_key)) {return file_get_contents($cache_key);}
// SHIT: PDO/pgsql has problems using the same named param twice -_-;; // SHIT: PDO/pgsql has problems using the same named param twice -_-;;
$tag_data = $database->get_all(" $tag_data = $database->get_all($database->engine->scoreql_to_sql("
SELECT SELECT
tag, tag,
FLOOR(LOG(2.7, LOG(2.7, count - :tags_min2 + 1)+1)*1.5*100)/100 AS scaled FLOOR(LOG(2.7, LOG(2.7, count - :tags_min2 + 1)+1)*1.5*100)/100 AS scaled
FROM tags FROM tags
WHERE count >= :tags_min WHERE count >= :tags_min
AND tag SCORE_ILIKE :starts_with AND tag SCORE_ILIKE :starts_with
ORDER BY tag ORDER BY SCORE_STRNORM(tag)
", array("tags_min"=>$tags_min, "tags_min2"=>$tags_min, "starts_with"=>$starts_with)); "), array("tags_min"=>$tags_min, "tags_min2"=>$tags_min, "starts_with"=>$starts_with));
$html = ""; $html = "";
if($config->get_bool("tag_list_pages")) $html .= $this->build_az(); if($config->get_bool("tag_list_pages")) $html .= $this->build_az();
@ -212,13 +207,13 @@ class TagList implements Extension {
$cache_key = "data/tag_alpha-" . md5("ta" . $tags_min . $starts_with) . ".html"; $cache_key = "data/tag_alpha-" . md5("ta" . $tags_min . $starts_with) . ".html";
if(file_exists($cache_key)) {return file_get_contents($cache_key);} if(file_exists($cache_key)) {return file_get_contents($cache_key);}
$tag_data = $database->get_all(" $tag_data = $database->get_all($database->engine->scoreql_to_sql("
SELECT tag, count SELECT tag, count
FROM tags FROM tags
WHERE count >= :tags_min WHERE count >= :tags_min
AND tag SCORE_ILIKE :starts_with AND tag SCORE_ILIKE :starts_with
ORDER BY tag ORDER BY SCORE_STRNORM(tag)
", array("tags_min"=>$tags_min, "starts_with"=>$starts_with)); "), array("tags_min"=>$tags_min, "starts_with"=>$starts_with));
$html = ""; $html = "";
if($config->get_bool("tag_list_pages")) $html .= $this->build_az(); if($config->get_bool("tag_list_pages")) $html .= $this->build_az();