Ignore:
Timestamp:
Jan 9, 2014, 8:44:12 PM (10 years ago)
Author:
plg
Message:

bug 2512 fixed: safely remove photos in community pending list when photo is
deleted (outside Community).

File:
1 edited

Legend:

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

    r23960 r26557  
    8585    COUNT(*)
    8686  FROM '.COMMUNITY_PENDINGS_TABLE.'
     87    JOIN '.IMAGES_TABLE.' ON image_id = id
    8788  WHERE state = \'moderation_pending\'
    8889;';
     
    644645}
    645646
     647add_event_handler('delete_elements', 'community_delete_elements');
     648function community_delete_elements($image_ids)
     649{
     650  $query = '
     651DELETE
     652  FROM '.COMMUNITY_PENDINGS_TABLE.'
     653  WHERE image_id IN ('.implode(',', $image_ids).')
     654;';
     655  pwg_query($query);
     656}
     657
    646658add_event_handler('invalidate_user_cache', 'community_refresh_cache_update_time');
    647659function community_refresh_cache_update_time()
Note: See TracChangeset for help on using the changeset viewer.