From 1d3fc9005f00927c19c291f33b5bfffdd81cad6e Mon Sep 17 00:00:00 2001 From: rvelices Date: Thu, 8 Sep 2011 18:22:27 +0000 Subject: - 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 --- include/functions_tag.inc.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/functions_tag.inc.php') 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(); -- cgit v1.2.3