function InfoNavig(){this.browser="";this.version="";this.os="";this.width=((window.innerWidth)?window.innerWidth:document.body.offsetWidth);this.height=((window.innerHeight)?window.innerHeight:document.body.offsetHeight);this.lang=(navigator.language)?navigator.language:'';this.screenW=screen.width;this.screenH=screen.height;this.ligneuseragent=navigator.userAgent.toLowerCase();this.postrouve=0;this.cherche=0;this.getRoundWidth=function(){return parseInt(this.width/100)*100;} this.getRoundHeight=function(){return parseInt(this.height/100)*100;} this.checkIt=function(string){this.cherche=string;this.postrouve=this.ligneuseragent.indexOf(this.cherche)+1;return this.postrouve;} if(this.checkIt('playstation 3')){this.browser="PlayStation" this.version=3;this.os="PS3";} else if(this.checkIt('playstation portable')){this.browser="PlayStation" this.version=2;this.os="PSP";} else if(this.checkIt('nintendo wii')){this.browser="Opera" this.version=9;this.os="Wii";} else if(this.checkIt('konqueror')){this.browser="Konqueror";this.os="Linux";} else if(this.checkIt('chrome')){this.browser="Google Chrome";} else if(this.checkIt('google wireless transcoder')){this.browser="Google Wireless Transcoder";} else if(this.checkIt('safari')){this.checkIt('version');this.browser="Safari";} else if(this.checkIt('omniweb'))this.browser="OmniWeb" else if(this.checkIt('opera'))this.browser="Opera" else if(this.checkIt('webtv'))this.browser="WebTV";else if(this.checkIt('icab'))this.browser="iCab" else if(this.checkIt('msie'))this.browser="Internet Explorer" else if(this.checkIt('firefox'))this.browser="FireFox" else {this.browser="Autre"};if(!this.version && this.browser!='Autre')this.version=this.ligneuseragent.charAt(this.postrouve+this.cherche.length);if(parseInt(this.version)<1){this.version=''}if(!this.os){if(this.checkIt('iphone'))this.os="iPhone"; else if(this.checkIt('symbianos'))this.os="Symbian OS"; else if(this.checkIt('cldc'))this.os="Mobile"; else if(this.checkIt('linux'))this.os="Linux"; else if(this.checkIt('x11'))this.os="Unix";else if(this.checkIt('mac os x'))this.os="Mac OS X";else if(this.checkIt('mac'))this.os="Mac OS" else if(this.checkIt('media center pc'))this.os="Windows Media Center" else if(this.checkIt('windows ce'))this.os="Windows CE" else if(this.checkIt('windows nt 6.1'))this.os="Windows 7" else if(this.checkIt('windows nt 6.0'))this.os="Windows Vista" else if(this.checkIt('windows nt 5.2'))this.os="Windows 2003" else if(this.checkIt('windows nt 5.1')||this.checkIt('windows xp'))this.os="Windows XP" else if(this.checkIt('windows nt 5.0')||this.checkIt('windows 2000'))this.os="Windows 2000" else if(this.checkIt('win'))this.os="Windows" else this.os="Autre";}} function pornlive_compteVisite(id,nv,nbv) { var getInfoNavig = new InfoNavig(); // Lancement du script d'enregistrement des stats logs retravaillées plus tard par cron var live_doc_ref = ''+document.referrer; var live_doc_actu = ''+document.location; live_doc_ref = escape(live_doc_ref.replace(/[^:]+:\/\//g,'')); live_doc_actu = escape(live_doc_actu.replace(/[^:]+:\/\/(www.)?/g,'')); if(live_doc_actu=='') live_doc_actu='/'; // si on a une url actuelle vide on considere que c'est la HP du site var argstats = '&ref='+live_doc_ref+'&url='+live_doc_actu+'&eW='+getInfoNavig.screenW+'&eH='+getInfoNavig.screenH+'&nN='+escape(getInfoNavig.browser)+'&nVer='+getInfoNavig.version+'&os='+escape(getInfoNavig.os)+'&lg='+getInfoNavig.lang; // +'&agent='+escape(getInfoNavig.ligneuseragent); if(id.length>10) // On compte pas si on a pas un idsession (ca arrive que des fois il soit vide!!??) document.write( unescape("%3Cscript")+ " src='http://statstools.porn.fr/public/live_compteur.php?id_site=2&w=45611&n=&t=&disclamer=&sans_nbconnecte=&ids="+id+"&nv="+nv+"&nbv="+nbv+argstats+"' "+unescape("type='text/javascript'%3E%3C/script%3E") ) } function pornlive_afficheVisite() { document.write( unescape("%3Cscript")+ " src='http://statstools.porn.fr/public/live_compteur.php?id_site=2&w=45611&n=&t=&disclamer=&sans_nbconnecte=&affiche_nbvisit' "+unescape("type='text/javascript'%3E%3C/script%3E") ) } function pornlive_formatCookieDomain(str) { str = str.toString().toLowerCase().replace(/[^:]+:\/\/(www.)?/g,''); if (str.indexOf("/") > -1) str = str.substring(0, str.indexOf("/")); var parts = str.split('.'); var len = parts.length; if (len < 2) return ''; // pour localhost on envoi rien sinon bug navig else if (len < 3) return "."+str; else if (len == 4 && (parseInt(parts[len-1])>0) ) return "."+parts[len-4]+"."+parts[len-3]+"."+parts[len-2]+"."+parts[len-1]; // c'est une IP else return "."+parts[len-2]+"."+parts[len-1]; } function pornlive_SetCookie (name, value) { // un cookie a besoin d'un nom, d'une valeur, d'un nom de domaine, d'une date d'expiration // var argv=pornlive_SetCookie.arguments; var argc=pornlive_SetCookie.arguments.length; var expires=(argc > 2) ? argv[2] : null; var path=(argc > 3) ? argv[3] : null; var domain=(argc > 4) ? argv[4] : null; var secure=(argc > 5) ? argv[5] : false; document.cookie=name+"="+escape(value)+ ((expires==null) ? "" : ("; expires="+expires.toGMTString()))+ ((path==null) ? "" : ("; path="+path))+ ((domain==null) ? "" : ("; domain="+domain))+ ((secure==true) ? "; secure" : ""); } function pornlive_GetCookie (name) { var arg=name+"="; var alen=arg.length; var clen=document.cookie.length; var i=0; while (i < clen) { var j=i+alen; if (document.cookie.substring(i, j)==arg) return pornlive_getCookieVal (j); i=document.cookie.indexOf(" ",i)+1; if (i==0) break;} return null; } function pornlive_getCookieVal(offset) { var endstr=document.cookie.indexOf (";", offset); if (endstr==-1) endstr=document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } var expiration = new Date(1283810400000);var heurevisite = '043044'; var cookie = pornlive_GetCookie( "visiteur_2" ); if( !cookie || cookie == '' ) { // si on a pas de cookie on tente d'en écrire un pornlive_SetCookie( "visiteur_2", "3f6cb39f14b6c8456e0d5cd7e6834acc|0|0|0", expiration, "/", pornlive_formatCookieDomain(document.location)); } cookie = pornlive_GetCookie( "visiteur_2" ); if( cookie && cookie != '' ) { // On a déjà un cookie => extrait l'info + nbvisite+1 tab_info_cookie = cookie.split( "|" ); tab_info_cookie[1]++; if(tab_info_cookie[2]=='0'||(parseInt(heurevisite)-parseInt(tab_info_cookie[2]))>=10000) // + d'1H => visite différente tab_info_cookie[3]++; pornlive_SetCookie( "visiteur_2", tab_info_cookie[0]+"|"+tab_info_cookie[1]+"|"+heurevisite+"|"+tab_info_cookie[3], expiration, "/", pornlive_formatCookieDomain(document.location)); pornlive_compteVisite(tab_info_cookie[0], tab_info_cookie[1], tab_info_cookie[3]); } // Si Pas de cookies, alors PB! else { pornlive_afficheVisite(); document.write(""); // on en profite pour récupérer ce visiteur avec le script pas de cookie pas de JS var getInfoNavig = new InfoNavig(); var live_doc_ref = ''+document.referrer; var live_doc_actu = ''+document.location; live_doc_ref = escape(live_doc_ref.replace(/[^:]+:\/\//g,'')); live_doc_actu = escape(live_doc_actu.replace(/[^:]+:\/\/(www.)?/g,'')); if(live_doc_actu=='') live_doc_actu='/'; // si on a une url actuelle vide on considere que c'est la HP du site var argstats = '&ref='+live_doc_ref+'&url='+live_doc_actu+'&eW='+getInfoNavig.screenW+'&eH='+getInfoNavig.screenH+'&nN='+escape(getInfoNavig.browser)+'&nVer='+getInfoNavig.version+'&os='+escape(getInfoNavig.os)+'&lg='+getInfoNavig.lang; document.write(''); }