Is support for counting every view (ie not unique to the ip address) going to be added into the function or should I create my own function to do this?
Thanks
/**
* Count a hit for a module item with user tracking
*
* @param string $module Module to check unique hit for
* @param string $iid Unique Item ID
* @param string $name Type of count to store
* @param int $amount Amount to increment counter by
* @param bool $unique Check IP Address if true
* @return bool
*/
function jrCore_counter($module, $iid, $name, $amount = 1, $unique = true){
// Our steps:
// - check IP status of hitting user
// - if user passes IP check, increment daily count
$iid = intval($iid);
if (jrCore_counter_is_unique_viewer($module, $iid, $name)) {
return jrCore_db_increment_key($module, $iid, "{$name}_count", intval($amount));
}
return true;
}
--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
updated by @ultrajam: 12/09/13 04:52:58PM