Changeset 387
- Timestamp:
- Mar 5, 2004, 11:55:04 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r362 r387 88 88 $query.= ' ON c.id = uc.category_id'; 89 89 $query.= ' WHERE user_id = '.$user['id']; 90 if ( $page['expand'] != 'all')90 if ( !$user['expand'] ) 91 91 { 92 92 $query.= ' AND (id_uppercat is NULL'; 93 93 if ( count( $page['tab_expand'] ) > 0 ) 94 94 { 95 $query.= ' OR id_uppercat IN ('. $page['expand'].')';95 $query.= ' OR id_uppercat IN ('.implode(',',$page['tab_expand']).')'; 96 96 } 97 97 $query.= ')'; … … 175 175 // update the "expanded" key 176 176 if ( $user['expand'] 177 or $page['expand'] == 'all'178 177 or in_array( $category['id'], $page['tab_expand'] ) ) 179 178 { … … 183 182 { 184 183 $category['expanded'] = false; 185 }186 // update the "expand_string" key187 if ( $page['expand'] == 'all' )188 {189 $category['expand_string'] = 'all';190 }191 else192 {193 $tab_expand = $page['tab_expand'];194 if ( in_array( $category['id'], $page['tab_expand'] ) )195 {196 // the expand string corresponds to the $page['tab_expand'] without197 // the $category['id']198 $tab_expand = array_diff( $page['tab_expand'],array($category['id']) );199 }200 else if ( $category['nb_sub_categories'] > 0 )201 {202 // we have this time to add the $category['id']...203 $tab_expand = array_merge($page['tab_expand'],array($category['id']));204 }205 $category['expand_string'] = implode( ',', $tab_expand );206 184 } 207 185 // recursive call
Note: See TracChangeset
for help on using the changeset viewer.