Ignore:
Timestamp:
Jun 17, 2013, 2:46:12 AM (11 years ago)
Author:
mistic100
Message:

new advanced param $confbatch_download_additional_ext, default is $confpicture_ext

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/include/BatchDownloader.class.php

    r18973 r23280  
    209209  function addImages($image_ids)
    210210  {
     211    global $conf;
     212   
    211213    if (empty($image_ids) or !is_array($image_ids)) return;
    212214   
    213     $image_ids = array_unique($image_ids);
     215    $query = '
     216SELECT 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   
    214222    $inserts = array();
    215223   
    216     foreach ($image_ids as $image_id)
     224    foreach ($images as $image_id => $file)
    217225    {
    218226      if ($this->isInSet($image_id)) continue;
     227      if (!in_array(get_extension($file), $conf['batch_download']['allowed_ext'])) continue;
    219228     
    220229      $this->images[ $image_id ] = 0;
     
    681690    return array_merge($set, $this->getNames());
    682691  }
     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  }
    683702}
    684703
Note: See TracChangeset for help on using the changeset viewer.