Changeset 9504 for extensions/community
- Timestamp:
- Mar 3, 2011, 10:47:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/community/add_photos.php
r9500 r9504 180 180 else 181 181 { 182 // we have to change the level. 183 // 184 // the level must equal the minimum level between : 185 // * the privacy level of the uploader 186 // * the minimum level for photos in the same album 187 $category_min_level = null; 188 189 $query = ' 190 SELECT 191 image_id, 192 level 193 FROM '.IMAGE_CATEGORY_TABLE.' AS ic 194 JOIN '.IMAGES_TABLE.' AS i ON ic.image_id = i.id 195 WHERE category_id = '.$category_id.' 196 ;'; 197 $result = pwg_query($query); 198 while ($row = pwg_db_fetch_assoc($result)) 199 { 200 if (in_array($row['image_id'], $image_ids)) 201 { 202 continue; 203 } 204 205 if (!isset($category_min_level)) 206 { 207 $category_min_level = $row['level']; 208 } 209 210 if ($row['level'] < $category_min_level) 211 { 212 $category_min_level = $row['level']; 213 } 214 } 215 216 if (!isset($category_min_level)) 217 { 218 $category_min_level = 0; 219 } 220 221 $level = min($category_min_level, $user['level']); 222 182 // the level of a user upload photo with no moderation is 0 223 183 $query = ' 224 184 UPDATE '.IMAGES_TABLE.' 225 SET level = '.$level.'185 SET level = 0 226 186 WHERE id IN ('.implode(',', $image_ids).') 227 187 ;';
Note: See TracChangeset
for help on using the changeset viewer.