View Full Version : The new counter

07-17-2003, 02:50 PM
I got email this morning to say that Westhost have installed a new page counter on each account... but I can't seem to find it anywhere.

Looking at the manual (part7 - cs-counter) it says that I have to "upload the files to the correct locations", but if its an installed script, surely thats not needed? I don't have the files anyway.


Anyone have a clue what the situation is?

07-23-2003, 10:45 AM
WestHost did install the counter and it is there but I have found what I think is a bug and I have contacted WestHost about it.

The documentation says that the images for the counter are in
When I looked at my site through ftp they where actually in


I made the correction to my site manually and the counter worked.

I did contact WestHost and they are aware of the problem and working on it.

I have created some diffrent .gif and .jpg images that you can use with the new counter. If you would like to use them they are here:

I asked WestHost if they minded me posting them for others and they did not say no so I am assuming this is ok.

When WestHost mentioned uploading files they where talking about if you wanted to use new digits like the ones I have made.

07-24-2003, 11:56 AM
I also contacted the support and apparently the counter was not installed automatically, you need to ask them to install it for you.

Wasn't mentioned in the newsletter, but so it goes.

I'll check out the digits tho.

10-10-2003, 07:51 AM
Does anyone know how to set up multiple pages with counters? Ijust keep getting the same count on each page.

10-10-2003, 08:26 AM
The manual page explaining this is here http://manual.westhost.com/pagecounter.html
That is if you are using the whcounter supplied with your account.

The quick answer for you is that there are three variables that you must set when inserting the javascript on your page.


The one you need to set is page. This should be the page you have placed the counter on.


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


10-10-2003, 08:39 AM
I have done this. However, the counters do not work independently from one another. If I reload one page over and over again, raising the number to, say 19, then I reload a second page just once, its counter reads 20. And I do have them set up the way you just described.

10-10-2003, 08:46 AM
I cannot get a counter to work on any page that is not under the main directory. For example, mydomain.com/test.html --> the counter will work. mydomain.com/nextlevel/test.html --> the counter wil not work.

10-10-2003, 10:44 AM
Try this page=/nextlevel/test.html. Also the files that control this are located in the /cgi-bin/whcounter/ There should be three files. config.txt, stats.dat and whcounter.cgi. The stats.dat file is the one that is holding the numbers for each page. Look at it and see what it has in it. That may give us a clue to what is going on. If you are continueing to have problems you can post the urls to the pages and I will look at them to see if I can figure it out.


10-10-2003, 11:10 AM
I actually had already tried adding the directory structure, and it doesn't work. I even uploaded the cgi-bin/whcounter files under the nextlevel and it STILL doesn't work.

This is what the stats.dat file says:

Here are four pages to which I have added the counter at the bottom. Note, I had to use cgi-bin/cgi-bin/whcounter as that is how westhost set up my files. I have no idea why there are two directories named cgi-bin, but I didn't mess with it so I wouldn't screw it up royally.


10-10-2003, 03:34 PM
Think I see part of the problem. Make the call to the script like this


Note that I added a forward slash "/" before the first cgi-bin. This tells your pages that are not in the root www directory that they are supposed look from there right now they are looking for it in /Fanfiction/cgi-bin/cgi-bin/whcounter/whcounter.cgi .

Also check your java very carefully... on the beautiful.html page you forgot the "=" after page. That would account for all the =1 =2 =3 and so on entries and why you are getting repeat numbers. Your test.html is the same. I just checked code on all and it looks like you missed it on all the pages except the buy.html page. Below is how the buy.html code should look like.

<script language ="JavaScript" text="text/javascript" src="/cgi-bin/cgi-bin/whcounter/whcounter.cgi?display=text&page=buy.html&style=bigblue"> </script>

Let me know if that makes sense.


10-10-2003, 10:39 PM
Holy cow! Every single character means so much. I have it working now. This is how I managed to get the counters to work in other directories:

<script language ="JavaScript" text="text/javascript" src="http://www.channelingboards.com/cgi-bin/cgi-bin/whcounter/whcounter.cgi?
display=text&page=Fanfiction/buy.html&style=bigblue"> </script>

Thank you so much for your help! I never even noticed that stupid little "=".


10-10-2003, 11:37 PM
{Sigh} Now I can't get the image counters to work. My directory structure does not have the extra whcounter like yours. So, I have the config.txt set up like this:



I have the ten images uploaded in the right directory. My html on the test.html page looks like this:

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

What in the world am I doing wrong now?

10-11-2003, 10:39 AM
Ok let's back up just a bit. Do me a favor and FTP to your site and look and see if you have a whcounter directory in your main /cgi-bin just like in the /cg-bin/cgi-bin. On my account I also have the second cgi-bin but when I click on it thus going to /cgi-bin/cgi-bin it has what was in my old cgi-bin that was on 1.0 wich included the counter. All the files that are in that second cg-bin are also in the main one. I do not know if this a product of the migration that has to be or a bug in the migration that is duplicating the bin. I will say this I access the counter using
/cgi-bin/whcounter/whcounter.cgiWhen I do this the stats.dat is modified in both versions. This leads me to belive that the second cgi-bin is some kind of symlink although it does not look like the others.

Hope I did not lose you with all that. The bottom line is this.

1. Your setting for the image directory is correct or atleast like mine.
2. Make sure that when you upload the images that they are in /images/whcounter. That is from your www directory not the cgi-bin directory.
3. I want you to change your java call to look like this on all the pages (except for the page variable make it simply the page you are inserting the js into)

<script language="JavaScript" type="text/javascript" src="/cgi-bin/whcounter/whcounter.cgi?display=image&page=yourpage.html&style=buf"></script>
Do not add the anything in the src variable aside from the /cgi-bin/whcounter/whcounter.cgi. I do not have to on my site and the counters are not in the main www directory.

NOTE: The page variable really does not have to be the page it is on. The script really does not care. The important thing is that each page you put it on has a diffrent variable that is specific to that page. For now go ahead and use the format we have talked about i.e. /directory/page.html . I just wanted to pass this on as a hint that you could use anything even (a,b,c,d,e,f,g,h, and so on) to distinguish each page.

If anyting I have said does not make sense let me know and I will try to clarify.

10-11-2003, 07:07 PM
Okay. Here's the deal. I changed the whole configuration around so that I only had one cgi-bin directory. That still didn't work. I finally dragged my husband into this and he {duh} figured out what was wrong right away.

First, I had to make sure that the /cgi-bin/whcounter/whcounter.cgi was written as http://www.channelingboards.com/cgi-bin/whcounter/whcounter.cgi

Next, I had read that the permissions needed to be set on the whcounter.cgi file, but it sounded so foreign that I ignored it and assumed it was all preset. So, needless to say, once we set the permission to 755, the darn thing worked fine. (I can't say that the explanation in the online manual made much sense to me at all, though.)

I'm not really happy with how long the images take to load though, so after all that, I'm sticking with a custom text counter.

Thank you so much for your help. I hope that this little tid bit helps someone else.