Changeset 23075 for branches/2.5
- Timestamp:
- Jun 6, 2013, 4:02:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/include/functions_user.inc.php
r21236 r23075 405 405 if ( !is_admin($userdata['status']) ) 406 406 { // for non admins we forbid categories with no image (feature 1053) 407 $uppercats_of = null; 407 408 $forbidden_ids = array(); 408 409 foreach ($user_cache_cats as $cat) … … 412 413 $forbidden_ids[] = $cat['cat_id']; 413 414 unset( $user_cache_cats[$cat['cat_id']] ); 415 416 if (empty($uppercats_of)) 417 { 418 $query = ' 419 SELECT 420 id, 421 uppercats 422 FROM '.CATEGORIES_TABLE.' 423 ;'; 424 $uppercats_of = simple_hash_from_query($query, 'id', 'uppercats'); 425 } 426 427 // if child album is removed, we must decrease the number of 428 // sub-albums of all parent albums (to the root) 429 if (isset($uppercats_of[$cat['cat_id']])) 430 { 431 foreach (explode(',', $uppercats_of[$cat['cat_id']]) as $id) 432 { 433 // the last $id is the current album removed, it will always 434 // fail the following condition because it was removed a few 435 // lines before. 436 if (isset($user_cache_cats[$id])) 437 { 438 $user_cache_cats[$id]['count_categories']--; 439 } 440 } 441 } 414 442 } 415 443 }
Note: See TracChangeset
for help on using the changeset viewer.