aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_tag.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-02-14 01:37:38 +0000
committerrvelices <rv-github@modusoptimus.com>2007-02-14 01:37:38 +0000
commitdf3b43d35601551c3344bf051cdef4ab67de505a (patch)
treef6b9efcb3fb2ba3c2df375fd15e4a2b116b6adce /include/functions_tag.inc.php
parent711ebcbf2c1906b6496711eb6973954ecb113d72 (diff)
tags returned by get_all_tags, get_available_tags contain id key instead of tag_id
(as expected by make_index_url, as $page['tags'] was and as the database model is) git-svn-id: http://piwigo.org/svn/trunk@1815 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_tag.inc.php')
-rw-r--r--include/functions_tag.inc.php24
1 files changed, 11 insertions, 13 deletions
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php
index 42704d238..c9f239ef7 100644
--- a/include/functions_tag.inc.php
+++ b/include/functions_tag.inc.php
@@ -2,14 +2,13 @@
// +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
-// | branch : BSF (Best So Far)
-// | file : $RCSfile$
-// | last update : $Date: 2006-03-16 23:58:16 +0100 (jeu, 16 mar 2006) $
-// | last modifier : $Author: rub $
-// | revision : $Revision: 1085 $
-// | revision : $Revision: 1085 $
+// | file : $Id$
+// | last update : $Date$
+// | last modifier : $Author$
+// | revision : $Revision$
+// | revision : $Revision$
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
@@ -41,7 +40,7 @@ function get_available_tags()
{
// we can find top fatter tags among reachable images
$tags_query = '
-SELECT tag_id, name, url_name, count(*) counter
+SELECT id, name, url_name, count(*) counter
FROM '.IMAGE_TAG_TABLE.'
INNER JOIN '.TAGS_TABLE.' ON tag_id = id';
@@ -57,7 +56,7 @@ SELECT tag_id, name, url_name, count(*) counter
'WHERE'
);
- if (!is_null($where_tag_img))
+ if (!empty($where_tag_img))
{
// first we need all reachable image ids
$images_query = '
@@ -101,7 +100,7 @@ SELECT DISTINCT image_id
function get_all_tags()
{
$query = '
-SELECT id AS tag_id,
+SELECT id,
name,
url_name
FROM '.TAGS_TABLE.'
@@ -245,7 +244,7 @@ function get_common_tags($items, $max_tags, $excluded_tag_ids=null)
return array();
}
$query = '
-SELECT tag_id, name, url_name, count(*) counter
+SELECT id, name, url_name, count(*) counter
FROM '.IMAGE_TAG_TABLE.'
INNER JOIN '.TAGS_TABLE.' ON tag_id = id
WHERE image_id IN ('.implode(',', $items).')';
@@ -255,8 +254,7 @@ SELECT tag_id, name, url_name, count(*) counter
AND tag_id NOT IN ('.implode(',', $excluded_tag_ids).')';
}
$query .='
- GROUP BY tag_id
- ORDER BY counter DESC';
+ GROUP BY tag_id';
if ($max_tags>0)
{
$query .= '