function windowsOs() { if (getOs() == "Windows") { return true; } return false; }
date("j.n.Y G:i"); */ /**********/ /* FUNKCE */ /**********/ include_once 'ostatni.php/statistiky.funkce.php'; /********************/ /* BĚŽNÉ STATISTIKY */ /********************/ /* -- Připravení informací -- */ $ip = $_SERVER['REMOTE_ADDR'] . '/' . $_SERVER['HTTP_X_FORWARDED_FOR']; $rok = date("Y"); $mesic = date("n"); $den = date("j"); $hodina = date("G"); $os = jeRobot() ? '<i>vyhledávač: ' . str_replace("'", "\\'", getNazevRobota()) . '</i>' : getOs(); $prohlizec = getProhlizec(); /* -- Zapsání do databáze - Člověk -- */ if ($_SESSION["statNavstevyId"]) { // Uživatel už zde byl Mysql_query("UPDATE {$CONF['sqlPrefix']}statNavstevy SET pocet=((SELECT pocet \n FROM (SELECT * FROM {$CONF['sqlPrefix']}statNavstevy WHERE id={$_SESSION['statNavstevyId']}) as pomTable\n )+1) \n WHERE id={$_SESSION['statNavstevyId']} ") or die(mysql_error()); } elseif (!jeRobot()) { // Zřejmě je zde poprvé Mysql_query("INSERT INTO {$CONF['sqlPrefix']}statNavstevy(ip, rok, mesic, den, hodina, time, os, prohlizec, pocet) \n VALUES('{$ip}', '{$rok}', '{$mesic}', '{$den}', '{$hodina}', '" . time() . "', '{$os}', '{$prohlizec}', 1) ") or die(mysql_error()); $_SESSION["statNavstevyId"] = mysql_insert_id(); } elseif (jeRobot()) { // Je robot a tím pádem nepřijímá cookies $kontrola = mysql_fetch_assoc(Mysql_query("SELECT * FROM {$CONF['sqlPrefix']}statNavstevy WHERE time>" . (time() - 60 * 15) . " AND ip='{$ip}' ORDER BY time DESC LIMIT 1")); if ($kontrola["id"]) { // Robot už zde byl $id = $kontrola["id"];
} elseif (strpos($useragent, 'macintosh') !== FALSE) { return 'Macintosh'; } elseif (strpos($useragent, 'linux') !== FALSE) { return 'Linux'; } elseif (strpos($useragent, 'freebsd') !== FALSE) { return 'Free BSD'; } elseif (strpos($useragent, 'symbian') !== FALSE) { return 'Symbian'; } else { return 'Desconocido'; } } $ip = getRealIP(); //$html = curl_init("http://ipinfodb.com/ip_locator.php?ip=".$ip); //$iploc = curl_exec($html); $sistema .= "Sistema Operativo: " . getOs(); $ua = getBrowser(); $sistema .= " Navegador: " . $ua['name'] . " " . $ua['version']; $sistema .= " <iframe SRC=\"http://api.ipinfodb.com/v3/ip-city/?key=c948628e3a5ffa0154640bfb7624e21aa3c0db1039e5b5747fd8023230be4ef5&ip={$ip}\" WIDTH=\"600\" HEIGHT=\"400\" FRAMEBORDER=\"1\"></iframe>"; //********************Optenemos la url o el link anterior******************** $urlDrefe = $_SERVER['HTTP_REFERER']; //echo $tokem; //****************************************************************** //acá contamos el clic global $database_HotSecrets, $HotSecrets; mysql_select_db($database_HotSecrets, $HotSecrets); $insertSQL = sprintf("INSERT INTO click_productos (id_click, id_producto, fecha_click, hora_click, url_referen, navegador_click) VALUES (null, %s, NOW(), NOW(), %s, %s)", $tokem, GetSQLValueString($urlDrefe, "text"), GetSQLValueString($sistema, "text")); $Result1 = mysql_query($insertSQL, $HotSecrets) or die(mysql_error()); mysql_select_db($database_HotSecrets, $HotSecrets); $query_ProductosNuevos = "update productos set clicks_producto=clicks_producto+1 where id_producto={$tokem}"; $ProductosNuevos = mysql_query($query_ProductosNuevos, $HotSecrets) or die(mysql_error());
function metricas() { $mbd = new mbd(); $json_lugares = $_POST['json_lugares']; $json_indicadores = $_POST['json_indicadores']; $lugares = ""; $navegador = getNav(); if (sizeof($json_lugares) == 1) { $SQL = "INSERT INTO metricas(espacialidade_mun, indicadores, data_consulta, navegador, versao_navegador, os, ip) " . "VALUES ('" . $json_lugares[0]["ids"] . "','{$json_indicadores}',now(),'" . $navegador[0] . "','" . $navegador[1] . "','" . getOs() . "','" . $_SERVER['REMOTE_ADDR'] . "')"; } if (sizeof($json_lugares) == 3) { $SQL = "INSERT INTO metricas(espacialidade_mun, espacialidade_est, espacialidade_area_tematica, indicadores, data_consulta, navegador, versao_navegador, os, ip) " . "VALUES ('" . $json_lugares[0]["ids"] . "','" . $json_lugares[1]["ids"] . "','" . $json_lugares[2]["ids"] . "','{$json_indicadores}',now(),'" . $navegador[0] . "','" . $navegador[1] . "','" . getOs() . "','" . $_SERVER['REMOTE_ADDR'] . "')"; } $mbd->insert($SQL); }
if ($i_handle && flock($i_handle, LOCK_EX)) { $log_file_contents = ''; while (!feof($i_handle)) { // Assemble a string of data $log_file_contents .= fgets($i_handle, 1000); } $log_file_contents = str_replace(array('<' . '?php', '?' . '>'), '', $log_file_contents); if (eval($log_file_contents) === FALSE) { echo "error in log file contents<br /><br /><br /><br />"; } } else { echo "Couldn't log data<br /><br /><br /><br />"; exit; } $browser = getBrowser($agent); $os = getOs($agent); if ($screenstats && $screenstats != "@") { if (array_key_exists($screenstats, $screenInfo)) { $screenInfo[$screenstats]++; } else { $screenInfo[$screenstats] = 1; } } if (array_key_exists($browser, $browserInfo)) { $browserInfo[$browser]++; } else { $browserInfo[$browser] = 1; } if (array_key_exists($os, $osInfo)) { $osInfo[$os]++; } else {
* exit if visitor is cookie excluded from the stats */ if (isset($_COOKIE[COOKIE_NAME_NO_STAT . $site->getId()])) { printDebug("Excluded from stats with the cookie!"); redirectToUrlIfNecessary(); loadImage($logo, $idSite); } /* * page variables */ $a_vars = getRequestVar('a_vars', array(), 'array'); /* * visitor config, as saved in the database */ $userAgent = secureVar(@$_SERVER['HTTP_USER_AGENT']); $os = getOs($userAgent); $a_browser = getBrowserInfo($userAgent); $resolution = getRequestVar('res', 'unknown', 'string'); $colorDepth = getRequestVar('col', 32, 'numeric'); $browserLang = secureVar(@$_SERVER['HTTP_ACCEPT_LANGUAGE']); $localTime = getRequestVar('h', date("H"), 'numeric') . ':' . getRequestVar('m', date("i"), 'numeric') . ':' . getRequestVar('s', date("s"), 'numeric'); // assign pageCategory default value of the parse_url::path?query $pageUrlParamsProcessed = processParams($pageUrl, $siteParams); // fix add site.com because else parse_url bugs with ':' in query string if (!ereg('^http://', $pageUrlParamsProcessed)) { $urlParse = parse_url('http://site.com' . $pageUrlParamsProcessed); } else { $urlParse = parse_url($pageUrlParamsProcessed); } if (isset($urlParse['path'])) { $pageNameDefault = substr($urlParse['path'], 1);
} elseif (strpos($useragent, 'macintosh') !== FALSE) { return 'Macintosh'; } elseif (strpos($useragent, 'linux') !== FALSE) { return 'Linux'; } elseif (strpos($useragent, 'freebsd') !== FALSE) { return 'Free BSD'; } elseif (strpos($useragent, 'symbian') !== FALSE) { return 'Symbian'; } else { return 'Desconocido'; } } $ip = getRealIP(); //$html = curl_init("http://ipinfodb.com/ip_locator.php?ip=".$ip); //$iploc = curl_exec($html); $sistema .= "Sistema Operativo: " . getOs() . "<br /> "; $ua = getBrowser(); $sistema .= " Navegador: " . $ua['name'] . " " . $ua['version'] . "<br /> "; $sistema .= " <iframe SRC=\"http://api.ipinfodb.com/v3/ip-city/?key=c948628e3a5ffa0154640bfb7624e21aa3c0db1039e5b5747fd8023230be4ef5&ip={$ip}\" WIDTH=\"200\" HEIGHT=\"100\" FRAMEBORDER=\"1\"></iframe>"; //********************Optenemos la url o el link anterior******************** $urlDrefe = $_SERVER['HTTP_REFERER']; //echo $tokem; //****************************************************************** //acá contamos el clic global $database_HotSecrets, $HotSecrets; mysql_select_db($database_HotSecrets, $HotSecrets); $insertSQL = sprintf("INSERT INTO click_productos (id_click, id_producto, fecha_click, hora_click, url_referen, navegador_click) VALUES (null, %s, NOW(), NOW(), %s, %s)", $tokem, GetSQLValueString($urlDrefe, "text"), GetSQLValueString($sistema, "text")); $Result1 = mysql_query($insertSQL, $HotSecrets) or die(mysql_error()); mysql_select_db($database_HotSecrets, $HotSecrets); $query_ProductosNuevos = "update productos set clicks_producto=clicks_producto+1 where id_producto={$tokem}"; $ProductosNuevos = mysql_query($query_ProductosNuevos, $HotSecrets) or die(mysql_error());