Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

update_hitcount()

Parameters

ColumnTypeDefaultDescription
$ref

Location

include/resource_functions.php lines 603 to 613

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 19th March 2024 11:35 Europe/London time based on the source file dated 11th March 2024 14:25 Europe/London time.