--------------------------------------
 Hit counter mk2 v1.0 - site tracking
--------------------------------------

-[ About ]----------------------------

I developed this function purely because I could :) When I wrote the webkaos.co.uk script download tracking function I decided I would extend my hit counter (that I wrote a long time ago) to include seperate page impression counts.

It tracks visitors to your site, incrementing only on their first visit per browser session.
It also has the ability to increment seperate counters for page impressions. That is, a counter will be incremented every time the page is requested from the server.


-[ Using Hit counter mk2 ]---------------

1. Edit the aspcounter2.asp file.
   This file contains the code for the function.

   All you need to do in here is edit a single line to tell the script where to find the aspcounter2.xml file.

   On line 16 there is this: 'xstrFilePath = Server.MapPath("/path/aspcounter2.xml")'
     
   You need to replace /path/ with the path to the file from your webpublishing directory root.


2. Edit the aspcounter2.xml file.
   This file is the storage area for the counting functions.

   All you need to do is add extra page impression counter references to it when needed.
   This is done by simply adding extra nodes to the <counters> section.

   Simply add extra   <count id="x">0</count>   nodes INSIDE the <counters> tag. x being a unique id for the counter.

   These can then be used in the script to track page impressions.


3. Include the function in your page.

      <!--#include file="aspcounter2.asp"-->

   Of course, this will need to be altered to suit if the 2 pages (your code and aspcounter2.asp) are in seperate folders.


4. Use the function just as you would any native function.

   Syntax      kaos_countermk2(addcount, returncount)

               addcount is an Integer. It contains the unique id of a page impression counter.
	       Site-wide visits are always tracked, this argument allows you to use impressions too.
	       
               returncount is an Integer. It contains the id of the counter you would like returned by the function.
	       -1 disables returning of a value. 0 returns the sitewide visitor count.


   Note        If either argument is not an Integer the function will return Empty. (Or "")
               If returncount is not a valid id (or -1 or 0) the function will return Empty.


   Example     MsgBox kaos_countermk2(1,0)

               The above would increment the sitewide counter, the page impression counter with id=1 and return the value for the sitewide counter. 


-[ Other stuff ]---------------------

I made this!  http://www.webkaos.co.uk  |  chrisb@webkaos.co.uk
It has taken me time to code, and is free to use for everyone.. so please don't steal it
or try to make money from it or anything like that. ta :)

If you use the script on your website, I would appreciate an email informing me of the URL for it.
It would be nice who is using it.

E n j o y.