Changeset 25932 for extensions/BatchDownloader/main.inc.php
- Timestamp:
- Dec 12, 2013, 2:41:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/BatchDownloader/main.inc.php
r23589 r25932 1 <?php 1 <?php 2 2 /* 3 3 Plugin Name: Batch Downloader … … 33 33 { 34 34 add_event_handler('init', 'batch_downloader_remove_image'); 35 35 36 36 add_event_handler('loc_end_section_init', 'batch_download_section_init'); 37 37 add_event_handler('loc_end_index', 'batch_download_page'); … … 40 40 41 41 add_event_handler('loc_end_index', 'batch_download_index_button', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 42 } 42 43 43 add_event_handler('blockmanager_register_blocks', 'batch_download_add_menublock'); 44 add_event_handler('blockmanager_apply', 'batch_download_applymenu'); 45 } 44 add_event_handler('blockmanager_register_blocks', 'batch_download_add_menublock'); 45 add_event_handler('blockmanager_apply', 'batch_download_applymenu'); 46 46 47 47 … … 57 57 function batch_download_init() 58 58 { 59 global $conf, $pwg_loaded_plugins; 60 61 if ( 62 BATCH_DOWNLOAD_VERSION == 'auto' or 63 $pwg_loaded_plugins[BATCH_DOWNLOAD_ID]['version'] == 'auto' or 64 version_compare($pwg_loaded_plugins[BATCH_DOWNLOAD_ID]['version'], BATCH_DOWNLOAD_VERSION, '<') 65 ) 66 { 67 include_once(BATCH_DOWNLOAD_PATH . 'include/install.inc.php'); 68 batch_download_install(); 69 70 if ( $pwg_loaded_plugins[BATCH_DOWNLOAD_ID]['version'] != 'auto' and BATCH_DOWNLOAD_VERSION != 'auto' ) 71 { 72 $query = ' 73 UPDATE '. PLUGINS_TABLE .' 74 SET version = "'. BATCH_DOWNLOAD_VERSION .'" 75 WHERE id = "'. BATCH_DOWNLOAD_ID .'"'; 76 pwg_query($query); 77 78 $pwg_loaded_plugins[BATCH_DOWNLOAD_ID]['version'] = BATCH_DOWNLOAD_VERSION; 79 80 if (defined('IN_ADMIN')) 81 { 82 $_SESSION['page_infos'][] = 'BatchDownloader updated to version '. BATCH_DOWNLOAD_VERSION; 83 } 84 } 85 } 86 59 global $conf; 60 61 include_once(BATCH_DOWNLOAD_PATH . 'maintain.inc.php'); 62 $maintain = new BatchDownloader_maintain(BATCH_DOWNLOAD_ID); 63 $maintain->autoUpdate(BATCH_DOWNLOAD_VERSION, 'install'); 64 87 65 $conf['batch_download'] = unserialize($conf['batch_download']); 88 66 $conf['batch_download']['file_pattern'] = isset($conf['batch_download_file_pattern']) ? $conf['batch_download_file_pattern'] : '%id%_%filename%_%dimensions%'; … … 92 70 $conf['batch_download']['allowed_ext'] = array_merge($conf['batch_download']['allowed_ext'], $conf['batch_download_additional_ext']); 93 71 } 94 72 95 73 load_language('plugin.lang', BATCH_DOWNLOAD_PATH); 96 74 } … … 99 77 * admin plugins menu 100 78 */ 101 function batch_download_admin_menu($menu) 79 function batch_download_admin_menu($menu) 102 80 { 103 array_push($menu,array(81 $menu[] = array( 104 82 'NAME' => 'Batch Downloader', 105 83 'URL' => BATCH_DOWNLOAD_ADMIN, 106 ) );84 ); 107 85 return $menu; 108 86 } 109 110 ?>
Note: See TracChangeset
for help on using the changeset viewer.