mincount paramater
This commit is contained in:
parent
444d1aa3d5
commit
e82ff7d3fb
1 changed files with 14 additions and 8 deletions
|
@ -88,6 +88,16 @@ class TagList implements Extension {
|
|||
$u_tag = url_escape($tag);
|
||||
return make_link("post/list/$u_tag/1");
|
||||
}
|
||||
|
||||
private function get_tags_min() {
|
||||
if(isset($_GET['mincount'])) {
|
||||
return int_escape($_GET['mincount']);
|
||||
}
|
||||
else {
|
||||
global $config;
|
||||
return $config->get_int('tags_min');
|
||||
}
|
||||
}
|
||||
// }}}
|
||||
// maps {{{
|
||||
private function build_navigation() {
|
||||
|
@ -101,9 +111,8 @@ class TagList implements Extension {
|
|||
|
||||
private function build_tag_map() {
|
||||
global $database;
|
||||
global $config;
|
||||
|
||||
$tags_min = $config->get_int('tags_min');
|
||||
$tags_min = $this->get_tags_min();
|
||||
$result = $database->execute("
|
||||
SELECT
|
||||
tag,
|
||||
|
@ -128,9 +137,8 @@ class TagList implements Extension {
|
|||
|
||||
private function build_tag_alphabetic() {
|
||||
global $database;
|
||||
global $config;
|
||||
|
||||
$tags_min = $config->get_int('tags_min');
|
||||
$tags_min = $this->get_tags_min();
|
||||
$result = $database->execute(
|
||||
"SELECT tag,count FROM tags WHERE count >= ? ORDER BY tag",
|
||||
array($tags_min));
|
||||
|
@ -154,9 +162,8 @@ class TagList implements Extension {
|
|||
|
||||
private function build_tag_popularity() {
|
||||
global $database;
|
||||
global $config;
|
||||
|
||||
$tags_min = $config->get_int('tags_min');
|
||||
$tags_min = $this->get_tags_min();
|
||||
$result = $database->execute(
|
||||
"SELECT tag,count,FLOOR(LOG(count)) AS scaled FROM tags WHERE count >= ? ORDER BY count DESC, tag ASC",
|
||||
array($tags_min));
|
||||
|
@ -181,9 +188,8 @@ class TagList implements Extension {
|
|||
|
||||
private function build_tag_categories() {
|
||||
global $database;
|
||||
global $config;
|
||||
|
||||
$tags_min = $config->get_int('tags_min');
|
||||
$tags_min = $this->get_tags_min();
|
||||
$result = $database->execute("SELECT tag,count FROM tags ORDER BY count DESC, tag ASC LIMIT 9");
|
||||
$tag_data = $result->GetArray();
|
||||
|
||||
|
|
Reference in a new issue