Web Counter

From SonicWiki
Jump to: navigation, search

Webcounter How-To

Important, please read all items carefully before posting questions.

If you have questions about the counter, please post them to sonic.help.www newsgroup.

Each page you want a counter on should have a separate counter.

If you created a datafile by putting the code on your page (yes it creates a data file), and don't want that data file anymore, please email support and ask us to remove it. Include the names that you used to create it, like bob.index. Thanks!

Sonic Webmaster



Stands for Boolean value, T or f (True or False). Don't use B in your counter.


Stands for a numbers value that you choose.

R, G, B

Red, Green and Blue values. The values are represented by numbers.


Represents the name of the directory containing the digit style you choose.


Represents the name of the file that will store your count. The first part will be your login name, the second will be a unique name for your page. ie: jezzie.index

| Separates the options. (Usually the Shift \ key.)

This page will use a generic counter string for the examples.
Do not copy this string directly as it won't work.

<img src="/cgi-bin/Count.cgi?dd=A|df=name.file.dat">
<img src="/cgi-bin/Count.cgi? Necessary for every counter
dd=A Somewhat necessary. Used to show digit style choice.
df=name.file.dat"> Necessary. name is your login name, file is the first part of your page name, like index.

Default - if you want the default value, don't specify that parameter (Leave it out).

Parameter Name Description Default
1. ft=X

Frame Thickness

You can wrap the counter in a frame X pixels thick. Values over 5 create a 3-D effect. Use ft=0 for no frame ft=6
<img src="/cgi-bin/Count.cgi?ft=6|dd=A|df=name.file.dat">
2. frgb=R;G;B

Frame Color

Specifies the color of the frame in RGB (red/green/blue) format. Each color component, R, G, and B is specified as a value between 0 and 256.

The color can also be specified as hex string. Do not use a # before the hex string as in Netscape. If you want to specify white in hex, use frgb=ffffff.

frgb=100;139;216 or
<img src="/cgi-bin/Count.cgi?frgb=ffffff|dd=A|df=name.file.dat">
3. md=X

Max Digits

Defines maximum number of digits to display. Any value between 5 and 10 inclusive are permitted. Padding with leading zeros is automatically done for you; longer counts are truncated to the given X. md=6
Without padding
<img src="/cgi-bin/Count.cgi?md=5|dd=A|df=name.file.dat">
4. pad=B

Padding with 0's

Turn padding on/off in conjunction with md= setting. Valid values for the Boolean parameter B are Y, N, T, F, 1, or 0.

Without specification of a md=value

With specification of a md=value

<img src="/cgi-bin/Count.cgi?pad=N|dd=A|df=name.file.dat">
5. dd=A

Digit Directory

Denotes directory of a specific styles of digits. Please visit the [digits.shtml Digits Page] to select the style you want.

<img src="/cgi-bin/Count.cgi?dd=F|df=name.file.dat">
6. comma=B

Display Commas

Display comma after every 3rd digit from right. If you use this parameter as true, the left padding with zeros will be turned off. comma=T for commas, comma=F for no commas.

If you select the comma feature, please make sure your [digits.shtml digit choice] comes with a comma, otherwise you will break your counter display.

<img src="/cgi-bin/Count.cgi?comma=F|dd=A|df=name.file.dat">
7. st=X

Start Count

This parameter is used to set the initial value of the counter to some number X. The minimum value for st is 1.

Note that this parameter has no effect if the datafile already exists. If you want to change the counter value in a existing datafile, you need to ask the webmaster to change it.

Count starts at 1
<img src="/cgi-bin/Count.cgi?st=2000|dd=A|df=name.file.dat">
8. df=data.file

Datafile to store count

The name of the file that contains your count. You can use df=random to display a random number. df=random
if no datafile is specified
<img src="/cgi-bin/Count.cgi?dd=A|df=name.file.dat">
9. lit=X

Display literal

Display a given, predetermined string. ie: lit=1234 will display that number in your counter. None
<img src="/cgi-bin/Count.cgi?lit=1996|dd=A|df=name.file.dat">
10. degrees=X

Rotate X degrees

Rotate the counter image X degrees. The possible values of X are: 90, 180, and 270. degrees=0
<img src="/cgi-bin/Count.cgi?rotate=90|dd=A|df=name.file.dat">
11. incr=B

Increment Count

Display the current count without incrementing the count. This can be used to examine the count without adding to the count. Valid values for the Boolean parameter B are Y, N, T, F, 1, or 0. incr=T
Increment the counter on each invocation
<img src="/cgi-bin/Count.cgi?incr=F|dd=A|df=name.file.dat">
12. sh=B

Show digits

Turn display of digits on or off. When sh=T, counter will be displayed and incremented, this is the default behavior.

If sh=F no digits will show, but the counter will still increment; instead of digits a transparent 1x1 GIF is displayed. The valid values for the Boolean parameter B are Y, N, T, F, 1, or 0

<img src="/cgi-bin/Count.cgi?sh=N|dd=A|df=name.file.dat">
13. negate=B

Negate the color

Makes it possible to negate the color of the counter digits.

The Frame will not be negated. The valid values for the Boolean parameter B are Y, N, T, F, 1, or 0.

<img src="/cgi-bin/Count.cgi?negate=Y|dd=A|df=name.file.dat">
14. tr=B

Transparency On/Off

Specify if your counter image will have a transparent color. So tr=Y means there will be a transparent color. You must specify explicitly which color to make transparent.

If you specify a trgb=, then you do not need to specify tr=Y. If you specify tr=Y and do not specify trgb=, then the default color black will be transparent.

The valid values for B are Y, N, T, F, 1, or 0.

<img src="/cgi-bin/Count.cgi?tr=Y|dd=A|df=name.file.dat">
<img src="/cgi-bin/Count.cgi?trgb=0000ff|dd=A|df=name.file.dat">
To specify blue as the color to be transparent.
Special thanks to muquit@semcor.com for his wonderful counter program.