You are here

function browscap_unmonitor in Browscap 5

File

./browscap.module, line 350
Replacement for PHP's get_browser() function

Code

function browscap_unmonitor() {

  // No point if statistics aren't enabled
  if (!module_exists('statistics')) {
    return;
  }

  // If monitoring is enabled, unrecord the browser
  if (variable_get('browscap_monitor', FALSE)) {
    $browser = browscap_get_browser();
    $browserstring = trim($browser->parent);
    if ($browserstring == '' or $browserstring == 'Default Browser') {
      $browserstring = trim($_SERVER['HTTP_USER_AGENT']);
    }
    db_query("UPDATE {browscap_statistics} SET counter = counter - 1, is_crawler=%d " . "WHERE parent='%s'", $browser->crawler, $browserstring);
  }
}