Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

update_hitcount()

Parameters

ColumnTypeDefaultDescription
$ref

Location

include/resource_functions.php lines 508 to 518

Definition

 
function update_hitcount($ref)
    {
    global 
$resource_hit_count_on_downloads;
    
    
# update hit count if not 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='$ref'",false,-1,true,0);
        }
    }   

This article was last updated 7th July 2020 11:05 Europe/London time based on the source file dated 6th July 2020 18:09 Europe/London time.