Drucken
  • Deutsch
05. May 2007

Guide to implement an access counter

Please see the examples for usage.

I guess that this short description is long enough for making it possible to install an access counter on your homepage at ASAM/ASAMnet.

For further information see the original Counter documentation. You only need to invoke the counter out of an HTML page, the program itself is already installed.

If you want to work with the original Counter documentation please note that it is needed to call the counter by using /cgi-bin/count-cgi/Count.cgi... and not by /cgi-bin/Count.cgi... (like mentioned in the original description).

Additionally you should know that the so called Frontpage Extensions for security reasons are not installed at ASAM. You cannot use this software for creating your own counter. Please use only the counter described on this page.

If you're running into trouble or do have difficulties to get your counter working feel free to send email to Thomas.Belmer(at)asamnet.de or the CGI-Team.

Please note that the counter in most examples here is used as a simple access counter. If a visitor is going to view your page some times in serial, the counter will increase every time.

If you don't like this behaviour it's needed to add the reload=N parameter.

Example: The following access counter is implemented as a simple hit counter, that means that really every access will be counted. If your visitor presses the "reload" button of his browser the counter increases.

simple, no frame, digit style A (default)

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample&ft=0">

The next counter is identically to the above one. The only exception is that it works as a real counter. Pressing the "reload" button in the visitor's browser or visiting the page multiple times within short time distances will not increase it.

Just insert the code reload=N before the last double quotation mark to avoid counting every time the "reload"; button is used.

Same like above, but as a real counter

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample&ft=0&reload=N">

How does it work?

The counter is handled like a normal image of the file format GIF. Therefore it is necessary to invoke it out of a HTML page by using the following code: 

<img src="image">

Of course we don't want to show the picture image. Instead of this file we want to invoke and display the counter.

The counter itself is nothing else than a simple program that runs on the ASAM server. It returns an image/picture that shows the appropriate digits.

The name of this program that makes the counter is Count.cgi. Note that programs running on Unix do not need to have an EXE file extension (like for example on Winblows). But it cares on upper/lower letters, that means it is case sensitive.

This count program Count.cgi is located in the directory /cgi-bin/count-cgi, so it is important to invoke it through /cgi-bin/count-cgi/Count.cgi.

<img src="/cgi-bin/count-cgi/Count.cgi&&ft=0">

ohne Parameter

The program does neither know what counter value it has to show nor does it know how (what kind of design).

Therefore without a given data file random digits are displayed. The used parameter ft=0 only causes the counter to get surrounded by a frame without thickness (even no frame).

Let's pick a data file and have a look at its content. We'll use the file beispiel (that is German and means 'sample').

<img src="/cgi-bin/count-cgi/Count.cgi?df=beispiel">

df=beispiel causes the file beispiel to be used for data file (df).

The filename sample will be used as an example for the rest of this documentation.

Only use data files that start with your username. The name I'm using to dial up to ASAM is "belmert". So I would call my counters df=belmert01, df=belmert02 etc... Of course you can use names like df=belmert_index and so on too, but please use your own user ID, not mine. :-)

It is important to have your user identification in your counter's name for assigning it. German umlauts are not allowed too.

Let us just pick a design for our counter, dd=blueodo (dd = digit directory) sounds good to us, and remove the frame by using ft=0 (ft = frame thickness).

<img src="/cgi-bin/count-cgi/Count.cgi?df=beispiel&dd=blueodo&ft=0">

As mentioned above we implemented our access counter as a hit counter only. For making a real counter we will need to add a reload=N.

<img src="/cgi-bin/count-cgi/Count.cgi?df=beispiel&dd=blueodo&ft=0&reload=N">

Digit style "asam"

<code><img src="/cgi-bin/count-cgi/Count.cgi?df=beispiel&dd=asam&ft=0"></code>

Simple, no frame, digit style B

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample&dd=B&ft=0">

Simple, no frame, digit style blueodo

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample&dd=blueodo&ft=0">

Simple, no frame, digit style C

 

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample&dd=C&ft=0">

Simple, no frame, digit style D

 

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample&dd=D&ft=0">

Simple, no frame, digit style E

 

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample&dd=E&ft=0">

Simple, no frame, digit style F

 

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample&dd=F&ft=0">

 

Frame with default frame-color and thickness

 

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample">

Here's an example how to implement a hidden counter

The following example uses a hidden counter, i.e. no counter image is displayed.
The current counter value can be obtained at http://www.asamnet.de/~count/Counter/data/sample.
Please use Your own counter's name instead of "sample". Otherwise you will get the wrong counter's value.

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample&sh=F">

Countdown, Year 2000 implied from web server time

<img src="/cgi-bin/count-cgi/Count.cgi?display=countdown&ft=0&dd=cd&negate=T">

Countdown from New York to Year 2000

<img src="/cgi-bin/count-cgi/Count.cgi?display=countdown&dd=cdr&timezone=GMT-0500&sfd=T">

Countdown to a specific date

<img src="/cgi-bin/count-cgi/Count.cgi?cdt=1999;1;3;24;0;0&sfd=T&dd=cd&ft=0&prgb=000000">

Countdown from GMT-0500 to Year 2000

<img src="/cgi-bin/count-cgi/Count.cgi?display=countdown&dd=cd&timezone=GMT-0500&sfd=T&prgb=0000ff">

