diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php
index 4f7b3cd4..156af4fd 100644
--- a/ext/tag_list/main.php
+++ b/ext/tag_list/main.php
@@ -33,6 +33,10 @@ class TagList implements Extension {
$this->theme->set_heading("Tag List by Popularity");
$this->theme->set_tag_list($this->build_tag_popularity());
break;
+ case 'categories':
+ $this->theme->set_heading("Popular Categories");
+ $this->theme->set_tag_list($this->build_tag_categories());
+ break;
}
$this->theme->display_page($page);
}
@@ -90,7 +94,8 @@ class TagList implements Extension {
$h_map = "Map";
$h_alphabetic = "Alphabetic";
$h_popularity = "Popularity";
- return "$h_index
$h_map
$h_alphabetic
$h_popularity";
+ $h_cats = "Categories";
+ return "$h_index
$h_map
$h_alphabetic
$h_popularity
$h_cats";
}
private function build_tag_map() {
@@ -170,6 +175,31 @@ class TagList implements Extension {
return $html;
}
+
+ private function build_tag_categories() {
+ global $database;
+ global $config;
+
+ $tags_min = $config->get_int('tags_min');
+ $result = $database->execute("SELECT tag,count FROM tags ORDER BY count DESC, tag ASC LIMIT 9");
+ $tag_data = $result->GetArray();
+
+ $html = "
$h_tag | \n";
+ if($n%3==2) $html .= "