- Timestamp:
- Jun 17, 2013, 2:46:12 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/BatchDownloader/include/BatchDownloader.class.php
r18973 r23280 209 209 function addImages($image_ids) 210 210 { 211 global $conf; 212 211 213 if (empty($image_ids) or !is_array($image_ids)) return; 212 214 213 $image_ids = array_unique($image_ids); 215 $query = ' 216 SELECT id, file 217 FROM '.IMAGES_TABLE.' 218 WHERE id IN('.implode(',', array_unique($image_ids)).') 219 ;'; 220 $images = simple_hash_from_query($query, 'id', 'file'); 221 214 222 $inserts = array(); 215 223 216 foreach ($image _ids as $image_id)224 foreach ($images as $image_id => $file) 217 225 { 218 226 if ($this->isInSet($image_id)) continue; 227 if (!in_array(get_extension($file), $conf['batch_download']['allowed_ext'])) continue; 219 228 220 229 $this->images[ $image_id ] = 0; … … 681 690 return array_merge($set, $this->getNames()); 682 691 } 692 693 /** 694 * delete 695 */ 696 function delete() 697 { 698 $this->deleteLastArchive(); 699 $this->clearImages(); 700 pwg_query('DELETE FROM '.BATCH_DOWNLOAD_TSETS.' WHERE id = '.$this->data['id'].';'); 701 } 683 702 } 684 703
Note: See TracChangeset
for help on using the changeset viewer.