Countdown to past Feb 1 1998

<img src="/cgi-bin/count-cgi/Count.cgi?ft=3&df=sample&dd=D">

>

digit style E,frame-thickness=0,white transparent

<img src="/cgi-bin/count-cgi/Count.cgi?trgb=ffffff&ft=0&df=sample&dd=E">

Red frame with default thickness

<img src="/cgi-bin/count-cgi/Count.cgi?df=sample&frgb=ff0000">

Literal string with comma

<img src="/cgi-bin/count-cgi/Count.cgi?lit=94032048040320&comma=T&dd=D&ft=2">

Literal string, make black transparent

<img src="/cgi-bin/count-cgi/Count.cgi?lit=0123456789,:-ap&tr=T&dd=D&ft=2">

Frame color can be Red,Green and Blue triplets

<img src="/cgi-bin/count-cgi/Count.cgi?lit=0123456&frgb=0;0;255">

Frame color can be hex as well,using blue here

<img src="/cgi-bin/count-cgi/Count.cgi?lit=0123456&frgb=0000ff">

Change green digit-color to default pen color

<img src="/cgi-bin/count-cgi/Count.cgi?lit=1234567&chcolor=T">

Change green digit-color to red

<img src="/cgi-bin/count-cgi/Count.cgi?lit=1234567&srgb=00ff00&prgb=ff0000">

Change green digit-color to yellow

<img src="/cgi-bin/count-cgi/Count.cgi?lit=1234567&srgb=00ff00&prgb=ffff00">

Change green digit-color to FF7700

<img src="/cgi-bin/count-cgi/Count.cgi?lit=1234567&srgb=00ff00&prgb=ff7700">

Gray frame color

<img src="/cgi-bin/count-cgi/Count.cgi?lit=1234567&frgb=c0c0cc0">

NavyBlue frame color

<img src="/cgi-bin/count-cgi/Count.cgi?lit=1234567&frgb=000080">

Show time (12 hr format)

<img src="/cgi-bin/count-cgi/Count.cgi?display=clock">

Show time (24 hr format)

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

Show time of Dhaka (GMT+0600),Bangladesh

<img src="/cgi-bin/count-cgi/Count.cgi?display=clock&timezone=GMT+0600">

Show date (MM-DD-YY)

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

Show date (DD-MM-YYYY) use YYYY to show full year

<img src="/cgi-bin/count-cgi/Count.cgi?display=date&fy=T&dd=cd&dformat=ddmmyyyy">

Show date (DD-MM-YY) use fy show full year

<img src="/cgi-bin/count-cgi/Count.cgi?ft=0&df=sample&trgb=00ff00">

Make the green color transparent,no frame

<img src="/cgi-bin/count-cgi/Count.cgi?ft=0&df=sample&trgb=00ff00">

Make the black color transparent,frame-thickness=2

<img src="/cgi-bin/count-cgi/Count.cgi?ft=2&df=sample&trgb=000000">

Make the black color transparent,change green color to a shade of gray,frame-thickness=2

<img src="/cgi-bin/count-cgi/Count.cgi?srgb=00ff00&prgb=101010&ft=2&df=sample&trgb=000000">

Make the black color transparent,change green color to a shade of gray,frame-thickness=0

<img src="/cgi-bin/count-cgi/Count.cgi?srgb=00ff00&prgb=101010&ft=0&df=sample&trgb=000000">

Display Lenna's image wrapped with a nice frame

<img src="/cgi-bin/count-cgi/Count.cgi?display=image&dd=D&image=lenna.gif&frgb=8B6508&ft=20">

Composite the counter at location 3,95 of the image

<img src="/cgi-bin/count-cgi/Count.cgi?display=image&ft=0&image=peng.gif&df=sample&incr=T&xy=3;95&comma=T">

Composite the counter at the center of the image

<img src="/cgi-bin/count-cgi/Count.cgi?display=image&ft=0&image=lenna.gif&dd=D&lit=1234&incr=T&align=center">

Composite the counter left justified

<img src="/cgi-bin/count-cgi/Count.cgi?display=image&ft=0&image=lenna.gif&dd=D&lit=1234&align=left">

Composite the counter right

<img src="/cgi-bin/count-cgi/Count.cgi?display=image&image=lenna.gif&incr=F&ft=0&lit=1234&align=right&dd=D">

Rotate 270 degrees. Note, degrees are implied here

<img src="/cgi-bin/count-cgi/Count.cgi?ft=0&df=sample&rotate=T&dd=D">

Rotate 180 degrees

strange behaviour with MS Internet Explorer.

<img src="/cgi-bin/count-cgi/Count.cgi?ft=0&df=sample&dd=D&degrees=180">

Rotate 90 degrees

<img src="/cgi-bin/count-cgi/Count.cgi?ft=0&df=sample&degrees=90&dd=D&prgb=ffff00">

Muhammad A Muquit
Generated on: Wed Jan 6 20:50:31 CET 1999 by <code>testcount-sh (1.2)</code>
(Linux asrv 2.0.33 #63 Wed Apr 22 10:13:49 MEST 1998 i686 unknown)
Translated and adeppted for ASAMnet: Thomas Belmer
Last change: 16.7.1999