Web Counter ...
WASD Usage Page

     

This page is a WASD modified version of some original documentation. The code has been hacked a little by Mark Daniel to suit his own needs (its images are now pre-expired, <stdout> improved by making it binary, and can operate in both standard CGI and CGIplus environments) and is provided with the WASD Hypertext Package because it's very useful, works extremely well and is free. My thanks to the original author.

The image has been renamed COUNT.EXE and of course resides in the HT_EXE: directory. The program has the configuration and data locations hard-wired (groan) into the program. Select a suitable area within your Web infrastructure for a directory tree. The server account (HTTP$SERVER) will require write access to it. Create a directory named WEBCOUNT using something like:

  $ CREATE /DIR /OWN=account physical_device:[dir.WEBCOUNT]

Introduce a concealed logical name definition into your Web/HTTP-server startup:

  $ DEFINE /SYSTEM /TRANS=CONCEALED WEBCOUNT physical_device:[dir.WEBCOUNT.]

Once defined copy the following portions of the source directory tree into the area and create the LOG directory.

  SET DEFAULT HT_ROOT:[SRC.WWWCOUNT2_3.WCOUNT]
  CREATE /DIR WEBCOUNT:[CONF]
  COPY [.CONF...]*.* WEBCOUNT:[CONF...]*.*
  CREATE /DIR WEBCOUNT:[DATA]
  COPY [.DATA...]*.* WEBCOUNT:[DATA...]*.*
  CREATE /DIR WEBCOUNT:[DIGITS]
  COPY [.DIGITS...]*.* WEBCOUNT:[DIGITS...]*.*
  COPY RGB.TXT WEBCOUNT:[000000]
  CREATE /DIR WEBCOUNT:[LOG]

Now the configuration file WEBCOUNT:[CONF]COUNT.CFG must be customized for your site.

For each counter that will be collecting data a file, data_file_name.DAT, must be created in the WEBCOUNT:[DATA] directory. This file contains the plain-text count value. For VMS make sure ten or more spaces follow the number! Create the files with an editor or the CREATE command specifying any initial value required (zero is an obvious one :^), just make sure the spaces follow the number.

I am not pretending that this is full installation instruction but should be enough to get the counter going.

To use the CGIplus functionality simply specify

  <img src="/cgiplus-bin/count?df=data_file_name.dat">

instead of

  <img src="/cgi-bin/count?df=data_file_name.dat">

