Changeset 1677 for trunk/include/functions_category.inc.php
- Timestamp:
- Dec 21, 2006, 10:38:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r1651 r1677 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 5PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 45 45 global $user; 46 46 47 // $filter['visible_categories'] and $filter['visible_images'] 48 // are not used because it's not necessary (filter <> restriction) 47 49 if (in_array($category_id, explode(',', $user['forbidden_categories']))) 48 50 { … … 53 55 function get_categories_menu() 54 56 { 55 global $page, $user ;57 global $page, $user, $filter; 56 58 57 59 $query = ' … … 66 68 // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE 67 69 $query.= ' 68 70 FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' 69 71 ON id = cat_id and user_id = '.$user['id']; 70 if ($page['filter_local_mode']) 72 73 // Always expand when filter is activated 74 if (!$user['expand'] and !$filter['enabled']) 71 75 { 72 76 $query.= ' 73 where max_date_last > SUBDATE( 74 CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)'; 77 WHERE 78 (id_uppercat is NULL'; 79 if (isset($page['category'])) 80 { 81 $query.= ' OR id_uppercat IN ('.$page['uppercats'].')'; 82 } 83 $query.= ')'; 75 84 } 76 85 else 77 86 { 78 // Always expand when filter_local_mode is activated 79 if (!$user['expand'] and !$user['filter_global_mode']) 80 { 81 $query.= ' 82 WHERE (id_uppercat is NULL'; 83 if (isset($page['category'])) 84 { 85 $query.= ' OR id_uppercat IN ('.$page['uppercats'].')'; 86 } 87 $query.= ')'; 88 } 89 } 87 $query.= ' 88 '.get_sql_condition_FandF 89 ( 90 array 91 ( 92 'visible_categories' => 'id', 93 ), 94 'WHERE' 95 ); 96 } 97 90 98 $query.= ' 91 99 ;'; … … 98 106 } 99 107 usort($cats, 'global_rank_compare'); 108 109 // Update filtered data 110 update_cats_with_filtered_data($cats); 100 111 101 112 return get_html_menu_category($cats);
Note: See TracChangeset
for help on using the changeset viewer.