Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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
$email string ""
$deletion_array array
ID string of size requested e.g. "" for original, "scr", "pre" etc.

Return

void

Location

include/collections_functions.php lines 4864 to 4881

Definition

 
function collection_download_log_resource_ready($tmpfile, &$deletion_array$ref$sizestring $email "")
    {
    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);
    
$email_add_to_log = ($email != "") ? ' Downloaded by ' $email "";
    
resource_log($refLOG_CODE_DOWNLOADED0$usagecomment $email_add_to_log"""", (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 4th December 2024 08:35 Europe/London time based on the source file dated 27th November 2024 15:30 Europe/London time.