mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
- 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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user