aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_tag.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-04-25 23:39:06 +0000
committerrvelices <rv-github@modusoptimus.com>2008-04-25 23:39:06 +0000
commitf95f48a226118dd541130e2cec8e18fd13bff128 (patch)
treed65014464efe3e2f0ca9f83156914797a337813b /include/functions_tag.inc.php
parentcd30335df7f2a4c3b15c5f2ba181dc1b0444f00a (diff)
- merge r2308 and r2309 from trunk to branch-1_7
- minor mysql query optimizations - less mysql queries on the picture page (under some circumstances) git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2310 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_tag.inc.php')
-rw-r--r--include/functions_tag.inc.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php
index c6dc01db6..281517779 100644
--- a/include/functions_tag.inc.php
+++ b/include/functions_tag.inc.php
@@ -53,8 +53,12 @@ SELECT id, name, url_name, count(*) counter
'visible_categories' => 'category_id',
'visible_images' => 'image_id'
),
- 'WHERE'
- );
+ '
+ WHERE'
+ ).'
+ GROUP BY tag_id
+ ORDER BY NULL';
+ $tag_counters = simple_hash_from_query($query, 'tag_id', 'counter');
if (!empty($where_tag_img))
{
@@ -261,6 +265,11 @@ SELECT id, name, url_name, count(*) counter
ORDER BY counter DESC
LIMIT 0,'.$max_tags;
}
+ else
+ {
+ $query .= '
+ ORDER BY NULL';
+ }
$result = pwg_query($query);
$tags = array();