aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_tag.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions_tag.inc.php')
-rw-r--r--include/functions_tag.inc.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php
index 028fd766c..9f93115fd 100644
--- a/include/functions_tag.inc.php
+++ b/include/functions_tag.inc.php
@@ -228,13 +228,17 @@ SELECT t.*, count(*) AS counter
AND tag_id NOT IN ('.implode(',', $excluded_tag_ids).')';
}
$query .='
- GROUP BY tag_id, t.id, t.name, t.url_name';
+ GROUP BY t.id
+ ORDER BY ';
if ($max_tags>0)
{
- $query .= '
- ORDER BY counter DESC
+ $query .= 'counter DESC
LIMIT '.$max_tags;
}
+ else
+ {
+ $query .= 'NULL';
+ }
$result = pwg_query($query);
$tags = array();