aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_tag.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2011-09-08 18:22:27 +0000
committerrvelices <rv-github@modusoptimus.com>2011-09-08 18:22:27 +0000
commit1d3fc9005f00927c19c291f33b5bfffdd81cad6e (patch)
tree549aa6fa5a11b0ab895e74e7fb97e468bcff4074 /include/functions_tag.inc.php
parentdbb3fd5a444a542ddcd730882138daca602c0923 (diff)
- reoptimize queries for MySql
- week starts on monday/sunday applies also to weekly calendar git-svn-id: http://piwigo.org/svn/trunk@12118 68402e56-0260-453c-a942-63ccdbb3a9ee
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();