Changeset 23321 for extensions/BatchDownloader
- Timestamp:
- Jun 18, 2013, 1:08:10 PM (11 years ago)
- Location:
- extensions/BatchDownloader/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/BatchDownloader/include/BatchDownloader.class.php
r23318 r23321 448 448 { 449 449 $query = ' 450 SELECT image_id, filesize 450 SELECT image_id, filesize, width, height 451 451 FROM '.IMAGE_SIZES_TABLE.' 452 452 WHERE image_id IN ('.implode(',', array_keys($images_to_add)).') 453 453 AND type = "'.$this->data['size'].'" 454 454 ;'; 455 $filesizes = simple_hash_from_query($query, 'image_id', 'filesize');455 $filesizes = hash_from_query($query, 'image_id'); 456 456 } 457 457 … … 472 472 } 473 473 474 $filename = $row['id'].'_'.stripslashes(get_filename_wo_extension($row['file'])); 475 474 476 if ($this->data['size'] == 'original') 475 477 { 476 $zip->addFile(PHPWG_ROOT_PATH.$row['path'], $row['id'].'_'.stripslashes(get_filename_wo_extension($row['file'])).'.'.get_extension($row['path'])); 478 $filename.= '_'.$row['width'].'x'.$row['height']; 479 $zip->addFile(PHPWG_ROOT_PATH.$row['path'], $filename.'.'.get_extension($row['path'])); 477 480 $total_size+= $row['filesize']; 478 481 } … … 484 487 if ($src_image->is_mimetype()) 485 488 { 486 $zip->addFile(PHPWG_ROOT_PATH.$row['path'], $ row['id'].'_'.stripslashes(get_filename_wo_extension($row['file'])).'.'.get_extension($row['path']));489 $zip->addFile(PHPWG_ROOT_PATH.$row['path'], $filename.'.'.get_extension($row['path'])); 487 490 $total_size+= $row['filesize']; 488 491 } … … 492 495 $derivative = new DerivativeImage($this->data['size'], $src_image); 493 496 $path = $derivative->get_path(); 494 495 $zip->addFile($path, $row['id'].'_'.stripslashes(get_filename_wo_extension(basename($path))).'.'.get_extension($path)); 496 $total_size+= $filesizes[ $row['id'] ]; 497 498 $filename.= '_'.$filesizes[ $row['id'] ]['width'].'x'.$filesizes[ $row['id'] ]['height']; 499 $zip->addFile($path, $filename.'.'.get_extension($path)); 500 $total_size+= $filesizes[ $row['id'] ]['filesize']; 497 501 } 498 502 } … … 652 656 $set = $this->getNames(); 653 657 654 include_once(PHPWG_ROOT_PATH . 'admin/include/functions.php');655 656 658 $path = BATCH_DOWNLOAD_LOCAL . 'u-'. $this->data['user_id'] . '/'; 657 659 $path.= !empty($this->conf['archive_prefix']) ? $this->conf['archive_prefix'] . '_' : null; 658 $path.= get_username($this->data['user_id']) . '_'; 659 $path.= $set['BASENAME'] . '_'; 660 $path.= $set['BASENAME'] . '_' . $this->data['size'] . '_'; 660 661 $path.= $this->data['user_id'] . $this->data['id']; 661 662 $path.= '_part' . $i . '.zip'; -
extensions/BatchDownloader/include/events.inc.php
r23318 r23321 66 66 { 67 67 case 'categories': 68 if (!isset($page['category']) ) return; // don't download the full gallery in flat mode !68 if (!isset($page['category']) && !isset($page['chronology_field'])) return; // don't download the full gallery in flat mode ! 69 69 70 70 if (!in_array('categories', $conf['batch_download']['what'])) return; -
extensions/BatchDownloader/include/functions.inc.php
r23318 r23321 33 33 else if (isset($page['flat'])) // this is for the whole gallery only, flat mode for category is above 34 34 { 35 $batch_type = 'flat'; 36 $batch_id = null; 35 return false; 37 36 } 38 37 break;
Note: See TracChangeset
for help on using the changeset viewer.