Changeset 18924


Ignore:
Timestamp:
Nov 4, 2012, 6:41:29 AM (11 years ago)
Author:
rvelices
Message:

all category infos from db are available in template variables and removed second paramater in event (because out of sync with the first one due to the nav bar)

File:
1 edited

Legend:

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

    r18892 r18924  
    4040    count_categories
    4141  FROM '.CATEGORIES_TABLE.' c
    42     INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc 
    43     ON id = cat_id 
     42    INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc
     43    ON id = cat_id
    4444    AND user_id = '.$user['id'];
    45  
     45
    4646if ('recent_cats' == $page['section'])
    4747{
     
    6060        'AND'
    6161        );
    62  
     62
    6363if ('recent_cats' != $page['section'])
    6464{
     
    128128      $user_representative_updates_for[ $user['id'].'#'.$row['id'] ] = $image_id;
    129129    }
    130    
     130
    131131    $row['representative_picture_id'] = $image_id;
    132132    array_push($image_ids, $image_id);
     
    220220            $user_representative_updates_for[ $user['id'].'#'.$category['id'] ] = $image_id;
    221221          }
    222          
     222
    223223          $category['representative_picture_id'] = $image_id;
    224224        }
     
    241241    }
    242242  }
    243  
     243
    244244  foreach ($infos_of_image as &$info)
    245245  {
     
    252252{
    253253  $updates = array();
    254  
     254
    255255  foreach ($user_representative_updates_for as $user_cat => $image_id)
    256256  {
    257257    list($user_id, $cat_id) = explode('#', $user_cat);
    258    
     258
    259259    array_push(
    260260      $updates,
     
    297297      continue;
    298298    }
    299    
     299
    300300    $category['name'] = trigger_event(
    301301        'render_category_name',
     
    315315    $representative_infos = $infos_of_image[ $category['representative_picture_id'] ];
    316316
    317     $tpl_var =
    318         array(
    319           'ID'    => $category['id'],
     317    $tpl_var = array_merge( $category, array(
     318          'ID'    => $category['id'] /*obsolete*/,
    320319          'representative'   => $representative_infos,
    321320          'TN_ALT'   => strip_tags($category['name']),
     
    340339                'subcatify_category_description')),
    341340          'NAME'  => $name,
    342         );
     341        ) );
    343342    if ($conf['index_new_icon'])
    344343    {
     
    376375    $tpl_thumbnails_var[] = $tpl_var;
    377376  }
    378        
     377
    379378  // pagination
    380379  $page['total_categories'] = count($tpl_thumbnails_var);
    381380
    382381  $tpl_thumbnails_var = array_slice(
    383     array_values($tpl_thumbnails_var),
     382    $tpl_thumbnails_var,
    384383    $page['startcat'],
    385384    $conf['nb_categories_page']
     
    387386
    388387  $derivative_params = trigger_event('get_index_album_derivative_params', ImageStdParams::get_by_type(IMG_THUMB) );
    389   $tpl_thumbnails_var = trigger_event('loc_end_index_category_thumbnails', $tpl_thumbnails_var, $categories);
     388  $tpl_thumbnails_var = trigger_event('loc_end_index_category_thumbnails', $tpl_thumbnails_var);
    390389  $template->assign( array(
    391390    'category_thumbnails' => $tpl_thumbnails_var,
     
    394393
    395394  $template->assign_var_from_handle('CATEGORIES', 'index_category_thumbnails');
    396  
     395
    397396  // navigation bar
    398397  $page['cats_navigation_bar'] = array();
Note: See TracChangeset for help on using the changeset viewer.