Location: PHPKode > projects > CNStats > cnstats/cnt-combined.php
<?php define("ISCNSTATS","1");include dirname(__FILE__)."/includes/functions.php";include dirname(__FILE__)."/includes/db.php";if(isset($STATS_CONF["disabled"]))if($STATS_CONF["disabled"]=="yes"){header("Pragma: no-cache");header("Cache-control: no-cache");header("Content-type: image/gif");$_5caea3f9=pack("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC",0x47,0x49,0x46,0x38,0x39,0x61,0x01,0x00,0x01,0x00,0x80,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x21,0xF9,0x04,0x01,0x00,0x00,0x00,0x00,0x2C,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x02,0x02,0x44,0x01,0x00,0x3B);print$_5caea3f9;return;}error_reporting(E_ALL&~E_NOTICE);if(empty($STATS_CONF["cookieprefix"]))$STATS_CONF["cookieprefix"]="cns";if(empty($STATS_CONF["session_time"]))$STATS_CONF["session_time"]=900;$_daa937b9=intval($_COOKIE[$STATS_CONF["cookieprefix"]."cc"]);if($_GET["second"]!="1"&&$_daa937b9==0){header("P3P: policyref=\"/w3c/p3p.xml\", CP=\"UNI\"");setcookie($STATS_CONF["cookieprefix"]."cc",time(),mktime(23,59,59,date("m"),date("d"),date("Y")+1),"/",$STATS_CONF["cookiedomain"]);header("Location: ./cnt-combined.php?second=1&".$_SERVER["QUERY_STRING"]);header("Content-Length: 31");header("Pragma: no-cache");header("Cache-control: no-cache");print"<html><body>Moved</body></html>";exit;}function _1424f089($_8cfe579f){return !strlen(trim($_9ebeb2a9,"1234567890abcdefABCDEF"));}function _c4e24300($_f47645ae){GLOBAL$STATS_CONF;if(!isset($STATS_CONF["sitecharset"]))$STATS_CONF["sitecharset"]="ISO-8859-1";$_f18ac390="";$_e66c3671=0;$_9606c2fe=strlen($_f47645ae);do{$_76d32be0=false;if($_e66c3671<$_9606c2fe-5){if($_f47645ae[$_e66c3671]=="%"&&$_f47645ae[$_e66c3671+1]=="u"&&_1424f089($_f47645ae[$_e66c3671+2])&&_1424f089($_f47645ae[$_e66c3671+3])&&_1424f089($_f47645ae[$_e66c3671+4])&&_1424f089($_f47645ae[$_e66c3671+5])){$_1d775834=hexdec(substr($_f47645ae,$_e66c3671+2,4));if($_1d775834<0x0080){$_f18ac390.=chr($_1d775834);}elseif($_1d775834<0x0800){$_f18ac390.=chr((($_1d775834&0x07c0)>>6)|0xc0);$_f18ac390.=chr(($_1d775834&0x3f)|0x80);}else{$_f18ac390.=chr((($_1d775834&0xf000)>>12)|0xe0);$_f18ac390.=chr((($_1d775834&0x0fc0)>>6)|0x80);$_f18ac390.=chr(($_1d775834&0x3f)|0x80);}$_e66c3671+=6;$_76d32be0=true;}}if(!$_76d32be0){if($_e66c3671<$_9606c2fe-2){if($_f47645ae[$_e66c3671]=="%"&&_1424f089($_f47645ae[$_e66c3671+1])&&_1424f089($_f47645ae[$_e66c3671+2])){$_1d775834=hexdec(substr($_f47645ae,$_e66c3671+1,2));if($_1d775834>=127){$_f18ac390.=iconv($STATS_CONF["sitecharset"],"utf-8",chr($_1d775834));}else$_f18ac390.=chr($_1d775834);$_e66c3671+=3;$_76d32be0=true;}}}if(!$_76d32be0){$_f18ac390.=iconv($STATS_CONF["sitecharset"],"utf-8",$_f47645ae[$_e66c3671]);$_e66c3671++;}}while($_e66c3671<$_9606c2fe);return $_f18ac390;}if($_daa937b9!=0)$_daa937b9=true;else$_daa937b9=false;$_bf396750=intval($_GET["i"]);if($_bf396750!=0&&$_GET["p"]!="' escape(cnsd.location) '"){if($_daa937b9==1){$_6c09ff9d=$GLOBALS["cnstats_db"]->_74cff91f($STATS_CONF["sqlhost"],$STATS_CONF["sqluser"],$STATS_CONF["sqlpassword"],$STATS_CONF["dbname"]);if(!$_6c09ff9d)return;if(substr($_GET["p"],0,9)=="http%3A//"){$_GET["p"]=urldecode($_GET["p"]);$_GET["t"]=urldecode($_GET["t"]);}if($_GET["p"]!="undefined"&&!empty($_GET["p"]))$_6eeccc4d="page='".$GLOBALS["cnstats_db"]->escape(urlencode(htmlspecialchars(StripSlashes($_GET["p"]))))."',";if($_GET["r"]!="undefined"&&!empty($_GET["r"]))$_c4e504c6="referer='".$GLOBALS["cnstats_db"]->escape($_GET["r"])."',";if($_GET["t"]!="undefined"&&!empty($_GET["t"])){$_2b36786b=$_GET["t"];$_2b36786b=_c4e24300($_2b36786b);$_2b36786b=_6b85cf5a($_2b36786b);$_2b36786b=substr($_2b36786b,0,255);}if($_GET["e"]!="undefined"&&!empty($_GET["e"])){$_82079eb1=strpos($_GET["e"],".");if($_82079eb1>0)$_79b2da48=(intval(substr($_GET["e"],0,$_82079eb1))<<16)+intval(substr($_GET["e"],$_82079eb1+1));else$_79b2da48=0;$_c4e504c6="res='".$GLOBALS["cnstats_db"]->escape($_79b2da48)."',";}if($_GET["d"]!="undefined"&&!empty($_GET["d"])){$_b1970c85=" depth='".intval($_GET["d"])."',";}$_8c29be51=$_3329fcf8=$_797e6294=false;if(!isset($COUNTER["HTTPheaders"]["P3P"]))@header("P3P: policyref=\"/w3c/p3p.xml\", CP=\"UNI\"");else{if(@is_array($COUNTER["HTTPheaders"])){foreach($COUNTER["HTTPheaders"]as$_0862575d=>$_6b643b84)@header($_0862575d.": ".$_6b643b84);}}$_f65f1be0="user";$_797e6294=false;$_a76ed395=intval($_COOKIE[$STATS_CONF["cookieprefix"]."user_id"]);if($_a76ed395==0){$_a76ed395=crc32($_SERVER["REMOTE_ADDR"].$_SERVER["HTTP_X_FORWARDED_FOR"].microtime());$_797e6294=true;}$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT GET_LOCK('cnstatslock',60);");if(!$_797e6294){$_6c09ff9d=$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT uid, sid, last_visit, pagenumber FROM ".$STATS_CONF["sqlprefix"]."uid WHERE user_id='".$_a76ed395."';");if($_e8b7be43=$GLOBALS["cnstats_db"]->_ef336f8e($_6c09ff9d)){$_539b0606=$_e8b7be43["uid"];$_57167ab4=$_e8b7be43["sid"];$_7a290c1e=$_e8b7be43["pagenumber"]+1;$_2135df22=$_e8b7be43["last_visit"];unset($_e8b7be43);}else{$_a76ed395=crc32($_SERVER["REMOTE_ADDR"].$_SERVER["HTTP_X_FORWARDED_FOR"].microtime());$_797e6294=true;}$GLOBALS["cnstats_db"]->_d8902be8($_6c09ff9d);}if($_797e6294){$_0d0e09b1=$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT max(uid), max(sid) FROM ".$STATS_CONF["sqlprefix"]."uid;");if($_0d0e09b1){if($_e8b7be43=$GLOBALS["cnstats_db"]->_35acb628($_0d0e09b1)){$_539b0606=$_e8b7be43[0]+1;$_57167ab4=$_e8b7be43[1]+1;}$GLOBALS["cnstats_db"]->_d8902be8($_0d0e09b1);}$_8c29be51=true;$_3329fcf8=true;$GLOBALS["cnstats_db"]->_24bdb5eb("INSERT INTO ".$STATS_CONF["sqlprefix"]."uid SET user_id='".$_a76ed395."', uid='".$_539b0606."', sid='".$_57167ab4."', last_visit='".time()."', pagenumber=1;");}else{$_59323c7f="";if(time()-$_2135df22>$STATS_CONF["session_time"]){$_0d0e09b1=$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT max(sid) FROM ".$STATS_CONF["sqlprefix"]."uid;");if($_0d0e09b1){if($_e8b7be43=$GLOBALS["cnstats_db"]->_35acb628($_0d0e09b1)){$_57167ab4=$_e8b7be43[0]+1;unset($_e8b7be43);}$GLOBALS["cnstats_db"]->_d8902be8($_0d0e09b1);}$_3329fcf8=true;$_59323c7f.=", sid='".$_57167ab4."'";$_7a290c1e=1;}if($_2135df22<mktime(0,0,0,date("m"),date("d"),date("Y"))){$_0d0e09b1=$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT max(uid) FROM ".$STATS_CONF["sqlprefix"]."uid;");if($_0d0e09b1){if($_e8b7be43=$GLOBALS["cnstats_db"]->_35acb628($_0d0e09b1)){$_539b0606=$_e8b7be43[0]+1;unset($_e8b7be43);}$GLOBALS["cnstats_db"]->_d8902be8($_0d0e09b1);}$_8c29be51=true;$_59323c7f.=", uid='".$_539b0606."'";}$GLOBALS["cnstats_db"]->_24bdb5eb("UPDATE ".$STATS_CONF["sqlprefix"]."uid SET pagenumber='".$_7a290c1e."', last_visit='".time()."' ".$_59323c7f." WHERE user_id='".$_a76ed395."';");}$_17f4ec1b=time()-$_2135df22;if($_17f4ec1b<0||$_17f4ec1b>31536000)$_17f4ec1b=-1;if(isset($STATS_CONF["cookiedomain"])){@header("P3P: policyref=\"/w3c/p3p.xml\", CP=\"UNI\"");@setcookie($STATS_CONF["cookieprefix"]."user_id",$_a76ed395,mktime(23,59,59,date("m"),date("d"),date("Y")+1),"/",$STATS_CONF["cookiedomain"]);}else{@header("P3P: policyref=\"/w3c/p3p.xml\", CP=\"UNI\"");@setcookie($STATS_CONF["cookieprefix"]."user_id",$_a76ed395,mktime(23,59,59,date("m"),date("d"),date("Y")+1),"/");}$_f1d853fc=false;$_f876557d=false;$_dbd66adf="SELECT imagedate,unique_host,is404,isrss FROM ".$STATS_CONF["sqlprefix"]."log WHERE id='".intval($_GET["i"])."';";$_0d0e09b1=$GLOBALS["cnstats_db"]->_24bdb5eb($_dbd66adf);if($_0d0e09b1){if($_e8b7be43=$GLOBALS["cnstats_db"]->_ef336f8e($_0d0e09b1)){if($_e8b7be43["unique_host"]=="yes")$_cd8908fa=true;else$_cd8908fa=false;if($_e8b7be43["imagedate"]!="0000-00-00 00:00:00")$_f1d853fc=true;if($_e8b7be43["is404"]=="yes"||$_e8b7be43["isrss"]=="yes")$_f876557d=true;unset($_e8b7be43);}$GLOBALS["cnstats_db"]->_d8902be8($_0d0e09b1);}if(!$_f1d853fc&&!$_f876557d){$_462e9182="";if(isset($_GET["uf1"]))$_462e9182.=" userfield1='".$GLOBALS["cnstats_db"]->escape($_GET["uf1"])."', ";if(isset($_GET["uf2"]))$_462e9182.=" userfield1=2".$GLOBALS["cnstats_db"]->escape($_GET["uf2"])."', ";if(isset($_GET["uf3"]))$_462e9182.=" userfield1=3".$GLOBALS["cnstats_db"]->escape($_GET["uf3"])."', ";$_dbd66adf="UPDATE ".$STATS_CONF["sqlprefix"]."log SET id_user='".$_a76ed395."', uid='".$_539b0606."', sid='".$_57167ab4."', unique_user='".($_8c29be51?"yes":"no")."', unique_session='".($_3329fcf8?"yes":"no")."', ".$_6eeccc4d.$_c4e504c6.$_b1970c85." title='".$GLOBALS["cnstats_db"]->escape($_2b36786b)."', isrobot='user', pagenumber='".$_7a290c1e."', prevdate='".$_17f4ec1b."', ".$_462e9182." imagedate=NOW() WHERE id='".intval($_GET["i"])."';";$GLOBALS["cnstats_db"]->_24bdb5eb($_dbd66adf);$_018dbdae="u_hits=u_hits+1, t_u_hits=t_u_hits+1, r_hits=r_hits-1, t_r_hits=t_r_hits-1";if(!$_8c29be51)$_1af97c7a="";else$_1af97c7a=", u_users=u_users+1, t_u_users=t_u_users+1";if(!$_cd8908fa)$_a22f7e6a="";else$_a22f7e6a=", u_hosts=u_hosts+1, t_u_hosts=t_u_hosts+1, r_hosts=r_hosts-1, t_r_hosts=t_r_hosts-1";if(!$_3329fcf8)$_dca84330="";else$_dca84330=", u_sessions=u_sessions+1, t_u_sessions=t_u_sessions+1";$_dbd66adf=trim($_018dbdae." ".$_a22f7e6a." ".$_1af97c7a." ".$_dca84330);if(!empty($_dbd66adf))$GLOBALS["cnstats_db"]->_24bdb5eb("UPDATE ".$STATS_CONF["sqlprefix"]."counter SET ".$_dbd66adf.";");}}}header("Pragma: no-cache");header("Cache-control: no-cache");header("Content-type: image/gif");$_5caea3f9=pack("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC",0x47,0x49,0x46,0x38,0x39,0x61,0x01,0x00,0x01,0x00,0x80,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x21,0xF9,0x04,0x01,0x00,0x00,0x00,0x00,0x2C,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x02,0x02,0x44,0x01,0x00,0x3B);print$_5caea3f9;?>
Return current item: CNStats