Changeset 18973
- Timestamp:
- Nov 7, 2012, 10:05:44 PM (11 years ago)
- Location:
- extensions/BatchDownloader
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/BatchDownloader/download.php
r16948 r18973 25 25 echo $e->getMessage(); 26 26 } 27 27 28 28 exit(0); 29 29 -
extensions/BatchDownloader/include/BatchDownloader.class.php
r18291 r18973 322 322 foreach ($images_to_add as $row) 323 323 { 324 $zip->addFile(PHPWG_ROOT_PATH . $row['path'], $row['id'].'_'. get_filename_wo_extension($row['file']).'.'.get_extension($row['path']));324 $zip->addFile(PHPWG_ROOT_PATH . $row['path'], $row['id'].'_'.stripslashes(get_filename_wo_extension($row['file'])).'.'.get_extension($row['path'])); 325 325 326 326 array_push($images_added, $row['id']); … … 437 437 { 438 438 $out.= '<a href="'.add_url_params($url, array('set_id'=>$this->data['id'],'zip'=>$i)).'" rel="nofollow" style="font-weight:bold;"' 439 .($i!=1 ? ' onClick="return confirm(\'Starting download Archive #'.$i.' will destroy Archive #'.($i-1).', be sure you finish the download. Continue ?\');"' : null).439 .($i!=1 ? ' onClick="return confirm(\''.addslashes(sprintf(l10n('Starting download Archive #%d will destroy Archive #%d, be sure you finish the download. Continue ?'), $i, $i-1)).'\');"' : null). 440 440 '><img src="'.$root_url.BATCH_DOWNLOAD_PATH.'template/drive_go.png"> Archive #'.$i.' (ready)</a>'; 441 441 } … … 460 460 if (!file_exists(BATCH_DOWNLOAD_LOCAL . 'u-' .$this->data['user_id']. '/')) 461 461 { 462 mk dir(BATCH_DOWNLOAD_LOCAL . 'u-' .$this->data['user_id']. '/', 0755, true);462 mkgetdir(BATCH_DOWNLOAD_LOCAL . 'u-' .$this->data['user_id']. '/'); 463 463 } 464 464 -
extensions/BatchDownloader/include/install.inc.php
r17660 r18973 28 28 29 29 // archives directory 30 if ( file_exists($conf['data_location']) and !file_exists($conf['data_location'] . 'download_archives/'))30 if ( file_exists($conf['data_location']) ) 31 31 { 32 mk dir($conf['data_location'] . 'download_archives/', 0755);32 mkgetdir($conf['data_location'] . 'download_archives/', MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR); 33 33 } 34 34 -
extensions/BatchDownloader/language/en_UK/plugin.lang.php
r18373 r18973 45 45 $lang['Remove all finished downloads'] = 'Remove all finished downloads'; 46 46 $lang['hours'] = 'hours'; 47 $lang['Starting download Archive #%d will destroy Archive #%d, be sure you finish the download. Continue ?'] = 'Starting download Archive #%d will destroy Archive #%d, be sure you finish the download. Continue ?'; 47 48 48 49 ?> -
extensions/BatchDownloader/language/fr_FR/plugin.lang.php
r18373 r18973 45 45 $lang['Remove all finished downloads'] = 'Supprimer tous les téléchargements terminés'; 46 46 $lang['hours'] = 'heures'; 47 $lang['Starting download Archive #%d will destroy Archive #%d, be sure you finish the download. Continue ?'] = 'Le démarrage du téléchargement de l\'archive #%d détruira l\'archive #%d, soyez sûr de terminer le téléchargement avant de continuer.'; 47 48 48 49 ?> -
extensions/BatchDownloader/main.inc.php
r18291 r18973 13 13 global $conf, $prefixeTable; 14 14 15 define('BATCH_DOWNLOAD_PATH', PHPWG_PLUGINS_PATH . 'BatchDownloader/'); 15 defined('BATCH_DOWNLOAD_ID') or define('BATCH_DOWNLOAD_ID', basename(dirname(__FILE__))); 16 define('BATCH_DOWNLOAD_PATH', PHPWG_PLUGINS_PATH . BATCH_DOWNLOAD_ID . '/'); 16 17 define('BATCH_DOWNLOAD_TSETS', $prefixeTable . 'download_sets'); 17 18 define('BATCH_DOWNLOAD_TIMAGES', $prefixeTable . 'download_sets_images'); 18 19 define('BATCH_DOWNLOAD_LOCAL', PHPWG_ROOT_PATH . $conf['data_location'] . 'download_archives/'); 19 define('BATCH_DOWNLOAD_ADMIN', get_root_url() . 'admin.php?page=plugin- BatchDownloader');20 define('BATCH_DOWNLOAD_ADMIN', get_root_url() . 'admin.php?page=plugin-' . BATCH_DOWNLOAD_ID); 20 21 define('BATCH_DOWNLOAD_PUBLIC', get_absolute_root_url() . make_index_url(array('section' => 'download')) . '/'); 21 22 define('BATCH_DOWNLOAD_VERSION', 'auto'); … … 24 25 add_event_handler('init', 'batch_download_init'); 25 26 26 add_event_handler('loc_end_section_init', 'batch_download_section_init'); 27 add_event_handler('loc_end_index', 'batch_download_page'); 27 if (defined('IN_ADMIN')) 28 { 29 add_event_handler('get_admin_plugin_menu_links', 'batch_download_admin_menu'); 30 } 31 else 32 { 33 add_event_handler('loc_end_section_init', 'batch_download_section_init'); 34 add_event_handler('loc_end_index', 'batch_download_page'); 28 35 29 add_event_handler('loc_end_index', 'batch_download_clean');36 add_event_handler('loc_end_index', 'batch_download_clean'); 30 37 31 add_event_handler('loc_end_index', 'batch_download_index_button', EVENT_HANDLER_PRIORITY_NEUTRAL+10);38 add_event_handler('loc_end_index', 'batch_download_index_button', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 32 39 33 add_event_handler('blockmanager_register_blocks', 'batch_download_add_menublock'); 34 add_event_handler('blockmanager_apply', 'batch_download_applymenu'); 40 add_event_handler('blockmanager_register_blocks', 'batch_download_add_menublock'); 41 add_event_handler('blockmanager_apply', 'batch_download_applymenu'); 42 } 43 35 44 36 45 include_once(BATCH_DOWNLOAD_PATH . 'include/BatchDownloader.class.php'); 37 46 include_once(BATCH_DOWNLOAD_PATH . 'include/functions.inc.php'); 38 47 include_once(BATCH_DOWNLOAD_PATH . 'include/events.inc.php'); 39 40 if (defined('IN_ADMIN'))41 {42 add_event_handler('get_admin_plugin_menu_links', 'batch_download_admin_menu');43 }44 48 45 49 … … 53 57 54 58 if ( 55 $pwg_loaded_plugins['BatchDownloader']['version'] == 'auto' or 56 version_compare($pwg_loaded_plugins['BatchDownloader']['version'], BATCH_DOWNLOAD_VERSION, '<') 59 BATCH_DOWNLOAD_VERSION == 'auto' or 60 $pwg_loaded_plugins[BATCH_DOWNLOAD_ID]['version'] == 'auto' or 61 version_compare($pwg_loaded_plugins[BATCH_DOWNLOAD_ID]['version'], BATCH_DOWNLOAD_VERSION, '<') 57 62 ) 58 63 { … … 60 65 batch_download_install(); 61 66 62 if ( $pwg_loaded_plugins['BatchDownloader']['version'] != 'auto')67 if ( $pwg_loaded_plugins[BATCH_DOWNLOAD_ID]['version'] != 'auto' and BATCH_DOWNLOAD_VERSION != 'auto' ) 63 68 { 64 69 $query = ' 65 70 UPDATE '. PLUGINS_TABLE .' 66 71 SET version = "'. BATCH_DOWNLOAD_VERSION .'" 67 WHERE id = " BatchDownloader"';72 WHERE id = "'. BATCH_DOWNLOAD_ID .'"'; 68 73 pwg_query($query); 69 74 70 $pwg_loaded_plugins[ 'BatchDownloader']['version'] = BATCH_DOWNLOAD_VERSION;75 $pwg_loaded_plugins[BATCH_DOWNLOAD_ID]['version'] = BATCH_DOWNLOAD_VERSION; 71 76 72 77 if (defined('IN_ADMIN')) -
extensions/BatchDownloader/maintain.inc.php
r17656 r18973 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 3 4 include_once(PHPWG_PLUGINS_PATH . 'BatchDownloader/include/install.inc.php'); 4 defined('BATCH_DOWNLOAD_ID') or define('BATCH_DOWNLOAD_ID', basename(dirname(__FILE__))); 5 include_once(PHPWG_PLUGINS_PATH . BATCH_DOWNLOAD_ID . '/include/install.inc.php'); 5 6 6 7 function plugin_install()
Note: See TracChangeset
for help on using the changeset viewer.