1// awstats_misc_tracker.js 2//------------------------------------------------------------------- 3// You can add this file onto some of your web pages (main home page can 4// be enough) by adding the following HTML code to your page body: 5// 6// <script language="javascript" type="text/javascript" src="/js/awstats_misc_tracker.js"></script> 7// <noscript><img src="/js/awstats_misc_tracker.js?nojs=y" height="0" width="0" border="0" style="display: none"></noscript> 8// 9// * This must be added after the <body> tag, not placed within the 10// <head> tags, or the resulting tracking <img> tag will not be handled 11// correctly by all browsers. Internet explorer will also not report 12// screen height and width attributes until it begins to render the 13// body. 14// 15// This allows AWStats to be enhanced with some miscellanous features: 16// - Screen size detection (TRKscreen) 17// - Browser size detection (TRKwinsize) 18// - Screen color depth detection (TRKcdi) 19// - Java enabled detection (TRKjava) 20// - Macromedia Director plugin detection (TRKshk) 21// - Macromedia Shockwave plugin detection (TRKfla) 22// - Realplayer G2 plugin detection (TRKrp) 23// - QuickTime plugin detection (TRKmov) 24// - Mediaplayer plugin detection (TRKwma) 25// - Acrobat PDF plugin detection (TRKpdf) 26//------------------------------------------------------------------- 27 28// If you use pslogger.php to generate your log, you can change this line with 29// var awstatsmisctrackerurl="pslogger.php?loc=/js/awstats_misc_tracker.js"; 30var awstatsmisctrackerurl="/js/awstats_misc_tracker.js"; 31 32var TRKresult; 33var TRKscreen, TRKwinsize, TRKcdi, TRKjava, TRKshk, TRKsvg, TRKfla; 34var TRKrp, TRKmov, TRKwma, TRKpdf, TRKpdfver, TRKuserid, TRKsessionid; 35var TRKnow, TRKbegin, TRKend; 36var TRKnse, TRKn; 37 38function awstats_setCookie(TRKNameOfCookie, TRKvalue, TRKexpirehours) { 39 TRKExpireDate = new Date (); 40 TRKExpireDate.setTime(TRKExpireDate.getTime() + (TRKexpirehours * 3600 * 1000)); 41 document.cookie = TRKNameOfCookie + "=" + escape(TRKvalue) + "; path=/" + ((TRKexpirehours == null) ? "" : "; expires=" + TRKExpireDate.toGMTString()); 42} 43 44//function awstats_runvbscript() { 45// TRKresult = false; 46// p=false;
47// document.write('<SCRIPT LANGUAGE="VBScript">\non error resume next \n p = IsObject(CreateObject("PDF.PdfCtrl.5")) \n if (p) then \n msgbox("5") \n return true \n end if</SCRIPT>\n'); 48// alert(p); 49// if (TRKresult) return 'y'; 50// else return 'n'; 51//} 52 53function awstats_detectIE(TRKClassID) { 54 TRKresult = false; // !!! Adding var in front of TRKresult break detection !!! 55 document.write('<SCR' + 'IPT LANGUAGE="VBScript">\n on error resume next \n TRKresult = IsObject(CreateObject("' + TRKClassID + '")) \n </SCR' + 'IPT>\n'); 56 if (TRKresult) return 'y'; 57 else return 'n'; 58} 59 60function awstats_detectNS(TRKClassID) { 61 TRKn = "n"; 62 if (TRKnse.indexOf(TRKClassID) != -1) if (navigator.mimeTypes[TRKClassID].enabledPlugin != null) TRKn = "y"; 63 return TRKn; 64} 65 66function awstats_getCookie(TRKNameOfCookie){ 67 if (document.cookie.length > 0){ 68 TRKbegin = document.cookie.indexOf(TRKNameOfCookie+"="); 69 if (TRKbegin != -1) { 70 TRKbegin += TRKNameOfCookie.length+1; 71 TRKend = document.cookie.indexOf(";", TRKbegin); 72 if (TRKend == -1) TRKend = document.cookie.length; 73 return unescape(document.cookie.substring(TRKbegin, TRKend)); 74 } 75 return null; 76 } 77 return null; 78} 79 80if (window.location.search == "" || window.location.search == "?") { 81 // If no query string 82 TRKnow = new Date(); 83 TRKscreen=screen.width+"x"+screen.height; 84 if (navigator.appName != "Netscape") { TRKcdi=screen.colorDepth; } 85 else {TRKcdi=screen.pixelDepth}; 86 TRKjava=navigator.javaEnabled(); 87 TRKuserid=awstats_getCookie("AWSUSER_ID"); 88 TRKsessionid=awstats_getCookie("AWSSESSION_ID"); 89 var TRKrandomnumber=Math.floor(Math.random()*10000); 90 if (TRKuserid == null || (TRKuserid=="")) { TRKuserid = "awsuser_id" + TRKnow.getTime() +"r"+ TRKrandomnumber; } 91 if (TRKsessionid == null || (TRKsessionid=="")) { TRKsessionid = "awssession_id" + TRKnow.getTime() +"r"+ TRKrandomnumber; } 92 awstats_setCookie("AWSUSER_ID", TRKuserid, 10000); 93 awstats_setCookie("AWSSESSION_ID", TRKsessionid, 1); 94 TRKuserid=""; TRKuserid=awstats_getCookie("AWSUSER_ID"); 95 TRKsessionid=""; TRKsessionid=awstats_getCookie("AWSSESSION_ID"); 96 97 var TRKnav=navigator.appName.toLowerCase(); // "internet explorer" or "netscape" 98 var TRKagt=navigator.userAgent.toLowerCase(); // "msie...", "mozilla...", "firefox..." 99 //alert(TRKnav); alert(TRKagt); 100 101 var TRKwin = ((TRKagt.indexOf("win")!=-1) || (TRKagt.indexOf("32bit")!=-1)); 102 var TRKmac = (TRKagt.indexOf("mac")!=-1); 103 104 var TRKns = (TRKnav.indexOf("netscape") != -1); 105 var TRKopera= (TRKnav.indexOf("opera") != -1); 106 var TRKie = (TRKagt.indexOf("msie") != -1); 107 108 // Detect the browser internal width and height 109 var TRKwinsize; 110 if (document.documentElement && document.documentElement.clientWidth) 111 TRKwinsize = document.documentElement.clientWidth + 'x' + document.documentElement.clientHeight; 112 else if (document.body && document.body.clientWidth) 113 TRKwinsize = document.body.clientWidth + 'x' + document.body.clientHeight; 114 else 115 TRKwinsize = window.innerWidth + 'x' + window.innerHeight; 116 117 if (TRKie && TRKwin) { 118 TRKshk = awstats_detectIE("SWCtl.SWCtl.1"); 119 TRKsvg = awstats_detectIE("Adobe.SVGCtl"); 120 TRKfla = awstats_detectIE("ShockwaveFlash.ShockwaveFlash.1"); 121 TRKrp = awstats_detectIE("rmocx.RealPlayer G2 Control.1"); 122 TRKmov = awstats_detectIE("QuickTimeCheckObject.QuickTimeCheck.1"); 123 TRKwma = awstats_detectIE("MediaPlayer.MediaPlayer.1"); 124 TRKpdf = 'n'; TRKpdfver=''; 125 if (awstats_detectIE("PDF.PdfCtrl.1") == 'y') { TRKpdf = 'y'; TRKpdfver='4'; } // Acrobat 4 126 if (awstats_detectIE('PDF.PdfCtrl.5') == 'y') { TRKpdf = 'y'; TRKpdfver='5'; } // Acrobat 5 127 if (awstats_detectIE('PDF.PdfCtrl.6') == 'y') { TRKpdf = 'y'; TRKpdfver='6'; } // Acrobat 6 128 if (awstats_detectIE('AcroPDF.PDF.1') == 'y') { TRKpdf = 'y'; TRKpdfver='7'; } // Acrobat 7 129 } 130 if (TRKns || !TRKwin) { 131 TRKnse = ""; 132 for (var TRKi=0;TRKi<navigator.mimeTypes.length;TRKi++) TRKnse += navigator.mimeTypes[TRKi].type.toLowerCase(); 133 TRKshk = awstats_detectNS("application/x-director",""); 134 TRKsvg = awstats_detectNS("image/svg+xml",""); 135 if (document.implementation.hasFeature("org.w3c.dom.svg", "")) {TRKsvg = "y"; } 136 TRKfla = awstats_detectNS("application/x-shockwave-flash"); // ou lire dans naviagtor.plugins si on trouve "Shockwave Flash" ou "Shockwav Flash 2.0" 137 TRKrp = awstats_detectNS("audio/x-pn-realaudio-plugin"); 138 TRKmov = awstats_detectNS("video/quicktime"); 139 TRKwma = awstats_detectNS("application/x-mplayer2"); 140 TRKpdf = awstats_detectNS("application/pdf"); 141 TRKpdfver=''; 142 } 143 144 var imgsrc1 = awstatsmisctrackerurl+'?screen='+TRKscreen+'&win='+TRKwinsize+'&cdi='+TRKcdi+'&java='+TRKjava; 145 var imgsrc2 = '&shk='+TRKshk+'&svg='+TRKsvg+'&fla='+TRKfla+'&rp='+TRKrp+'&mov='+TRKmov+'&wma='+TRKwma+'&pdf='+TRKpdf+'&uid='+TRKuserid+'&sid='+TRKsessionid; 146 //alert(imgsrc1); 147 //alert(imgsrc2); 148 var imgsrc=imgsrc1+imgsrc2; 149 if( document.createElementNS ) { 150 var l=document.createElementNS("http://www.w3.org/1999/xhtml","img"); 151 l.setAttribute("src", imgsrc ); 152 l.setAttribute("height", "0"); 153 l.setAttribute("width", "0"); 154 l.setAttribute("border", "0"); 155 document.getElementsByTagName("body")[0].appendChild(l); 156 } else {
157 document.write('<img style="display:none;" src="'+ imgsrc +'" height="0" width="0" border="0" />') 158 } 159 160}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.