Changeset 18892


Ignore:
Timestamp:
Nov 2, 2012, 4:04:54 PM (8 years ago)
Author:
mistic100
Message:

feature:2614 bad display when there are empty albums
revert most of the previous changes and slice the array at the very end

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/category_cats.inc.php

    r18464 r18892  
    7070;';
    7171
    72 $categories_sql = hash_from_query($query, 'id');
    73 
    74 if ($page['section']=='recent_cats')
    75 {
    76   usort($categories_sql, 'global_rank_compare');
    77 }
    78 
    79 $page['total_categories'] = count($categories_sql);
    80 
    81 $categories_sql = array_slice(
    82   array_values($categories_sql),
    83   $page['startcat'],
    84   $conf['nb_categories_page']
    85   );
    86 
    87 $categories_sql = trigger_event('loc_index_categories_selection', $categories_sql);
    88 
     72$result = pwg_query($query);
    8973$categories = array();
    9074$category_ids = array();
     
    9276$user_representative_updates_for = array();
    9377
    94 foreach ($categories_sql as $row)
     78while ($row = pwg_db_fetch_assoc($result))
    9579{
    9680  $row['is_child_date_last'] = @$row['max_date_last']>@$row['date_last'];
     
    188172}
    189173
     174if ($page['section']=='recent_cats')
     175{
     176  usort($categories, 'global_rank_compare');
     177}
     178
    190179if (count($categories) > 0)
    191180{
     
    387376    $tpl_thumbnails_var[] = $tpl_var;
    388377  }
     378       
     379  // pagination
     380  $page['total_categories'] = count($tpl_thumbnails_var);
     381
     382  $tpl_thumbnails_var = array_slice(
     383    array_values($tpl_thumbnails_var),
     384    $page['startcat'],
     385    $conf['nb_categories_page']
     386    );
    389387
    390388  $derivative_params = trigger_event('get_index_album_derivative_params', ImageStdParams::get_by_type(IMG_THUMB) );
Note: See TracChangeset for help on using the changeset viewer.