Permalink
Browse files

feature:2614 bad display when there are empty albums

revert most of the previous changes and slice the array at the very end

git-svn-id: http://piwigo.org/svn/trunk@18892 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information...
mistic100 committed Nov 2, 2012
1 parent 26e0ed8 commit 40e652922c65516a9600b072d136043aab8cd64a
Showing with 16 additions and 18 deletions.
  1. +16 −18 include/category_cats.inc.php
@@ -69,29 +69,13 @@
$query.= '
;';
$categories_sql = hash_from_query($query, 'id');
if ($page['section']=='recent_cats')
{
usort($categories_sql, 'global_rank_compare');
}
$page['total_categories'] = count($categories_sql);
$categories_sql = array_slice(
array_values($categories_sql),
$page['startcat'],
$conf['nb_categories_page']
);
$categories_sql = trigger_event('loc_index_categories_selection', $categories_sql);
$result = pwg_query($query);
$categories = array();
$category_ids = array();
$image_ids = array();
$user_representative_updates_for = array();
foreach ($categories_sql as $row)
while ($row = pwg_db_fetch_assoc($result))
{
$row['is_child_date_last'] = @$row['max_date_last']>@$row['date_last'];
@@ -187,6 +171,11 @@
}
}
if ($page['section']=='recent_cats')
{
usort($categories, 'global_rank_compare');
}
if (count($categories) > 0)
{
$infos_of_image = array();
@@ -386,6 +375,15 @@
$tpl_thumbnails_var[] = $tpl_var;
}
// pagination
$page['total_categories'] = count($tpl_thumbnails_var);
$tpl_thumbnails_var = array_slice(
array_values($tpl_thumbnails_var),
$page['startcat'],
$conf['nb_categories_page']
);
$derivative_params = trigger_event('get_index_album_derivative_params', ImageStdParams::get_by_type(IMG_THUMB) );
$tpl_thumbnails_var = trigger_event('loc_end_index_category_thumbnails', $tpl_thumbnails_var, $categories);

0 comments on commit 40e6529

Please sign in to comment.