Collections functions
Encryption functions
General functions
Theme permission 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
$deletion_array array

Return

void

Location

include/collections_functions.php lines 3582 to 3600

Definition

 
function collection_download_log_resource_ready($tmpfile, &$deletion_array$ref)
    {
    global 
$usage$usagecomment$size$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($ref,'d',0,$usagecomment,"","", (int) $usage,$size);
    
    
# 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).
        
sql_query("update resource set new_hit_count=greatest(hit_count,new_hit_count)+1 where ref='" escape_check($ref) . "'");
        }

    return;
    }

This article was last updated 15th July 2020 07:05 Europe/London time based on the source file dated 14th July 2020 15:34 Europe/London time.