- 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
This commit is contained in:
rvelices
2011-09-08 18:22:27 +00:00
parent dbb3fd5a44
commit 1d3fc9005f
5 changed files with 30 additions and 67 deletions
+7 -3
View File
@@ -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();