Ignore:
Timestamp:
07/04/13 21:45:21 (6 years ago)
Author:
plg
Message:

increase counter of each photo inside a batch download

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/download_counter/main.inc.php

    r23743 r23774  
    116116  return $content; 
    117117} 
     118 
     119/** 
     120 * increase counter of each photo inside a batch download 
     121 */ 
     122add_event_handler('batchdownload_end_zip', 'dlcount_batchdownload', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
     123function dlcount_batchdownload($data, $images) 
     124{ 
     125  if (count($images) > 0) 
     126  { 
     127    $query = ' 
     128UPDATE '.IMAGES_TABLE.' 
     129  SET download_counter = download_counter + 1 
     130  WHERE id IN ('.implode(',', $images).') 
     131;'; 
     132    pwg_query($query); 
     133  } 
     134} 
    118135?> 
Note: See TracChangeset for help on using the changeset viewer.