From d91d0ac444a08c664d05c00a8593fc88fbb0c605 Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 1 Jul 2008 02:09:21 +0000 Subject: - remember me cookie security improvement (the time when the cookie was generated is saved and checked in range [now-remember_me_length; now] - tags improvements * pass to templates all fields in table #tags (handy for plugins such as type tags) * fix issue with tag letter when first letter is accentuated (utf-8) * tags are sorted on url_name instead of name (accentuated first letter chars are the same as without accent) * better use of columns in by letter display mode git-svn-id: http://piwigo.org/svn/trunk@2409 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_tag.inc.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'include/functions_tag.inc.php') diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php index 7bd5d8408..7645f6d82 100644 --- a/include/functions_tag.inc.php +++ b/include/functions_tag.inc.php @@ -59,7 +59,7 @@ SELECT tag_id, COUNT(DISTINCT(it.image_id)) counter } $query = ' -SELECT id, name, url_name +SELECT * FROM '.TAGS_TABLE; $result = pwg_query($query); $tags = array(); @@ -83,9 +83,7 @@ SELECT id, name, url_name function get_all_tags() { $query = ' -SELECT id, - name, - url_name +SELECT * FROM '.TAGS_TABLE.' ;'; $result = pwg_query($query); @@ -95,7 +93,7 @@ SELECT id, array_push($tags, $row); } - usort($tags, 'name_compare'); + usort($tags, 'tag_alpha_compare'); return $tags; } @@ -227,9 +225,9 @@ function get_common_tags($items, $max_tags, $excluded_tag_ids=null) return array(); } $query = ' -SELECT id, name, url_name, count(*) counter +SELECT t.*, count(*) counter FROM '.IMAGE_TAG_TABLE.' - INNER JOIN '.TAGS_TABLE.' ON tag_id = id + INNER JOIN '.TAGS_TABLE.' t ON tag_id = id WHERE image_id IN ('.implode(',', $items).')'; if (!empty($excluded_tag_ids)) { @@ -256,7 +254,7 @@ SELECT id, name, url_name, count(*) counter { array_push($tags, $row); } - usort($tags, 'name_compare'); + usort($tags, 'tag_alpha_compare'); return $tags; } @@ -307,7 +305,7 @@ function find_tags($ids, $url_names=array(), $names=array() ) } $query = ' -SELECT id, url_name, name +SELECT * FROM '.TAGS_TABLE.' WHERE '. implode( ' OR ', $where_clauses); -- cgit v1.2.3