Changeset 18165 for trunk/include/category_cats.inc.php
- Timestamp:
- Sep 23, 2012, 1:19:26 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/category_cats.inc.php
r12930 r18165 23 23 24 24 /** 25 * This file is included by the main page to show thumbnails fora category26 * that have only subcategories or to show recent categories25 * This file is included by the main page to show subcategories of a category 26 * or to show recent categories or main page categories list 27 27 * 28 28 */ 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); 29 37 30 38 // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE … … 39 47 count_categories 40 48 FROM '.CATEGORIES_TABLE.' c 41 INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc ON id = cat_id AND user_id = '.$user['id']; 42 43 if ('recent_cats' == $page['section']) 44 { 45 $query.= ' 46 WHERE date_last >= '.pwg_db_get_recent_period_expression($user['recent_period']); 47 } 48 else 49 { 50 $query.= ' 51 WHERE id_uppercat '.(!isset($page['category']) ? 'is NULL' : '= '.$page['category']['id']); 52 } 53 54 $query.= ' 55 '.get_sql_condition_FandF( 56 array( 57 'visible_categories' => 'id', 58 ), 59 'AND' 60 ); 61 49 INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc 50 ON id = cat_id 51 AND user_id = '.$user['id'].' 52 WHERE c.id IN('.implode(',', $selection).')'; 53 62 54 if ('recent_cats' != $page['section']) 63 55 {
Note: See TracChangeset
for help on using the changeset viewer.