mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 17:23:04 +02:00
- on picture.php, related categories under the element are displayed in
global_rank order - when adding a new virtual category, initializes its global_rank - bug fixed : in admin/cat_list, false next rank - in admin/cat_modify, complete directory is calculated only if category is not virtual - admin/picture_modify rewritten : graphically nearer to admin/cat_modify, virtual associations are back - update_category partially rewritten : take an array of categories in parameter, becomes optionnaly recursive, use the set_random_representant function, set a random representant for categories with elements and no representant - bug fixed : on a search results screen, elements belonging to more than 1 category were shown more than once - bug fixed : in admin/cat_modify, changing a value in a textefield and hitting enter was setting a new random representant git-svn-id: http://piwigo.org/svn/trunk@635 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+26
-9
@@ -738,8 +738,9 @@ SELECT COUNT(rate) AS count
|
||||
}
|
||||
// related categories
|
||||
$query = '
|
||||
SELECT category_id
|
||||
SELECT category_id,uppercats,commentable,global_rank
|
||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||
INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id
|
||||
WHERE image_id = '.$_GET['image_id'];
|
||||
if ($user['forbidden_categories'] != '')
|
||||
{
|
||||
@@ -749,19 +750,35 @@ if ($user['forbidden_categories'] != '')
|
||||
$query.= '
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
$categories = '';
|
||||
$page['show_comments'] = false;
|
||||
$cat_array = array();
|
||||
while ($row = mysql_fetch_array($result))
|
||||
{
|
||||
if ($categories != '')
|
||||
array_push($cat_array, $row);
|
||||
}
|
||||
usort($cat_array, 'global_rank_compare');
|
||||
|
||||
$cat_output = '';
|
||||
$page['show_comments'] = false;
|
||||
foreach ($cat_array as $category)
|
||||
{
|
||||
if ($cat_output != '')
|
||||
{
|
||||
$categories.= '<br />';
|
||||
$cat_output.= '<br />';
|
||||
}
|
||||
|
||||
if (count($cat_array) > 3)
|
||||
{
|
||||
$cat_output .= get_cat_display_name_cache($category['uppercats'],
|
||||
' → ');
|
||||
}
|
||||
else
|
||||
{
|
||||
$cat_info = get_cat_info($category['category_id']);
|
||||
$cat_output .= get_cat_display_name($cat_info['name'], ' → ');
|
||||
}
|
||||
$cat_info = get_cat_info($row['category_id']);
|
||||
$categories .= get_cat_display_name($cat_info['name'], ' >');
|
||||
// the picture is commentable if it belongs at least to one category which
|
||||
// is commentable
|
||||
if ($cat_info['commentable'])
|
||||
if ($category['commentable'])
|
||||
{
|
||||
$page['show_comments'] = true;
|
||||
}
|
||||
@@ -770,7 +787,7 @@ $template->assign_block_vars(
|
||||
'info_line',
|
||||
array(
|
||||
'INFO' => $lang['categories'],
|
||||
'VALUE' => $categories
|
||||
'VALUE' => $cat_output
|
||||
));
|
||||
// metadata
|
||||
if ($metadata_showable and isset($_GET['show_metadata']))
|
||||
|
||||
Reference in New Issue
Block a user