Okej, jag har fixat svaret. Det var ju inte så svårt! Det är javascript. Och javascriptet postar till en querystring precis som har diskuterats.
Här är koden. Flyttar denna fråga till javascript forumet nu, och återkommer med svar på hur man lättast integrerar det i ASP .Net för er som vill veta :D
Där jag har kommenterat //?? vet jag inte riktigt vad som händer, annars tycker jag att jag har kommenterat ganska rejält... Jag kommer posta detta i JS forumet också som sagt, för att få hjälp att förstå det helt.
Jag tror att jag kommer lägga en cookie hos besökaren som innehåller skärmens höjd och bredd som jag redan har kod för med min första länk, och sedan även utöka plugins arrayn lite samt använda mig av en httpModule för att tracka användaren under hela besöket. Det borde gå om man försöker lite. ;)
Kom ihåg att detta scriptet är netstads och självklart därför är copyrightskyddat, men jag använder det ju för att lära mig :).
// JavaScript Document
function plugNS() //scanning for plugins in NS
{
var b = 1;
var o = 0;
var p = new Array("Shockwave Flash",
"Shockwave for Director",
"RealPlayer",
"QuickTime",
"VivoActive",
"LiveAudio",
"VRML",
"Dynamic HTML Binding",
"Windows Media Services");
var np = navigator.plugins;
for (var x=0; x < p.length; x++) //looping through plugins array
{
//looping through all installed plugins
for (var i=0; i<np.length; i++)
//if there is a plugin installed that is in pre-made array, but then what??!?!?
if(np[i].name.indexOf(p[x]) >= 0)
o|=b; //??
b *= 2; //??
}
return o;
}
function plugIE() //scanning for plugins in IE
{
if(!document.body) document.write('<body>'); //??
var db = document.body;
var o=0; //??
var b=1; //??
var p = new Array("D27CDB6E-AE6D-11CF-96B8-444553540000", //this is IE's way of marking specific plug-ins
"2A202491-F00D-11CF-87CC-0020AFEECF20",
"23064720-C4F8-11D1-994D-00C04F98BBC9","","","",
"90A7533D-88FE-11D0-9DBE-0000C0411FC3",
"9381D8F2-0288-11D0-9501-00AA00B911A5",
"22D6F312-B0F6-11D0-94AB-0080C74C7E95"
);
db.addBehavior("#default#clientcaps"); //?? - adds a behavior to the document body
for(var i=0; i < p.length; i++) //looping through all the plugins
{
//checking if there is a plugin in this position of the array
if (p[i])
//checking if this component is installed, but then what??!?!?
if (db.isComponentInstalled("{"+p[i]+"}","componentid")) o|=b;
b*=2;
}
return o;
}
function nedstatbasic (id, options) //id = personal id for this counter; options = 1 if frameset, 0 is not
{
var n = navigator;
var ver = n.appVersion;
var d=document;
var verIE = parseInt(ver.substring(ver.indexOf("MSIE")+5,ver.indexOf("MSIE")+6));
if(verIE>0) ver = verIE;
else ver=parseInt(ver);
/* HERE IS WHAT I WANT */
var u = "http://m1.nedstatbasic.net/n?id="+id; //declares the query string variable
var r; //r is the shit! (i.e. it gets you the referrer outside a frameset)
if(options&1) r = d.referrer; //if options is filled out, but it's 0; not a frameset
else r = top.document.referrer; //if you are using a frameset - the shit!
if(!(options&2)) //??
{
//rc new referrer variable
var rc = r;
//sets the index of questionmark in the referrer variable to i
var i = rc.indexOf('?');
//there was a questionmark, then change the referrer var to the URI without the querystring(s) attached
if(i>=0) rc = rc.substring(0,i);
i = rc.lastIndexOf('/'); //get the address without the slash in the end, I think
if(i>=0) //??
rc = rc.substring(0, i+1); //??
var l= '' +d.location; //create a variable location, and set it to current page
if(l.indexOf(rc)==0) r=''; //if the current location is the referrer, then remove the referrer string altogether
}
//u is what they append to the query string. If there is a referrer. They append it to the r querystring
if(r && (r!=d.location)) u += "&r=" + escape(r);
//if netscape (& gecko engine?) is used
if((n.appName=="Netscape" && ver>=3)) u += "&p=" + plugNS();
//if IE is used, version > 5 and in windows, and not opera, then append plugin string
if(verIE >= 5 && n.appVersion.indexOf('Win') >= 0 && n.userAgent.indexOf('Opera')<0) u+="&p=" + plugIE();
if(ver>=4)
{
var s = screen;
var w = s.width;
var h = s.height;
var c = s.colorDepth;
if(w) u += "&w=" + w; //if a width exist
if(h) u += "&h=" + h; //if a height exist
if(c) u += "&c=" + c; //if color depth is gotten
}
//this line won't work in XHTML 1.1 (document.write)
d.write('<a target=_blank href="http://www.nedstatbasic.net/stats?'
+ id
+ '"><img src="'+u+'" border=0 width=18 height=18 alt="Nedstat Basic - Free web site statistics"></a>');
}