Changeset 9845 for extensions/community


Ignore:
Timestamp:
Mar 24, 2011, 3:27:20 PM (13 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.