Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

collection_download_log_resource_ready()

Description

Update the resource log to show the download during a collection download.

Parameters

ColumnTypeDefaultDescription
$tmpfile string
&$deletion_array
$ref integer The resource ID
$size
$deletion_array array
ID string of size requested e.g. "" for original, "scr", "pre" etc.

Return

void

Location

include/collections_functions.php lines 4821 to 4837

Definition

 
function collection_download_log_resource_ready($tmpfile, &$deletion_array$ref$size)
    {
    global 
$usage$usagecomment$resource_hit_count_on_downloads;

    
# build an array of paths so we can clean up any exiftool-modified files.
    
if($tmpfile!==false && file_exists($tmpfile)){$deletion_array[]=$tmpfile;}

    
daily_stat("Resource download"$ref);
    
resource_log($refLOG_CODE_DOWNLOADED0$usagecomment"""", (int) $usage);
    
    
# update hit count if tracking downloads only
    
if ($resource_hit_count_on_downloads)
        { 
        
# greatest() is used so the value is taken from the hit_count column in the event that new_hit_count is zero to support installations that did not previously have a new_hit_count column (i.e. upgrade compatability).
        
ps_query("update resource set new_hit_count=greatest(hit_count,new_hit_count)+1 where ref=?",array("i",$ref));
        }
    }

This article was last updated 19th March 2024 06:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.