Website Access Counter
Version: 1.1
Released: 13th February 2000
|
|
So many pages have access counters and I thought that I would create one for my
own webpage... It's very simple but can be easily configured to use your own images
for the numbers and to select the minimum number of digits to display. To see the
counter in action, take a look at my
title page
where there is a counter right down at the bottom of the page. If you like it then
you can download and use the script for free! Just read on...
Your System
Webservers come in many different shapes and sizes and unfortunately I can't
document instructions for how to use this script on all of them. Instead I
have made some assumptions about the system you should use if you want to use
this script. It will be possible to make the script work on other systems, but
you may have to make some modifications to the script or the way that you use
it.
I've assumed that you are using a UNIX webserver with Perl already installed
in /usr/local/bin. Also, your webserver must be capable of handling server
side included scripts (SSI) and I can't guarentee that the actual syntax that
I use for including the script will work on anything other than the Apache
webserver as that is the one which I use.
This script works fine on my system and some others that I've used it on, but
as always Your Mileage May Vary...
Download
Click on one of the links below to download an archive containing the files.
Each of the archives contains the same files, so you need only download one
archive which you are able to decompress on your system.
Installation and Use
Once all the above steps have been completed it should be just a case of reloading your
webpage and hopefully hey-presto there's your very own web counter!
Customisation
-
Images
It is fairly simple to change the images for the digits if you wish to use a set of your
own or a set downloaded from the net. First create or download your images... you should
have a separate image for each digit 0-9 and make sure that each image has the same
dimensions. Save the images as dg0.gif to dg9.gif in the
same directory as the script. Then edit the counter.cgi script. Near the start of the file
there are two lines similar to the following:
$imagewidth = 14;
$imageheight = 20;
Simply change the values of these variables to the dimensions of your images and that's all
you should have to do.
-
Change Minimum Number of Digits Displayed
By default the counter will show five digits, using leading zeros if necessary
to make up the digits. If the count becomes larger than will fit in those five
digits then the counter will display as many digits as are required. If you
prefer then you can set a different minimum number of digits to display. All
you need to do is to change the value of the 'width' variable near the start
of the script.
Just change the value of the variable to whatever number of digits you
want to use.