Changeset 9845


Ignore:
Timestamp:
03/24/11 15:27:20 (9 years ago)
Author:
plg
Message:

bug fixed: when deleting a category, automatically delete related community permissions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/community/main.inc.php

    r9583 r9845  
    214214} 
    215215 
     216add_event_handler('delete_categories', 'community_delete_category'); 
     217function community_delete_category($category_ids) 
     218{ 
     219  // $category_ids includes all the sub-category ids 
     220  $query = ' 
     221DELETE 
     222  FROM '.COMMUNITY_PERMISSIONS_TABLE.' 
     223  WHERE category_id IN ('.implode(',', $category_ids).') 
     224;'; 
     225  pwg_query($query); 
     226   
     227  community_update_cache_key(); 
     228} 
     229 
    216230add_event_handler('invalidate_user_cache', 'community_refresh_cache_update_time'); 
    217231function community_refresh_cache_update_time() 
Note: See TracChangeset for help on using the changeset viewer.