function statistics_advanced_exit in Statistics Advanced 5
Same name and namespace in other branches
- 6 statistics_advanced.module \statistics_advanced_exit()
Implementation of hook_exit().
File
- ./
statistics_advanced.module, line 86
Code
function statistics_advanced_exit() {
// If this is a repeated visit by same user to the same node, subtract 1
// visit from the node's view counter
if ($GLOBALS['_statistics_advanced_ignore_visit'] == TRUE) {
db_query('UPDATE {node_counter} SET daycount = daycount - 1, totalcount = totalcount - 1 WHERE nid = %d', arg(1));
}
// Remove access logs for current user
$ignored_roles = variable_get('statistics_advanced_ignore_user_roles', array());
if ($GLOBALS['user']->uid != 0 && !empty($ignored_roles) && variable_get('statistics_enable_access_log', 0) && (bool) array_intersect($ignored_roles, array_keys($user->roles))) {
db_query('DELETE FROM {accesslog} WHERE uid = %d', $user->uid);
}
}