From df3b43d35601551c3344bf051cdef4ab67de505a Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 14 Feb 2007 01:37:38 +0000 Subject: 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 --- admin/element_set_global.php | 23 ++++------------------- admin/picture_modify.php | 7 +++---- include/functions_html.inc.php | 4 ++-- include/functions_tag.inc.php | 24 +++++++++++------------- include/menubar.inc.php | 14 ++------------ include/ws_functions.inc.php | 32 ++++++++++++-------------------- index.php | 7 +------ tags.php | 17 ++++++----------- 8 files changed, 41 insertions(+), 87 deletions(-) diff --git a/admin/element_set_global.php b/admin/element_set_global.php index fc4f7c172..cb55282e2 100644 --- a/admin/element_set_global.php +++ b/admin/element_set_global.php @@ -2,10 +2,9 @@ // +-----------------------------------------------------------------------+ // | PhpWebGallery - a PHP based picture gallery | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | -// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | +// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ -// | branch : BSF (Best So Far) -// | file : $RCSfile$ +// | file : $Id$ // | last update : $Date$ // | last modifier : $Author$ // | revision : $Revision$ @@ -289,7 +288,7 @@ if (count($all_tags) == 0) else { $add_tag_selection = get_html_tag_selection( - get_all_tags(), + $all_tags, 'add_tags' ); } @@ -304,21 +303,7 @@ $template->assign_vars( if (count($page['cat_elements_id']) > 0) { // remove tags - $query = ' - SELECT tag_id, name, url_name, count(*) counter - FROM '.IMAGE_TAG_TABLE.' - INNER JOIN '.TAGS_TABLE.' ON tag_id = id - WHERE image_id IN ('.implode(',', $page['cat_elements_id']).') - GROUP BY tag_id - ;'; - $result = pwg_query($query); - - $tags = array(); - while($row = mysql_fetch_array($result)) - { - array_push($tags, $row); - } - + $tags = get_common_tags($page['cat_elements_id'], -1); usort($tags, 'name_compare'); $template->assign_vars( diff --git a/admin/picture_modify.php b/admin/picture_modify.php index 664503281..9f6877167 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -2,10 +2,9 @@ // +-----------------------------------------------------------------------+ // | PhpWebGallery - a PHP based picture gallery | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | -// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | +// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ -// | branch : BSF (Best So Far) -// | file : $RCSfile$ +// | file : $Id$ // | last update : $Date$ // | last modifier : $Author$ // | revision : $Revision$ @@ -211,7 +210,7 @@ $all_tags = get_all_tags(); if (count($all_tags) > 0) { $tag_selection = get_html_tag_selection( - get_all_tags(), + $all_tags, 'tags', $selected_tags ); diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index 490def9ed..3aba87d61 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -558,10 +558,10 @@ function get_html_tag_selection( '
  • ' .'