Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

update_hitcount()

Parameters

ColumnTypeDefaultDescription
$ref

Location

include/resource_functions.php lines 545 to 555

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 29th November 2020 05:05 Europe/London time based on the source file dated 27th November 2020 14:50 Europe/London time.