cache popular tags

This commit is contained in:
Shish 2011-01-22 17:38:41 +00:00
parent fc7eb0609e
commit 996183a2d3

View file

@ -283,6 +283,8 @@ class TagList implements Extension {
global $database;
global $config;
$tags = $database->cache->get("popular_tags");
if(empty($tags)) {
$query = "
SELECT tag, count
FROM tags
@ -293,6 +295,8 @@ class TagList implements Extension {
$args = array("tag_list_length"=>$config->get_int('tag_list_length'));
$tags = $database->get_all($query, $args);
$database->cache->set("popular_tags", $tags, 600);
}
if(count($tags) > 0) {
$this->theme->display_popular_block($page, $tags);
}