function boost_stats_init in Boost 6
1 call to boost_stats_init()
- boost_stats.php in stats/boost_stats.php
- Place in webroot, for faster stats if needed.
File
- stats/boost_stats.php, line 84
- Place in webroot, for faster stats if needed.
Code
function boost_stats_init() {
global $nid, $title, $q, $referer, $session_id, $uid, $count_views, $access_log, $variables;
include_once './includes/bootstrap.inc';
include_once './includes/common.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
$nid = isset($_GET['nid']) && is_numeric($_GET['nid']) ? $_GET['nid'] : NULL;
$title = isset($_GET['title']) && $_GET['title'] != 'NULL' ? urldecode($_GET['title']) : NULL;
$q = isset($_GET['qq']) && $_GET['qq'] != 'NULL' ? $_GET['qq'] : NULL;
$referer = isset($_GET['referer']) ? $_GET['referer'] : NULL;
$session_id = session_id();
if (empty($session_id)) {
if (empty($_COOKIE[session_name()])) {
if (empty($_SERVER['HTTP_USER_AGENT'])) {
$session_id = md5(ip_address());
}
else {
$session_id = md5($_SERVER['HTTP_USER_AGENT'] . ip_address());
}
}
else {
$session_id = $_COOKIE[session_name()];
}
}
$uid = 0;
$result = db_query("\nSELECT * FROM {variable}\nWHERE name LIKE 'boost_%'\nOR name LIKE 'statistics_%'\nOR name LIKE 'throttle_%'\n");
while ($variable = db_fetch_object($result)) {
$variables[$variable->name] = unserialize($variable->value);
}
}