(and yes, it's the same image!)

The source files and original documentation are available.


This software is provided within its original licence conditions.

19. Copyright (all platforms)

Copyright 1995 by Muhammad A Muquit. Permission to use, copy, modify and sell this program for any purpose is hereby granted without fee, provided that this copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. If the program is included in a book, publication or in a software distribution media for sale, the author must be notified about it. No binary only distribution is allowed. All distributions must include the source and this copyright notice.

THIS PROGRAM IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHOR Muhammad A. Muquit BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


- Material by Muhammad A. Muquit Follows (slightly customized for WASD) -

The counter images you are seeing are previously generated with the described URL tags. I am not generating them while you load the page, because it creates many processes in my machine. This page is here just to show how the counter can be configured.

The keywords in the query strings can be separated by & or |

A nice Example page by Roberto Stelling in Brazil.


Frame color and Thickness

A frame with a bluish color is wrapped by default. You have to use ft=0 no ignore this feature.
<img src="/cgi-bin/count">

This may not work with all browsers. You should use at least one keyword in the query string (for example, df=data_file ). Random counter is displayed as no data file is specified. The default frame thickness, color and digit style is used.

<img src="/cgi-bin/count?ft=1">

No df= option, therefore random digits are displayed. Because of ft=1 no frame was wrapped.
 <img src="/cgi-bin/count?ft=6">

Random digits. Wrapped frame is with default color and thickness.
 <img src="/cgi-bin/count?ft=10&df=x.dat">

Random digits. Wrapped frame is with default color and asked thickness.
 <img src="/cgi-bin/count?frgb=ffd700&df=x.dat">

The wrapped frame is of the asked color and default thickness. The color is used as hex string. Note, DO NOT add # before the string as you use with Netscape. In query string, if you use a #, everything after # is ignored. So, be careful.

or you use can use the RGB triplets like:

    <img src="/cgi-bin/count?frgb=255;215;0&df=x.dat">

or you even use the color name. You have to add this support while you configure using the Count-config script.

    <img src="/cgi-bin/count?frgb=gold|df=x.dat">

Comma can be displayed

<img src="/cgi-bin/count?ft=0|df=x.dat|comma=T">

Rotation

<img src="/cgi-bin/count?ft=0|rotate=Y|df=x.dat">
<img src="/cgi-bin/count?ft=0°rees=180|df=x.dat">
<img src="/cgi-bin/count?ft=0°rees=90"df=x.dat>

The first counter is rotated default 270 degrees toward right, no anlge is specified as rotate keyword is used.

Digit Styles

<img src="/cgi-bin/count?dd=A|df=x.dat">
<img src="/cgi-bin/count?dd=B|df=x.dat">
<img src="/cgi-bin/count?dd=B|frgb=69;139;116&df=x.dat">
<img src="/cgi-bin/count?dd=C|df=x.dat">
<img src="/cgi-bin/count?dd=D|ft=3|df=x.dat">
<img src="/cgi-bin/count?ft=2&frgb=000000&dd=E|df=x.dat">

These are the supplied digit styles. You can use digits from other sources. Just create a directory inside digits directory, rename the digits ro zero.gif, one.gif....nine.gif and use the directory name with dd.


Change any color

Change green color to red
<img src="/cgi-bin/count?df=x.dat|srgb=00ff00|prgb=ff0000">

Negate the colors

<img src="/cgi-bin/count?netate=T&dd=A|df=x.dat">

Note that the digit color is negated but the frame is not.


Transparency

A specific color of the digits can be made transparent on the fly. Note the counter program do not care if your gif images are transparent or not, you have to tell explicitly which color to make transparent. Here we will make the white color of the digit style E transparent. We will not use any frame either, just to make it look simple.

    <img src="/cgi-bin/count?dd=E|ft=0|tr=T|trgb=ffffff">

You can use the RGB triplets for the color like:

    <img src="/cgi-bin/count?dd=E|ft=0|tr=T|trgb=255;255;255">

Make the black color of the digit style A transparent:

    <img src="/cgi-bin/count?dd=A|tr=T|trgb=000000&df=x.dat">
    or
    <img src="/cgi-bin/count?dd=A|tr=T|trgb=0;0;0&df=x.dat">
    or
    <img src="/cgi-bin/count?dd=A|tr=T|trgb=black&df=x.dat">

Make the green color of the digit style A transparent:

    <img src="/cgi-bin/count?dd=A|tr=T|trgb=00ff00&df=x.dat">
    or
    <img src="/cgi-bin/count?dd=A|tr=T|trgb=0;255;0&df=x.dat">
    or
    <img src="/cgi-bin/count?dd=A|tr=T|trgb=green&df=x.dat">


Hide the counter

You can keep the counter hidden if you like. You can do this by sh=0. The hit will be recorded but the counter will not be displayed. A 1x1 transparent GIF image is written which gives the illusion. You can use the no-increment feature for monitoring those hits to a secret page (described later>

    <img src="/cgi-bin/count?sh=0|df=x.dat">
A hidden counter is up there.


Monitor counter hits

You might have kept your counter hidden (or not). You can monitor the hits from another page just specifying the datafile and the keyword incr=F
    <img src="/cgi-bin/count?incr=F|df=page1.dat">
    <img src="/cgi-bin/count?incr=F|df=page2.dat">
    <img src="/cgi-bin/count?incr=F|df=page3.dat">


Number of digits

Say you want to display the counter in 5 digits only.
    <img src="/cgi-bin/count?md=5|df=x.dat">

or you do not want to left pad with zero, you want to display exact digits.

    <img src="/cgi-bin/count?pad=0|df=x.dat">

Literal

You can display a string literally. The valid characters in a string are 0123456789,:-ap
<img src="/cgi-bin/count?lit=0123456789">
<img src="/cgi-bin/count?dd=B&lit=0123456789">
<img src="/cgi-bin/count?dd=C|lit=0123456789">
<img src="/cgi-bin/count?dd=D&lit=0123456789">
<img src="/cgi-bin/count?ft=0&tr=1&trgb=ffffff|dd=E|lit=0123456789">
<img src="/cgi-bin/count?lit=a1,456-:p">


Counter as clock

Display time in 12 hr format.
<img src="/cgi-bin/count?display=clock">

Dispaly time in 24 hour format.

<img src="/cgi-bin/count?display=clock|tformat=24">

Display date

<img src="/cgi-bin/count?display=date">

Use timezone parameter to display time or date of any place in the world.


Display an image

Display a GIF image kept at digits/D directory.
<img src="/cgi-bin/count?ft=20|dd=D|image=lenna.gif|frgb=powderblue">


Counter options (all platforms)

[Originally written in HTML table by Kevin]

Parameter Name Description Default
display=X Specifies what to display. A valid string can be specified with display= parameter to display counter, clock or date. The valid value for the string parameter X is counter,clock or date For counter, this parameter is not need as counter is the default display type. display=counter
timezone=X Display time/date of the specified timezone. The parameter timezone= is only significant with display=clock or display=date. Use this parameter if you want to display time or date of another timezone. The timezone must be specified with a negative or positive four digit offset from GMT, for example: timezone=GMT-0500 or timezone=GMT+0000 or timezone=GMT+0530. The routine to display time of various timezones are written in a generic way. Therefore, the unix machines will not be aware of daylight saving time because of the way the routine is written. For example, if daylight saving time is on, to display time of NY, the timezone will be timezone=GMT-0500 instead of timezone=GMT-0400.

If the clock displays your local time wrong, specify your timezone with that parameter in order to display the correct time.

None.
tformat=X

[new in this release]

Time format in 12 or 24 hour. This parameter can be used to display time in 12 or 24 hour format. The valid values for the parameter X is 12 or 24. tformat=12
dformat=X Specifies date format. This parameter is only significant with display=date. The valid value for the string parameter X is any combination of MMDDYY (Month-Day-Year). For example, dformat=ddmmyy, dformat=YYMMDD. dformat=MMDDYY
istrip=B

[new in this release]

Use of image strip On/Off The boolean value of istrip specifies whether to use image strip or not. If you specify istrip=F, the program will look for the individual digit image files in the digits/style directory. The valid values for the Boolean parameter istrip are Y, N, T, F, 1 or 0. istrip=T
ft=X Frame Thickness You can wrap the counter in an ornamental frame of X pixels thick. Use 0 for no frame. Values over 5 make a nice 3-D effect. ft=6
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. If you use ft= without a frgb= param, the default color is used.

If you specify a frgb= without a ft=, then the frame thickness defaults to 5. All the examples show ft=5. The color can be specified as hex string or a name. Do not use a # before the hex string as Netscape. For example, if you want to specify white in hex, use frgb=ffffff. You also can use a color name (e.g. frgb=blue) if the counter configured to do so (look at the cfg file). Look at the color name mapping database for some hints about color name database.

frgb=100;139;216 or
frgb=648bd8
tr=B Transparency On/Off You can specify if your counter image will have a transparent color with the Boolean B. So tr=Y means there will be a transparent color. It does not matter if the GIF files used for the digits are "transparent"; 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. tr=F
No Transparency
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
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. pad=N
Without specification of a md=value

pad=Y
With specification of a md=value

dd=A Digit Directory Denotes directory of a specific styles of digits. Four styles of digits are supplied. They are kept at the directories A,B,C and D respectively. Visit the digit mania page for other styles of digits. dd=A
My green led digits
image=gif_file

[new in this release]

Display this GIF file You can display any GIF image specified with this parameter. The location of this file is determined by the dd= parameter. All attributes of the counter applies to the image. None
comma=B

[new in this release]

Display comma after every 3rd digit from right. The boolean value of parameter comma specifies whether to 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=F
srgb=R;G;B
prgb=R;G;B

[new in this release]

Change a color of the image to a target color on the fly. Any one color of the image can be changed to a different color on the fly. srgb stands for source color, that is the color to change. prgb stands for pen color, that is the target color. The values for srgb and prgb can be colon separated color components (e.g, srgb=255;0;0), a hex value (e.g. srgb=ff0000) or a color name (e.g. srgb=red). The color name can be used if you configured the counter to do so (look at the cfg file). srgb=00ff00
(0;255;0 green)

prgb=00ffff
(0;255;255 cyan)

With chcolor=T

chcolor=B Change a color of the image. This parameter is usually used to change the default green color to cyan. That is if you specify chcolor=T, and you want to change green to cyan, then you do not need to specify srgb and prgb parameters. 1x1 GIF is displayed. The valid values for the Boolean parameter B are Y, N, T, F, 1, or 0 chcolor=F
st=X Start Count This parameter is used to set the initial value of the counter to some number X. This is only valid if you decided to allow automatic datafile creation. It is a bad practice to allow automatic datafile creation, however it makes site maintaining easier. The automatic datafile creation option is specified in configuration file and can be changed at run time. Note that this parameter has no effect if the datafile already exists. If you want to change the counter value in a existing datafile, hand edit the file. The minimum value for st is 1. st=1
Count starts at 1
sh=B Show digits Used to turn display of digits on or off according to the Boolean B. 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

sh=Y
df=data_file Datafile to store count Specifies the name of the file for storing the count in. The file must be allocated to you as was mentioned in the "Authorizations" section above. You can use df=random to display a random number.

One special use of the parameter is df=RANDOM. This returns a random number using the fractional portion of the host's time of day clock as a seed for the generator. Unlike all other WWWcounter parameters, the file name provided is case-sensitive, except for the value random. Or Random, or rANDOM, etc.

df=random
if no datafile is specified
incr=B Increment Count Makes it possible to display the current count without incrementing the count. This can be used to examine the count for reporting or other purposes 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
lit=X Display literal Makes it possible to display a given, predetermined string. The valid values for the string X are digits, a,p,: and - None
negate=B Negate the color Makes it possible to negate the color of the counter digits. Note that the Frame is exempted from negating. Valid values for the Boolean parameter B are Y, N, T, F, 1, or 0. negate=F
Do not negate
degrees=X Rotate X degrees Makes it possible to rotate the counter image X degree. The possible values of X is 90, 180, 270 and 360. Note 360 is meaningless as the counter will come back to the original 0 degree. degrees=270
With rotate=Y and without degrees=X
rotate 270 degrees clockwise
rotate=B Rotate On/Off The Boolean value B turns on or off rotating. If you use degrees= setting, rotate is not needed. Valid values for the Boolean parameter B are Y, N, T, F, 1, or 0. rotate=F
Do not rotate

That's all folks! I hope you'll get enough clues from this page!