Changeset 26557 for extensions/community
- Timestamp:
- Jan 9, 2014, 8:44:12 PM (10 years ago)
- Location:
- extensions/community
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/community/admin_pendings.php
r23744 r26557 121 121 // | pending photos list | 122 122 // +-----------------------------------------------------------------------+ 123 124 // just in case (because we had a bug in Community plugin up to version 125 // 2.5.c) let's remove rows in community_pendings table if related photos 126 // has been deleted 127 $query = ' 128 SELECT 129 image_id 130 FROM '.COMMUNITY_PENDINGS_TABLE.' 131 LEFT JOIN '.IMAGES_TABLE.' ON id = image_id 132 WHERE id IS NULL 133 ;'; 134 $to_delete = array_from_query($query, 'image_id'); 135 136 if (count($to_delete) > 0) 137 { 138 $query = ' 139 DELETE 140 FROM '.COMMUNITY_PENDINGS_TABLE.' 141 WHERE image_id IN ('.implode(',', $to_delete).') 142 ;'; 143 pwg_query($query); 144 } 123 145 124 146 $list = array(); -
extensions/community/main.inc.php
r23960 r26557 85 85 COUNT(*) 86 86 FROM '.COMMUNITY_PENDINGS_TABLE.' 87 JOIN '.IMAGES_TABLE.' ON image_id = id 87 88 WHERE state = \'moderation_pending\' 88 89 ;'; … … 644 645 } 645 646 647 add_event_handler('delete_elements', 'community_delete_elements'); 648 function community_delete_elements($image_ids) 649 { 650 $query = ' 651 DELETE 652 FROM '.COMMUNITY_PENDINGS_TABLE.' 653 WHERE image_id IN ('.implode(',', $image_ids).') 654 ;'; 655 pwg_query($query); 656 } 657 646 658 add_event_handler('invalidate_user_cache', 'community_refresh_cache_update_time'); 647 659 function community_refresh_cache_update_time()
Note: See TracChangeset
for help on using the changeset viewer.