Changeset 9452 for extensions/community/include
- Timestamp:
- Mar 1, 2011, 3:37:14 PM (13 years ago)
- File:
-
- 1 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 ?>
Note: See TracChangeset
for help on using the changeset viewer.