Digits.net Web Counter
Home
Contact
Get your free Digits counter here >  

How to Use Your Counter

This file contains information which should help you use your counter. If you have more questions, see the FAQ Page. If you are having problems with your counter, please see our Troubleshooting Page.

Basic

To install a counter into your page you first must create a counter with the form on the creation page.
Afterwards, you can insert predefined counter, like this for example: Hit Counter by Digits

  <a href="http://www.digits.net" target="_blank">
    <img src="http://counter.digits.net/?counter=system_counter&template=simple" 
     alt="Hit Counter by Digits" border="0"  />
  </a>

This is the basic way to use your counter. The name string at the end of the above HTML code should be replaced with the name of the counter that you have created.

Option Usage (for custom counter only!)

There are many other options which control the look of the resulting counter number. To use these additional options, you insert them into your IMG SRC entry by separating them from your counter-name and from each other with the / or ``forward slash'' character. Some options are accompanied by values -- these values are also separated with the / character. For instance, the digits option requires a number argument -- in our example this argument is 4. So your HTML code will go from:

Hit Counter by Digits
  <a href="http://www.digits.net" target="_blank">
    <img src="http://counter.digits.net/?counter=system_counter&template=simple" 
     alt="Hit Counter by Digits" border="0"  />
  </a>
To:
Hit Counter by Digits
  <a href="http://www.digits.net" target="_blank">
    <img src="http://counter.digits.net/?counter=system_counter&template=simple&digits=10" 
     alt="Hit Counter by Digits" border="0"  />
  </a>
NOTE: The name string at the end of the above HTML code should be replaced with the name of the counter that you have created.

Now that we are using the digits=10 option and argument, we might wish to add the rightface and zerofill options as well. Neither of these two options require arguments so your HTML code will go from:

Hit Counter by Digits
  <a href="http://www.digits.net" target="_blank">
    <img src="http://counter.digits.net/?counter=system_counter&template=simple&digits=10" 
     alt="Hit Counter by Digits" border="0"  />
  </a>
To:
Hit Counter by Digits
  <a href="http://www.digits.net" target="_blank">
    <img src="http://counter.digits.net/?counter=system_counter&template=simple&digits=10&rightface&zerofill" 
     alt="Hit Counter by Digits" border="0"  />
  </a>
NOTE: The name string at the end of the above HTML code should be replaced with the name of the counter that you have created.

Notice that the / character separates each of the options as well as any of their required arguments. Also, see that the 10 argument is still right next to the digits option. This should be true for all options which have an argument.

Available Options

The following is a list of the available options that can be used with your counter.

digits=number
Returns an image with a certainly specific number of digits. The number string here should be replaced by a decimal number such as 4 or 6. See the Image Size section below for more details.

You may also want to use the rightface and zerofill options below depending on how you want your counter to display.

charset=number
Selects a different character set for your digits. The number string here should be replaced by a decimal number from 0 to 27 (currently). See the Character Set Page for more details.
randcharset
Selects a random character set for your digits. See the Character Set Page for more details.
foreground=color
Specifies the foreground color of your image. The color string here should be replaced with a 6 position hexadecimal value. See the Colors Page below for more details.
background=color
Specifies the background color of your image. The color string here should be replaced with a 6 position hexadecimal value. See the Colors Page for more details.
spacecolor=color
Specifies the empty space color of your image. The color string here should be replaced with a 6 position hexadecimal value. See the Colors Page for more details.
hidedigits
Hides the digits and only return a blank image. This is useful if you want to count the number of page views on your page but not show this count to others.
notincrement
Only return your count -- your count is not incremented. This should only be used in special circumstances.
rightface
Specifies that the digits returned will be right-face. If your counter value is 12 and you request 4 digits with the digits=10 option, then the system will by default return 12__ (12 followed by 2 transparent spaces). Use this option if you want it to be __12 (2 spaces then the number.
zerofill
Fills any empty spaces with zeros. If your counter value is 12 and you request 4 digits with the digits=10 option, then the system will by default return 12__ (12 followed by 2 transparent spaces). Use this option if you want it to be 0012 (2 zeroes then the number). Note that for any zeros to be seen, you must specify a larger number of digits than in your counter value.

Please see the above Option Usage section for more information about the proper usage of these options.

Image Size

By specifying the number of digits with the digits=number option you know the size of the image that will be returned. With this information, you can specify WIDTH and HEIGHT information in the IMG entry. These values allow Netscape Enhanced clients to reserve space for the image while drawing the page so you don't have to wait for the image to be loaded before seeing all of page's text. All of your image entries should contain these options.

The HEIGHT of the returned image is always 20 (pixels). The WIDTH is calculated as 15 times the number of digits specified. So if you are using the d/4 option, the WIDTH should be set to 4 * 15 or 60 (pixels).

Hit Counter by Digits
  <a href="http://www.digits.net" target="_blank">
    <img src="http://counter.digits.net/?counter=your_counter_guid&template=simple" 
     alt="Hit Counter by Digits" border="0"  />
  </a>

10 digits will have a WIDTH of 10 * 15 or 150, etc.. The HEIGHT is always 20.

NOTE: If you wish your counter to be a different size, you can certainly tune the HEIGHT and WIDTH of the IMG and the browsers should scale the image appropriately. The image may look better if the WIDTH and HEIGHT values are scaled evenly. For instance, instead of a 4 digit image having a WIDTH of 60 and a HEIGHT of 20 you can set it to a WIDTH of 120, HEIGHT 40. This should double the size of your counter. Understand that some character sets will scale better than others.

Additional Information