function visitors_exit in Visitors 7.0
Same name and namespace in other branches
- 8 visitors.exit.inc \visitors_exit()
- 7.2 visitors.exit.inc \visitors_exit()
- 7 visitors.exit.inc \visitors_exit()
Implements of hook_exit().
File
- ./
visitors.exit.inc, line 117 - Implements of hook_exit().
Code
function visitors_exit() {
drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
drupal_load('module', 'user');
global $user;
$not_admin = !in_array('administrator', $user->roles);
$log_admin = !variable_get('visitors_exclude_administer_users', 0);
if ($log_admin || $not_admin) {
db_insert('visitors')
->fields(array(
'visitors_uid' => $user->uid,
'visitors_ip' => visitors_get_ip_str(),
'visitors_date_time' => time(),
'visitors_url' => visitors_get_url(),
'visitors_referer' => visitors_get_referer(),
'visitors_path' => visitors_get_path(),
'visitors_title' => visitors_get_title(),
'visitors_user_agent' => visitors_get_user_agent(),
))
->execute();
}
}