half support for caching giant tag maps
This commit is contained in:
parent
3d0cdfff56
commit
ae17700a30
@ -127,6 +127,10 @@ class TagList implements Extension {
|
|||||||
global $database;
|
global $database;
|
||||||
|
|
||||||
$tags_min = $this->get_tags_min();
|
$tags_min = $this->get_tags_min();
|
||||||
|
if(file_exists("data/tag_map_$tags_min.html")) {
|
||||||
|
return file_get_contents("data/tag_map_$tags_min.html");
|
||||||
|
}
|
||||||
|
|
||||||
$tag_data = $database->get_all("
|
$tag_data = $database->get_all("
|
||||||
SELECT
|
SELECT
|
||||||
tag,
|
tag,
|
||||||
@ -145,6 +149,8 @@ class TagList implements Extension {
|
|||||||
$h_tag_no_underscores = str_replace("_", " ", $h_tag);
|
$h_tag_no_underscores = str_replace("_", " ", $h_tag);
|
||||||
$html .= " <a style='font-size: ${size}em' href='$link'>$h_tag_no_underscores</a> \n";
|
$html .= " <a style='font-size: ${size}em' href='$link'>$h_tag_no_underscores</a> \n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// file_put_contents("data/tag_map_$tags_min.html", $html);
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,6 +158,10 @@ class TagList implements Extension {
|
|||||||
global $database;
|
global $database;
|
||||||
|
|
||||||
$tags_min = $this->get_tags_min();
|
$tags_min = $this->get_tags_min();
|
||||||
|
if(file_exists("data/tag_alpha_$tags_min.html")) {
|
||||||
|
return file_get_contents("data/tag_alpha_$tags_min.html");
|
||||||
|
}
|
||||||
|
|
||||||
$tag_data = $database->get_all(
|
$tag_data = $database->get_all(
|
||||||
"SELECT tag,count FROM tags WHERE count >= :tags_min ORDER BY tag",
|
"SELECT tag,count FROM tags WHERE count >= :tags_min ORDER BY tag",
|
||||||
array("tags_min"=>$tags_min));
|
array("tags_min"=>$tags_min));
|
||||||
@ -169,6 +179,7 @@ class TagList implements Extension {
|
|||||||
$html .= "<a href='$link'>$h_tag ($count)</a>\n";
|
$html .= "<a href='$link'>$h_tag ($count)</a>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// file_put_contents("data/tag_alpha_$tags_min.html", $html);
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,6 +187,10 @@ class TagList implements Extension {
|
|||||||
global $database;
|
global $database;
|
||||||
|
|
||||||
$tags_min = $this->get_tags_min();
|
$tags_min = $this->get_tags_min();
|
||||||
|
if(file_exists("data/tag_popul_$tags_min.html")) {
|
||||||
|
return file_get_contents("data/tag_popul_$tags_min.html");
|
||||||
|
}
|
||||||
|
|
||||||
$tag_data = $database->get_all(
|
$tag_data = $database->get_all(
|
||||||
"SELECT tag,count,FLOOR(LOG(count)) AS scaled FROM tags WHERE count >= :tags_min ORDER BY count DESC, tag ASC",
|
"SELECT tag,count,FLOOR(LOG(count)) AS scaled FROM tags WHERE count >= :tags_min ORDER BY count DESC, tag ASC",
|
||||||
array("tags_min"=>$tags_min));
|
array("tags_min"=>$tags_min));
|
||||||
@ -194,6 +209,7 @@ class TagList implements Extension {
|
|||||||
$html .= "<a href='$link'>$h_tag ($count)</a>\n";
|
$html .= "<a href='$link'>$h_tag ($count)</a>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// file_put_contents("data/tag_popul_$tags_min.html", $html);
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user