Web page counters can give a site visitor an indication of how popular a web site is, and for web authors without access to server log files, it is often the only clear indication of how many people have visited their site.
Counters work by having web server execute a small program whenever the page is requested. This program then inserts a small image on the page with a representation of the number of visitors to that page. Setting up a counter normally involves messing around with CGI scripts, but the Hit Counter Component of FrontPage 98 makes things much simpler. This article describes how to use this Component to add a counter without a hint of CGI programming required. It will also solve a further mystery - how to use your own digits instead of the rather limited choice supplied by Microsoft.
Components (referred to in FrontPage 97 as WebBots) allow you to add extra functionality to your web pages, and automate repetitive procedures. There are two main types of Components. The first group work in the FrontPage editor, and carry out mundane procedures such as inserting the document modification date into the document. By contrast, other Components run on the web server, and carry out procedures such as the ability to search pages for information, or build a table of contents for your site. These Components will only work on a server if it is running the FrontPage server extensions. This includes the Hit Counter Component that is described here.
The Hit Counter Component was first available as part of the FrontPage 97 developer's samples, and getting it to work with that program was notoriously difficult. Thankfully, the counter is now an integral of FrontPage 98, so there should be far fewer problems getting it running.
Components are easily added to your web page from within the FrontPage editor - use the menu bar command Insert|FrontPage Component, or click on the Insert FrontPage Component icon on the standard toolbar. A menu will then appear, containing a list of available components which you can use. The counter Component is known as the Hit Counter. After selecting this, the Hit Counter Properties window will appear as shown below. Ensure that you have selected a Counter Style from those listed. It is normally a good idea to ensure that the fixed number of digits check box is ticked - 5 is a good number to set this to (though obviously if you get more than 10,000 visitors a day, the counter won't last long before it resets to 00000). Your first visitor will therefore see the number 00001 as the visitor total, the next visitor will see 00002 as the total, and so on.

After you click on the OK button, the counter will be inserted on your page, and will be represented by the text [Hit Counter]. By double clicking on this area, you can alter the appearance of your counter at a later stage, and even reset the counter to a new number. It is useful to reset the counter if your page gets a large number of visitors and you only want to count the number of visitors since a specific date, such as from the first day of the month. It is often a good idea to let people know when the counter was started, for example by adding the text ...visitors since 19 December 1997.
Having got your counter up and running, you will notice that the Hit Counter properties window has an option for selecting a Custom Image. As you may have guessed, this enables you to use your own digits instead of the original five sets available. Although it is quite a awkward job, it is worthwhile spending an hour or so making your own digits because:
The existing digits may not fit in with the look of your web page,
Since FrontPage is a popular web site management tool, it won't be too long before web site visitors are bored with seeing the similar looking web page counters that are produced by using the default digits.
The Hit Counter Component makes the unique counter image for the web page by taking a single GIF image, then cutting and pasting the various digits required in order to make a unique GIF to send to the web browser. This means that you need to make a GIF image with the numbers in the order 0123456789. The only catch (and it is a major one) is that the digits must all be equally spaced. For example, if your numbers are each 15 pixels wide, the final image must be exactly 150 pixels wide. Don't forget to leave some space between each digit - one or two pixels is normally sufficient.
Finding fonts that are exactly proportional (i.e. equal spacing between the letters) is extremely difficult. Even supposedly proportional fonts such as the Courier True Type font supplied with Windows has a few digits that are slightly wider than others. But most Windows fonts can be used with some subsequent modification.
To make the series of digits, I normally use PaintShop Pro (but any program that can save images in GIF format will work). Starting with a blank page, I add some text in my chosen font (16-26 point text is the usual size for counters). I then zoom in to the text, and starting with the zero, select each individual digit, and ensure it is the same width to the others, and has uniform pixel spacing around it. After the text is proportionally spaced, I then give the text a gradient fill, or apply the hot wax coating effect. The exact color or effect you want for your text will, of course, depend on how you want it to fit in with the rest of your web page. Unfortunately, you can't use transparent GIFs as counters - it would be nice if Microsoft could fix this in future versions of the Hit Counter.
After you have made your custom digits image, import it into the FrontPage web using the FrontPage Explorer. It is normally a good idea to put all your image files in a specific directory (such as images). You can then enter the filename of this image into the Hit Counter properties window in the Custom Image field, making sure that you enter the correct path from the main directory of your FrontPage web (e.g. images/numbers12.gif):

Having done this, you can then test the Hit Counter. If all goes well you
should see the counter appear on the page. If the digits appear normally (e.g.
) then all is well. But
if the digits weren't spaced evenly, then the counter will look wrong (e.g.
). If this happens, you
will need to take a trip back to your graphics program and correct the problem.
Finally, if you want to try a different range of digits for your counter but don't want to spend time messing around in a graphics program, my personal web site has a page with a few ready to use GIFs. And naturally, no article about web page counters can be complete without a mention of the intriguing Museum of Counter Art.
Author: Brett Burridge
Date: 01/29/97
More articles about FrontPage
More articles by Brett Burridge
Author Biography