Changeset 9452 for extensions
- Timestamp:
- Mar 1, 2011, 3:37:14 PM (13 years ago)
- Location:
- extensions/community
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/community/include/functions_community.inc.php
r9444 r9452 118 118 } 119 119 120 function community_reject_pendings($image_ids) 121 { 122 if (count($image_ids) == 0) 123 { 124 return; 125 } 126 127 $query = ' 128 DELETE 129 FROM '.COMMUNITY_PENDINGS_TABLE.' 130 WHERE image_id IN ('.implode(',', $image_ids).') 131 ;'; 132 pwg_query($query); 133 134 // needs to be in administration panel 135 delete_elements($image_ids, true); 136 } 137 138 function community_reject_user_pendings($user_id) 139 { 140 $query = ' 141 SELECT 142 image_id 143 FROM '.COMMUNITY_PENDINGS_TABLE.' AS cp 144 INNER JOIN '.IMAGES_TABLE.' AS i ON i.id = cp.image_id 145 WHERE state != \'validated\' 146 AND added_by = '.$user_id.' 147 ;'; 148 $result = pwg_query($query); 149 $image_ids = array(); 150 while ($row = pwg_db_fetch_assoc($result)) 151 { 152 array_push($image_ids, $row['image_id']); 153 } 154 155 community_reject_pendings($image_ids); 156 } 157 120 158 ?> -
extensions/community/main.inc.php
r9444 r9452 17 17 18 18 global $prefixeTable; 19 define('COMMUNITY_TABLE', $prefixeTable.'community');20 19 define('COMMUNITY_PERMISSIONS_TABLE', $prefixeTable.'community_permissions'); 21 20 define('COMMUNITY_PENDINGS_TABLE', $prefixeTable.'community_pendings'); … … 148 147 $query = ' 149 148 DELETE 150 FROM '.COMMUNITY_ TABLE.'149 FROM '.COMMUNITY_PERMISSIONS_TABLE.' 151 150 WHERE user_id = '.$user_id.' 152 151 ;'; 153 152 pwg_query($query); 153 154 community_reject_user_pendings($user_id); 154 155 } 155 156
Note: See TracChangeset
for help on using the changeset viewer.