Changeset 16592 for extensions/BatchDownloader/include/events.inc.php
- Timestamp:
- Jul 10, 2012, 3:39:01 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/BatchDownloader/include/events.inc.php
r16400 r16592 96 96 } 97 97 98 if ($page['section'] == 'collections') 99 { 100 $url = $_SERVER['REQUEST_URI']; 101 } 102 else 103 { 104 $url = duplicate_index_url(array(), array('action')); 105 } 106 98 107 // toolbar button 99 $button = '<li><a href="'. duplicate_index_url(array(), array('action')).'&action=advdown_set" title="'.l10n('Download all pictures of this selection').'" class="pwg-state-default pwg-button" rel="nofollow">108 $button = '<li><a href="'. $url .'&action=advdown_set" title="'.l10n('Download all pictures of this selection').'" class="pwg-state-default pwg-button" rel="nofollow"> 100 109 <span class="pwg-icon" style="background:url(\'' . BATCH_DOWNLOAD_PATH . 'template/zip.png\') center center no-repeat;"> </span><span class="pwg-button-text">'.l10n('Advanced Downloader').'</span> 101 110 </a></li>'; 102 111 $template->concat('PLUGIN_INDEX_ACTIONS', $button); 112 $template->concat('COLLECTION_ACTIONS', $button); 103 113 } 104 114 … … 178 188 conf_update_param('batch_download', serialize($conf['batch_download'])); 179 189 180 // set old sets as done 190 // set old sets as done and clean images table 181 191 $query = ' 182 SELECT id 183 FROM '.BATCH_DOWNLOAD_TSETS.' 192 DELETE i 193 FROM '.BATCH_DOWNLOAD_TIMAGES.' AS i 194 INNER JOIN '.BATCH_DOWNLOAD_TSETS.' AS s 195 ON i.set_id = s.id 196 WHERE 197 status != "done" AND 198 date_creation < DATE_SUB(NOW(), INTERVAL '.$conf['batch_download']['archive_timeout'].' HOUR) 199 ;'; 200 pwg_query($query); 201 202 $query = ' 203 UPDATE '.BATCH_DOWNLOAD_TSETS.' 204 SET status = "done" 184 205 WHERE 206 status != "done" AND 185 207 date_creation < DATE_SUB(NOW(), INTERVAL '.$conf['batch_download']['archive_timeout'].' HOUR) 186 AND status != "done" 187 ;'; 188 $sets = array_from_query($query, 'id'); 189 190 foreach ($sets as $set_id) 191 { 192 $BatchDownloader = new BatchDownloader($set_id); 193 $BatchDownloader->deleteLastArchive(); 194 $BatchDownloader->clearImages(); 195 $BatchDownloader->updateParam('status', 'done'); 196 } 208 ;'; 209 pwg_query($query); 197 210 198 211 // remove old archives
Note: See TracChangeset
for help on using the changeset viewer.