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