Changeset 18462 for trunk/include/category_cats.inc.php
- Timestamp:
- Oct 4, 2012, 5:03:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/category_cats.inc.php
r18165 r18462 28 28 */ 29 29 30 $selection = array_slice(31 $page['categories'],32 $page['starta'],33 $conf['nb_categories_page']34 );35 36 $selection = trigger_event('loc_index_categories_selection', $selection);37 30 38 31 // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE … … 49 42 INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc 50 43 ON id = cat_id 51 AND user_id = '.$user['id'].' 52 WHERE c.id IN('.implode(',', $selection).')'; 44 AND user_id = '.$user['id']; 45 46 if ('recent_cats' == $page['section']) 47 { 48 $query.= ' 49 WHERE date_last >= '.pwg_db_get_recent_period_expression($user['recent_period']); 50 } 51 else 52 { 53 $query.= ' 54 WHERE id_uppercat '.(!isset($page['category']) ? 'is NULL' : '= '.$page['category']['id']); 55 } 56 57 $query.= ' 58 '.get_sql_condition_FandF( 59 array('visible_categories' => 'id'), 60 'AND' 61 ); 53 62 54 63 if ('recent_cats' != $page['section']) … … 61 70 ;'; 62 71 63 $result = pwg_query($query); 72 $categories_sql = hash_from_query($query, 'id'); 73 74 $page['total_categories'] = count($categories_sql); 75 76 $categories_sql = array_slice( 77 array_values($categories_sql), 78 $page['startcat'], 79 $conf['nb_categories_page'] 80 ); 81 82 $categories_sql = trigger_event('loc_index_categories_selection', $categories_sql); 83 64 84 $categories = array(); 65 85 $category_ids = array(); … … 67 87 $user_representative_updates_for = array(); 68 88 69 while ($row = pwg_db_fetch_assoc($result))89 foreach ($categories_sql as $row) 70 90 { 71 91 $row['is_child_date_last'] = @$row['max_date_last']>@$row['date_last']; … … 375 395 376 396 $template->assign_var_from_handle('CATEGORIES', 'index_category_thumbnails'); 377 } 397 398 // navigation bar 399 $page['cats_navigation_bar'] = array(); 400 if ($page['total_categories'] > $conf['nb_categories_page']) 401 { 402 $page['cats_navigation_bar'] = create_navigation_bar( 403 duplicate_index_url(array(), array('startcat')), 404 $page['total_categories'], 405 $page['startcat'], 406 $conf['nb_categories_page'], 407 true, 'startcat' 408 ); 409 } 410 411 $template->assign('cats_navbar', $page['cats_navigation_bar'] ); 412 } 413 378 414 pwg_debug('end include/category_cats.inc.php'); 379 415 ?>
Note: See TracChangeset
for help on using the changeset viewer.