aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_tag.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-07-01 02:09:21 +0000
committerrvelices <rv-github@modusoptimus.com>2008-07-01 02:09:21 +0000
commitd91d0ac444a08c664d05c00a8593fc88fbb0c605 (patch)
tree7f560292f25e68b67604def548d2db595228bb94 /include/functions_tag.inc.php
parent1d3706a42171b409e9d455194ee96d3fc87479a4 (diff)
- 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
Diffstat (limited to 'include/functions_tag.inc.php')
-rw-r--r--include/functions_tag.inc.php16
1 files changed, 7 insertions, 9 deletions
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);