Location: PHPKode > projects > CNStats > cnstats/cnt.php
<?php $CNSTATS_OLD_ERROR_REPORTING=error_reporting(E_ALL&~E_NOTICE);$CNSTATS_OLD_USER_ABORT=ignore_user_abort(true);define("ISCNSTATS","1");include dirname(__FILE__)."/includes/db.php";function _f0769e75(){GLOBAL$COUNTER,$STATS_CONF;$_d1f99aaf=1;include_once dirname(__FILE__)."/mail.php";}function _f90807e6(){global$COUNTER,$STATS_CONF;$GLOBALS["cnstats_db"]->_a9cde373(true);$_6c09ff9d=$GLOBALS["cnstats_db"]->_74cff91f($STATS_CONF["sqlhost"],$STATS_CONF["sqluser"],$STATS_CONF["sqlpassword"],$STATS_CONF["dbname"]);if(!$_6c09ff9d)return;$GLOBALS["cnstats_db"]->_a9cde373(false);$_6c09ff9d=$GLOBALS["cnstats_db"]->_24bdb5eb("SHOW TABLE STATUS");$_f7c0246a=0;while($_e8b7be43=$GLOBALS["cnstats_db"]->_ef336f8e($_6c09ff9d)){while(list($_8a90aba9,$_97dfba65)=each($_e8b7be43)){if($_8a90aba9=="Data_length"&&(substr($_b5171008,0,strlen($STATS_CONF["sqlprefix"]))==$STATS_CONF["sqlprefix"]))$_f7c0246a+=$_97dfba65;if($_8a90aba9=="Index_length"&&(substr($_b5171008,0,strlen($STATS_CONF["sqlprefix"]))==$STATS_CONF["sqlprefix"]))$_f7c0246a+=$_97dfba65;if($_8a90aba9=="Name")$_b5171008=$_97dfba65;}}$GLOBALS["cnstats_db"]->_24bdb5eb("INSERT IGNORE INTO ".$STATS_CONF["sqlprefix"]."size SET date=NOW() + INTERVAL ".intval($COUNTER["timeoffset"])." SECOND, size='".$_f7c0246a."';");$_b2f04e78=intval($COUNTER["savelog"]);if($_b2f04e78<1||$_b2f04e78>300)$_b2f04e78=300;$GLOBALS["cnstats_db"]->_24bdb5eb("DELETE FROM ".$STATS_CONF["sqlprefix"]."hid");$GLOBALS["cnstats_db"]->_24bdb5eb("DELETE FROM ".$STATS_CONF["sqlprefix"]."log WHERE date<'".date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$_b2f04e78,date("Y"))+$COUNTER["timeoffset"])."'");_f0769e75();$GLOBALS["cnstats_db"]->close();}function _b9566752(){GLOBAL$STATS_CONF,$COUNTER,$CNSTATS_TITLE,$CNSTATS_JAVASCRIPT_CODE;$_c674e474=true;if(@is_array($STATS_CONF))if(isset($STATS_CONF["graph"]))$_c674e474=false;if($_c674e474){$STATS_CONF=Array("noclose"=>"","sqlinstructions"=>Array(),"sqlprefix"=>"cns_","graph"=>0,"is_cookie"=>0);$COUNTER=Array("excludeip"=>Array(),"excludemask"=>Array(),"excludeurl"=>Array(),"timeoffset"=>0,"sqlwritelog"=>"","HTTPheaders"=>Array());}if(empty($STATS_CONF["cookieprefix"]))$STATS_CONF["cookieprefix"]="cns";if(empty($STATS_CONF["session_time"]))$STATS_CONF["session_time"]=900;if(!isset($GLOBALS["CNSTATSRSS"]))$GLOBALS["CNSTATSRSS"]="no";elseif($GLOBALS["CNSTATSRSS"]!="yes")$GLOBALS["CNSTATSRSS"]="no";if(!isset($GLOBALS["CNSTATS404"]))$GLOBALS["CNSTATS404"]="no";elseif($GLOBALS["CNSTATS404"]!="yes")$GLOBALS["CNSTATS404"]="no";if(!isset($STATS_CONF["dbname"])){if(is_file(dirname(__FILE__)."/config.php"))include dirname(__FILE__)."/config.php";else{print"<a href=\"http://www.cn-software.com/en/cnstats/\">CNStats</a> installed incorrectly. Configuration file not found.";return;}}if(isset($STATS_CONF["disabled"]))if($STATS_CONF["disabled"]=="yes")return;if(empty($STATS_CONF["sqlprefix"]))$STATS_CONF["sqlprefix"]="cns_";if($STATS_CONF["noclose"]===true)$_6a642390=true;else$_6a642390=false;$_6282e779=false;if(is_array($COUNTER["excludeip"])&&is_array($COUNTER["excludemask"]))while(list($_8a90aba9,$_97dfba65)=each($COUNTER["excludeip"])){$_5567710b=ip2long($_97dfba65);$_c9db130c=ip2long($COUNTER["excludemask"][$_8a90aba9]);if((ip2long($_SERVER["REMOTE_ADDR"])&$_c9db130c)==($_5567710b&$_c9db130c)){$_6282e779=true;break;}}if(is_array($COUNTER["excludeurl"])){if(isset($STATS_CONF["page"]))$_140ab620=$STATS_CONF["page"];else$_140ab620="http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];foreach($COUNTER["excludeurl"]as$_97dfba65)if(strpos($_140ab620,$_97dfba65)!==false){$_6282e779=true;break;}}$GLOBALS["cnstats_db"]->_a9cde373(true);$_6c09ff9d=$GLOBALS["cnstats_db"]->_74cff91f($STATS_CONF["sqlhost"],$STATS_CONF["sqluser"],$STATS_CONF["sqlpassword"],$STATS_CONF["dbname"]);if(!$_6c09ff9d)return;$GLOBALS["cnstats_db"]->_a9cde373(false);if($_6282e779){$_6c09ff9d=$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT t_u_hits+t_r_hits as t_hits,u_hits+r_hits as hits,r_hosts+u_hosts as hosts FROM ".$STATS_CONF["sqlprefix"]."counter;");$STATS_CONF=$GLOBALS["cnstats_db"]->_ef336f8e($_6c09ff9d);$GLOBALS["cnstats_db"]->close();return;}$_268b9c9d=htmlspecialchars($_SERVER["HTTP_USER_AGENT"]);if(isset($_SERVER["HTTP_X_OPERAMINI_PHONE_UA"]))$_268b9c9d=htmlspecialchars($_268b9c9d);if(isset($_SERVER["HTTP_X_OPERAMINI_PHONE"]))$_cdf1eb5e=$_SERVER["HTTP_X_OPERAMINI_PHONE"];else$_cdf1eb5e="";$_a5e3b32d=$_SERVER["REMOTE_ADDR"];$_7372c9be="";if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){$_7372c9be=$_a5e3b32d;$_a5e3b32d=$_SERVER["HTTP_X_FORWARDED_FOR"];}$_5a5ea05a=strrpos($_a5e3b32d,",");if($_5a5ea05a!=0)$_a5e3b32d=trim(substr($_a5e3b32d,$_5a5ea05a+1));$_a5e3b32d=ip2long($_a5e3b32d);$_5a5ea05a=strrpos($_7372c9be,",");if($_5a5ea05a!=0)$_7372c9be=trim(substr($_7372c9be,$_5a5ea05a+1));$_7372c9be=ip2long($_7372c9be);if(isset($_GET["c"]))$_06b9df6f=intval($_GET["c"]);else$_06b9df6f=0;if($STATS_CONF["graph"]==1){$_140ab620=$STATS_CONF["page"];$_55dc3685=$STATS_CONF["referer"];$_2b36786b=$GLOBALS["cnstats_db"]->escape($STATS_CONF["title"]);$_79b2da48=$STATS_CONF["res"];$_faa31c69=$STATS_CONF["depth"];}else{if(isset($STATS_CONF["page"]))$_140ab620=urlencode(htmlspecialchars($STATS_CONF["page"]));else$_140ab620=urlencode(htmlspecialchars("http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]));if(isset($STATS_CONF["referer"]))$_55dc3685=htmlspecialchars($STATS_CONF["referer"]);else if(isset($_SERVER["HTTP_REFERER"]))$_55dc3685=htmlspecialchars($_SERVER["HTTP_REFERER"]);else$_55dc3685="";$_2b36786b=$GLOBALS["cnstats_db"]->escape($CNSTATS_TITLE);$_79b2da48=$_faa31c69=0;}if("yes"==$STATS_CONF["enable_idna"]){if(!function_exists("_5452609a")){function _5452609a($_5caea3f9){$_5caea3f9=preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($_5caea3f9));return html_entity_decode($_5caea3f9,null,'UTF-8');}}$_140ab620=urldecode($_140ab620);$_140ab620=_5452609a($_140ab620);require_once(dirname(__FILE__)."/includes/idna_convert.class.php");$_857b89cb=new idna_convert();$_140ab620=$_857b89cb->decode($_140ab620);unset($_857b89cb);$_140ab620=urlencode($_140ab620);}$_aa9e377a=date("Y-m-d H:i:s",time()+$COUNTER["timeoffset"]);if(isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]))$_d4db71b5=htmlspecialchars($_SERVER["HTTP_ACCEPT_LANGUAGE"]);else$_d4db71b5="";if(@is_array($COUNTER["HTTPheaders"])){foreach($COUNTER["HTTPheaders"]as$_0862575d=>$_6b643b84)@header($_0862575d.": ".$_6b643b84);}elseif(!isset($COUNTER["HTTPheaders"]["P3P"]))@header("P3P: policyref=\"/w3c/p3p.xml\", CP=\"UNI\"");$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT GET_LOCK('cnstatslock_".$GLOBALS["cnstats_db"]->escape($STATS_CONF["dbname"])."',60);");$_6c09ff9d=$GLOBALS["cnstats_db"]->_24bdb5eb("UPDATE ".$STATS_CONF["sqlprefix"]."counter SET last='".date("d",time()+$COUNTER["timeoffset"])."';");if($GLOBALS["cnstats_db"]->_0242605c()>0){$_2472e8fa["ignore_errors"]=true;@ignore_user_abort(1);@set_time_limit(0);$_2472e8fa["ignore_errors"]=false;$_6d834035=time()+$COUNTER["timeoffset"];$_def4a296=date("Y-m-d H:i:s",mktime(0,0,0,date("m",$_6d834035),date("d",$_6d834035)-1,date("Y",$_6d834035)));$_6c09ff9d=$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT r_hits,r_hosts,u_users,u_hits,u_hosts,u_sessions FROM ".$STATS_CONF["sqlprefix"]."counter LIMIT 1");if($_e8b7be43=@$GLOBALS["cnstats_db"]->_ef336f8e($_6c09ff9d)){$GLOBALS["cnstats_db"]->_24bdb5eb("INSERT IGNORE INTO ".$STATS_CONF["sqlprefix"]."counter_total SET r_hits='".$_e8b7be43["r_hits"]."',r_hosts='".$_e8b7be43["r_hosts"]."', u_hits='".$_e8b7be43["u_hits"]."', u_hosts='".$_e8b7be43["u_hosts"]."', date='".$_def4a296."', u_users='".$_e8b7be43["u_users"]."', u_sessions='".$_e8b7be43["u_sessions"]."';");}$GLOBALS["cnstats_db"]->_24bdb5eb("UPDATE ".$STATS_CONF["sqlprefix"]."counter SET r_hits=0, r_hosts=0, u_users=0, u_hits=0, u_hosts=0, u_sessions=0;");$_6a642390=true;if(isset($STATS_CONF["disable_shutdown_function"])&&$STATS_CONF["disable_shutdown_function"]===true){_f90807e6();}else{$_6a642390=true;register_shutdown_function("_f90807e6");}}$_2d5b0234=$_5373c966="";$_f65f1be0="robot";$_2135df22=0;$_7a290c1e=1;$_8c29be51=$_3329fcf8=$_797e6294=false;if($STATS_CONF["graph"]==1){if($STATS_CONF["is_cookie"]==1){$_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;}if(!$_797e6294){$_6c09ff9d=$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT uid, sid, last_visit, pagenumber FROM ".$STATS_CONF["sqlprefix"]."uid WHERE user_id='".$_a76ed395."';");if($_6c09ff9d){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;unset($_e8b7be43);}$GLOBALS["cnstats_db"]->_d8902be8($_0d0e09b1);}$_8c29be51=true;$_3329fcf8=true;$GLOBALS["cnstats_db"]->_a9cde373(true);$GLOBALS["cnstats_db"]->_24bdb5eb("INSERT INTO ".$STATS_CONF["sqlprefix"]."uid SET user_id='".$_a76ed395."', uid='".$_539b0606."', sid='".$_57167ab4."', last_visit='".time()."', pagenumber=1;");$_7dbf79bf=0;while($GLOBALS["cnstats_db"]->_0242605c()==0){$_a76ed395=crc32($_SERVER["REMOTE_ADDR"].$_SERVER["HTTP_X_FORWARDED_FOR"].microtime()."asdd3".rand(0,10000));$GLOBALS["cnstats_db"]->_24bdb5eb("INSERT INTO ".$STATS_CONF["sqlprefix"]."uid SET user_id='".$_a76ed395."', uid='".$_539b0606."', sid='".$_57167ab4."', last_visit='".time()."', pagenumber=1;");$_7dbf79bf++;if($_7dbf79bf>10)break;}$GLOBALS["cnstats_db"]->_a9cde373(false);}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[0]);}$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."';");}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),"/");}}else$_57167ab4=$_539b0606=$_a76ed395=0;}$_cd8908fa=true;$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT RELEASE_LOCK('cnstatslock_".$GLOBALS["cnstats_db"]->escape($STATS_CONF["dbname"])."');");$_6c09ff9d=$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT city,country,latitude,longitude FROM ".$STATS_CONF["sqlprefix"]."hid WHERE ip='".$GLOBALS["cnstats_db"]->escape($_a5e3b32d)."' AND proxy='".$GLOBALS["cnstats_db"]->escape($_7372c9be)."'");if($_6c09ff9d){if($_e8b7be43=$GLOBALS["cnstats_db"]->_ef336f8e($_6c09ff9d)){$_cd8908fa=false;$_2d5b0234=$_e8b7be43["city"];$_5373c966=$_e8b7be43["country"];$_4118d123=$_e8b7be43["latitude"];$_85e16f6b=$_e8b7be43["longitude"];unset($_e8b7be43);}else{include dirname(__FILE__)."/includes/geo.php";$_00ed2f2f=false;if(isset($COUNTER["geobase"])){if(!empty($COUNTER["geobase"])){$_00ed2f2f=true;$_775ee79c=new cnstats_Geo($COUNTER["geobase"]);}}if(!$_00ed2f2f)$_775ee79c=new cnstats_Geo();$_775ee79c=$_775ee79c->_a6422cef($_a5e3b32d,$_7372c9be);$_5373c966=$_775ee79c[0];$_2d5b0234=$_775ee79c[1];$_4118d123=$_775ee79c[2];$_85e16f6b=$_775ee79c[3];$GLOBALS["cnstats_db"]->_24bdb5eb("INSERT IGNORE INTO ".$STATS_CONF["sqlprefix"]."hid SET ip='".$GLOBALS["cnstats_db"]->escape($_a5e3b32d)."', proxy='".$GLOBALS["cnstats_db"]->escape($_7372c9be)."', city='".$GLOBALS["cnstats_db"]->escape($_2d5b0234)."', country='".intval($_5373c966)."', latitude='".intval($_4118d123)."' ,longitude='".intval($_85e16f6b)."';");}$GLOBALS["cnstats_db"]->_d8902be8($_6c09ff9d);}$_d4db71b5=substr($_d4db71b5,0,32);$_79b2da48=intval(substr($_79b2da48,0,10));$_2d5b0234=substr($_2d5b0234,0,128);$_2b36786b=substr($_2b36786b,0,250);$_268b9c9d=substr($_268b9c9d,0,250);$_cdf1eb5e=substr($_cdf1eb5e,0,250);$_5373c966=intval($_5373c966);$_7372c9be=intval($_7372c9be);if($_7372c9be==0)$_7372c9be=-1;$_a5e3b32d=intval($_a5e3b32d);if($_a5e3b32d==0)$_a5e3b32d=-1;$_17f4ec1b=time()-$_2135df22;if($_17f4ec1b<0||$_17f4ec1b>31536000)$_17f4ec1b=-1;if(!is_numeric($_a76ed395))$_a76ed395=0;if(!is_numeric($_539b0606))$_539b0606=0;if(!is_numeric($_57167ab4))$_57167ab4=0;$_1af97c7a="";if(isset($STATS_CONF["userfield1"]))$_1af97c7a.=", userfield1='".$GLOBALS["cnstats_db"]->escape($STATS_CONF["userfield1"])."'";if(isset($STATS_CONF["userfield2"]))$_1af97c7a.=", userfield2='".$GLOBALS["cnstats_db"]->escape($STATS_CONF["userfield2"])."'";if(isset($STATS_CONF["userfield3"]))$_1af97c7a.=", userfield3='".$GLOBALS["cnstats_db"]->escape($STATS_CONF["userfield3"])."'";$_dbd66adf="INSERT INTO ".$STATS_CONF["sqlprefix"]."log SET date='".$_aa9e377a."', ip='".$_a5e3b32d."', proxy='".$_7372c9be."', id_user='".$_a76ed395."', uid='".$_539b0606."', sid='".$_57167ab4."', unique_host='".($_cd8908fa?"yes":"no")."', unique_user='".($_8c29be51?"yes":"no")."', unique_session='".($_3329fcf8?"yes":"no")."', page='".$GLOBALS["cnstats_db"]->escape($_140ab620)."', agent='".$GLOBALS["cnstats_db"]->escape($_268b9c9d)."', mobiledevice='".$GLOBALS["cnstats_db"]->escape($_cdf1eb5e)."', referer='".$GLOBALS["cnstats_db"]->escape($_55dc3685)."', language='".$GLOBALS["cnstats_db"]->escape($_d4db71b5)."', res='".$GLOBALS["cnstats_db"]->escape($_79b2da48)."', depth='".$_faa31c69."', country='".$_5373c966."', city='".$GLOBALS["cnstats_db"]->escape($_2d5b0234)."', latitude='".intval($_4118d123)."', longitude='".intval($_85e16f6b)."', title='".$GLOBALS["cnstats_db"]->escape($_2b36786b)."', isrobot='".$_f65f1be0."', prevdate='".$_17f4ec1b."', pagenumber='".$_7a290c1e."', is404='".($GLOBALS["CNSTATS404"]=="yes"?"yes":"no")."', isrss='".($GLOBALS["CNSTATSRSS"]=="yes"?"yes":"no")."' ".$_1af97c7a.";";$GLOBALS["cnstats_db"]->_24bdb5eb($_dbd66adf);if($STATS_CONF["graph"]!=1){if(!isset($STATS_CONF["cnstats_http_path"])){$_9606c2fe=strlen($_SERVER["DOCUMENT_ROOT"]);if(substr(__FILE__,0,$_9606c2fe)==$_SERVER["DOCUMENT_ROOT"]){$_e3e3007f=substr(__FILE__,$_9606c2fe);}$_e3e3007f=str_replace("cnt.php","cnt-combined.php",$_e3e3007f);}else{$_e3e3007f=$STATS_CONF["cnstats_http_path"];if(substr($_e3e3007f,-1)!="/")$_e3e3007f.="/";if(substr($_e3e3007f,0,1)!="/")$_e3e3007f="/".$_e3e3007f;$_e3e3007f.="cnt-combined.php";}$_5994320b=$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT LAST_INSERT_ID();");if($_5994320b){if($_e8b7be43=$GLOBALS["cnstats_db"]->_35acb628($_5994320b)){$_46a75c12=$_e8b7be43[0];unset($_e8b7be43);}$GLOBALS["cnstats_db"]->_d8902be8($_5994320b);}if($STATS_CONF["codegeneration"]=="onlyid"){$CNSTATS_JAVASCRIPT_CODE=$_46a75c12;}else{if(substr($STATS_CONF["cnsoftwaredomain"],0,4)=="www.")$_a7a91e0b=substr($STATS_CONF["cnsoftwaredomain"],4);else$_a7a91e0b=$STATS_CONF["cnsoftwaredomain"];if($_SERVER["HTTP_HOST"]==$_a7a91e0b||$_SERVER["HTTP_HOST"]=="www.".$_a7a91e0b)$_2f20964b=$_SERVER["HTTP_HOST"];else$_2f20964b=$_a7a91e0b;if($_e3e3007f=="//")$_e3e3007f="/";$CNSTATS_JAVASCRIPT_CODE="";if($STATS_CONF["code"]=="HTML"||$STATS_CONF["code"]=="html"){$CNSTATS_JAVASCRIPT_CODE.="<!-- CNStats begin -->";$CNSTATS_JAVASCRIPT_CODE.="<script type=\"text/javascript\">\n";$CNSTATS_JAVASCRIPT_CODE.="cnsd=document;cnst=es"."cape(cnsd.title);\n";$CNSTATS_JAVASCRIPT_CODE.="cnst=cnst.replace(/\+/g,'%2B');cnsa=navigator.appName;\n";$CNSTATS_JAVASCRIPT_CODE.="cnsn=(cnsa.substring(0,2)=='Mi')?0:1;cnss=screen;cnspx=(cnsn==0)?cnss.colorDepth:cnss.pixelDepth;\n";$CNSTATS_JAVASCRIPT_CODE.="document.write('<img s'+'rc=\"".(($_SERVER["HTTPS"]=="on"||$_SERVER["SERVER_PORT"]==443)?"https":"http")."://".$_2f20964b.$_e3e3007f."?i=".$_46a75c12."&amp;e='+cnss.width+'.'+cnss.height+'&amp;d='+cnspx+'&amp;r='+es"."cape(cnsd.referrer)+'&amp;p='+es"."cape(cnsd.location)+'&amp;t='+cnst+'\" width=\"1\" height=\"1\" border=\"0\">');\n";$CNSTATS_JAVASCRIPT_CODE.="</script>";$CNSTATS_JAVASCRIPT_CODE.="<noscript><img src=\"".(($_SERVER["HTTPS"]=="on"||$_SERVER["SERVER_PORT"]==443)?"https":"http")."://".$_2f20964b.$_e3e3007f."?i=".$_46a75c12."\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" /></noscript>";$CNSTATS_JAVASCRIPT_CODE.="<!-- CNStats end -->";}else{$CNSTATS_JAVASCRIPT_CODE.="<!-- CNStats begin -->";$CNSTATS_JAVASCRIPT_CODE.="<span id=\"cnstats_span\"><script type=\"text/javascript\">\n";$CNSTATS_JAVASCRIPT_CODE.="cnsd=document;\n";$CNSTATS_JAVASCRIPT_CODE.="cnst=es"."cape(cnsd.title);\n";$CNSTATS_JAVASCRIPT_CODE.="cnst=cnst.replace(/\+/g,'%2B');\n";$CNSTATS_JAVASCRIPT_CODE.="cnsa=navigator.appName;\n";$CNSTATS_JAVASCRIPT_CODE.="cnsn=(cnsa.substring(0,2)=='Mi')?0:1;\n";$CNSTATS_JAVASCRIPT_CODE.="cnss=screen;cnspx=(cnsn==0)?cnss.colorDepth:cnss.pixelDepth;\n";$CNSTATS_JAVASCRIPT_CODE.="if (cnsd.getElementById)\n";$CNSTATS_JAVASCRIPT_CODE.="{\n";$CNSTATS_JAVASCRIPT_CODE.="	var i=cnsd.createElement('img');\n";$CNSTATS_JAVASCRIPT_CODE.="	var iurl='".(($_SERVER["HTTPS"]=="on"||$_SERVER["SERVER_PORT"]==443)?"https":"http")."://".$_2f20964b.$_e3e3007f."?i=".$_46a75c12."';\n";$CNSTATS_JAVASCRIPT_CODE.="	var amp=String.fromCharCode(38);\n";$CNSTATS_JAVASCRIPT_CODE.="	iurl+=amp+'e='+cnss.width+'.'+cnss.height;\n";$CNSTATS_JAVASCRIPT_CODE.="	iurl+=amp+'d='+cnspx+amp+'r='+es"."cape(cnsd.referrer);\n";$CNSTATS_JAVASCRIPT_CODE.="	iurl+=amp+'p='+es"."cape(cnsd.location)+amp+'t='+cnst;\n";$CNSTATS_JAVASCRIPT_CODE.="	i.src=iurl;\n";$CNSTATS_JAVASCRIPT_CODE.="	i.width=1;i.height=1;i.border=0;\n";$CNSTATS_JAVASCRIPT_CODE.="	cnsd.getElementById('cnstats_span').appendChild(i);\n";$CNSTATS_JAVASCRIPT_CODE.="}\n";$CNSTATS_JAVASCRIPT_CODE.="</script></span>\n";$CNSTATS_JAVASCRIPT_CODE.="<noscript><div id=\"cnstats_counter_code\"><img src=\"".(($_SERVER["HTTPS"]=="on"||$_SERVER["SERVER_PORT"]==443)?"https":"http")."://".$_2f20964b.$_e3e3007f."?i=".$_46a75c12."\" width=\"1\" height=\"1\" style=\"border:0;\" alt=\"\" /></div></noscript>";$CNSTATS_JAVASCRIPT_CODE.="<!-- CNStats end -->";}if($STATS_CONF["codegeneration"]!="variable"){print$CNSTATS_JAVASCRIPT_CODE;}}}if($GLOBALS["CNSTATS404"]!="yes"&&$GLOBALS["CNSTATSRSS"]!="yes"){if($STATS_CONF["graph"]==1){if($_f65f1be0=="user"){$_018dbdae="u_hits=u_hits+1, t_u_hits=t_u_hits+1";if(!$_cd8908fa)$_a22f7e6a="";else$_a22f7e6a=", u_hosts=u_hosts+1, t_u_hosts=t_u_hosts+1";if(!$_8c29be51)$_1af97c7a="";else$_1af97c7a=", u_users=u_users+1, t_u_users=t_u_users+1";if(!$_3329fcf8)$_dca84330="";else$_dca84330=", u_sessions=u_sessions+1, t_u_sessions=t_u_sessions+1";$_dbd66adf="UPDATE ".$STATS_CONF["sqlprefix"]."counter SET ".$_018dbdae." ".$_a22f7e6a." ".$_1af97c7a." ".$_dca84330.";";$GLOBALS["cnstats_db"]->_24bdb5eb($_dbd66adf);}else{$_018dbdae="r_hits=r_hits+1, t_r_hits=t_r_hits+1";if(!$_cd8908fa)$_a22f7e6a="";else$_a22f7e6a=", r_hosts=r_hosts+1, t_r_hosts=t_r_hosts+1";$_dbd66adf="UPDATE ".$STATS_CONF["sqlprefix"]."counter SET ".$_018dbdae." ".$_a22f7e6a.";";$GLOBALS["cnstats_db"]->_24bdb5eb($_dbd66adf);}}else{$_018dbdae="r_hits=r_hits+1, t_r_hits=t_r_hits+1";if(!$_cd8908fa)$_a22f7e6a="";else$_a22f7e6a=", r_hosts=r_hosts+1, t_r_hosts=t_r_hosts+1";$_dbd66adf="UPDATE ".$STATS_CONF["sqlprefix"]."counter SET ".$_018dbdae." ".$_a22f7e6a.";";$GLOBALS["cnstats_db"]->_24bdb5eb($_dbd66adf);}}$_6c09ff9d=$GLOBALS["cnstats_db"]->_24bdb5eb("SELECT r_hits+u_hits as hits, r_hosts+u_hosts as hosts, t_r_hits+t_u_hits as t_hits FROM ".$STATS_CONF["sqlprefix"]."counter");$STATS_CONF=array_merge($STATS_CONF,$GLOBALS["cnstats_db"]->_ef336f8e($_6c09ff9d));if(!$_6a642390)$GLOBALS["cnstats_db"]->close();}_b9566752();error_reporting($CNSTATS_OLD_ERROR_REPORTING);ignore_user_abort($CNSTATS_OLD_USER_ABORT);?>
Return current item: CNStats