Getting my Counter to work

Because I wanted multiple pages buried in subdirectories to each display their own correct counter, I had to tweak some of the files. The solution was a lot easier than I thought it would be, so I'm posting it here. (Read the complete thread on Westhost's forums here.)

thattherepaul Junior Member  
 
Join Date: Aug 2005 Location: boston Posts: 2
Default Solution: Putting Counter 1.0 On Multiple Pages

Kinda funny, I'm replying to my own post.

To get Counter 1.0 to display on multiple pages, including pages buried in subdirectories, you need only modify the config.txt entry and the .html page on which you want your counter to appear. Remarkably, you don't need to specify the subdirectories.

First, change the config.txt entry "[image_dir]"
from "images/whcounter" to the complete URL of the directory containing those little odometer.gifs. (For example, I changed the entry after "[image_dir]" from "images/whcounter" to "http://thattherepaul.com/images/whcounter" on my website thattherepaul.com.)

Second, on whatever page you want the counter to appear, change "index.html" to "whateverpage.html." (For example, for the counter on http://thattherepaul.com/features/netflixrules.html, I changed the code

<script language="JavaScript" type="text/javascript"
src="cgi-bin/whcounter/whcounter.cgi?display=image
&page=index.html
&style=odometer">
</script>

by replacing "index.html" with "netflixrules.html".)

Interestingly, this worked even though netflixrules.html is buried in the "features" subdirectory of thattherepaul.com. So don't waste time, as I did, specifying the exact path of each page on which you want a counter, just specify the title of the page. Similarly, you don't need to type anything in the stats.dat file, nor do you need to tinker with the whcounter.cgi script.

The counter's fun, and I hope this advice makes it useful for other people. It might make sense faster to visit and copy the counter code on my site, http://www.thattherepaul.com, so feel free.

Paul

For some reason, this page has been visited times. © thattherepaul