bug 367 fixed: tags are sorted in logic order (case insensitive)
git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1309 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
b593bf2fc4
commit
2b4be7da20
3 changed files with 8 additions and 4 deletions
|
@ -293,7 +293,6 @@ if (count($page['cat_elements_id']) > 0)
|
|||
INNER JOIN '.TAGS_TABLE.' ON tag_id = id
|
||||
WHERE image_id IN ('.implode(',', $page['cat_elements_id']).')
|
||||
GROUP BY tag_id
|
||||
ORDER BY name ASC
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
|
||||
|
@ -303,6 +302,8 @@ if (count($page['cat_elements_id']) > 0)
|
|||
array_push($tags, $row);
|
||||
}
|
||||
|
||||
usort($tags, 'name_compare');
|
||||
|
||||
$template->assign_vars(
|
||||
array(
|
||||
'DEL_TAG_SELECTION' => get_html_tag_selection($tags, 'del_tags'),
|
||||
|
|
|
@ -563,7 +563,7 @@ function get_html_tag_selection(
|
|||
|
||||
function name_compare($a, $b)
|
||||
{
|
||||
return strcmp($a['name'], $b['name']);
|
||||
return strcmp(strtolower($a['name']), strtolower($b['name']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -91,9 +91,10 @@ SELECT DISTINCT image_id
|
|||
function get_all_tags()
|
||||
{
|
||||
$query = '
|
||||
SELECT id AS tag_id, name, url_name
|
||||
SELECT id AS tag_id,
|
||||
name,
|
||||
url_name
|
||||
FROM '.TAGS_TABLE.'
|
||||
ORDER BY name
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
|
||||
|
@ -104,6 +105,8 @@ SELECT id AS tag_id, name, url_name
|
|||
array_push($tags, $row);
|
||||
}
|
||||
|
||||
usort($tags, 'name_compare');
|
||||
|
||||
return $tags;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue