Collections functions
General functions
Render functions
Theme permission functions
Resource functions

update_hitcount()

Parameters

ColumnTypeDefaultDescription
$ref

Location

include/resource_functions.php lines 557 to 567

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).
        
ps_query("update resource set new_hit_count=greatest(hit_count,new_hit_count)+1 where ref=?",array("i",$ref),false,-1,true,0);
        }
    }

This article was last updated 4th October 2022 12:05 Europe/London time based on the source file dated 30th September 2022 14:20 Europe/London time.