TDL Graphical Counter Tutorial


Our new graphical counter is very versatile. It can use five different digit styles, wrap a frame around the counter, show the time or date instead, and do much more. This document demonstrates how to use these features.

The counter above shows the simplest form of the counter command:

<IMG SRC = "/cgi-bin/Count.cgi?df=crc1.dat|st=1234">

Note that we preset the counter to a value of 1234 using the "st" parameter. To preset your counter, just place the number you wish to preset it to after the "st=". Note that the counter must not already exist if you wish to preset it.


Frame color and Thickness

This is what happens when you call the counter with no parameters.

<img src="/cgi-bin/Count.cgi">

Not all browsers will handle this situation correctly. What you should see here is it complaining about an empty query string, with a green frame. These are the default settings. The text should be green on black.
<img src="/cgi-bin/Count.cgi?ft=0">

Because the datafile parameter (df) is not present, a randomly generated counter number is used. The "ft=0" parameter tells Count to not put a frame around it.


<img 
src="/cgi-bin/Count.cgi?ft=6">

This is the way to create a random counter with default frame color and thickness. "ft" sets the Frame Thickness, and the default happens to be six.


 
<IMG   SRC="/cgi-bin/Count.cgi?ft=10&df=crc1.dat">

This counter is NOT random, as it uses crc1.dat for the data file. The "df" parameter specifies this data file. To create your own counter, simply use the "df=xxxxxxn.dat" parameter. The xxxxxx must be your username, the n must be a number, and you must have the .dat. If your username is eager, your first counter would be eager1.dat, your second counter would be eager2.dat, etc. This sample counter has a frame thickness of ten (ft=10).


<IMG 
  SRC="/cgi-bin/Count.cgi?frgb=ffd700&df=crc1.dat">

You change the frame color with the "frgb=xxxxxx" parameter, where xxxxxx is a six character hex value, just like you use in html coding. There is one important difference here, though. You must NOT put a # in front of it. This will truncate the parameter line at that point! This is not our fault, it is the fault of the people who wrote the HTML spec. This is a gold frame. Other hex values yield different colors.

Instead of hex values, you can use RGB triplets, like this;

    <IMG   SRC="/cgi-bin/Count.cgi?frgb=255;215;0&df=crc1.dat">
which gives the same result.


Your count can have commas!

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

To use commas, simply add the parameter "comma=T". T is for True, meaning that it's True you want to use commas. Note that your counter will not be padded with zeroes if you use commas.


Rotating your counter.

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

By default, the counter will rotate 270 degrees clockwise. It can only be rotated in increments of 90 degrees. The "rotate" parameter tells it to rotate. The "degrees" parameter tells it how much to rotate. Also note that these have no frame.


You get five digit styles!

 <img src="/cgi-bin/Count.cgi?dd=A|df=crc1.dat">
<img src="/cgi-bin/Count.cgi?dd=B|df=crc1.dat">
<img src="/cgi-bin/Count.cgi?dd=C|df=crc1.dat">
<img src="/cgi-bin/Count.cgi?dd=D|ft=3|df=crc1.dat">
<IMG   SRC="/cgi-bin/Count.cgi?ft=2&frgb=000000&dd=E|df=crc1.dat">

These are your five style choices. You use the "dd=X" parameter to specify digit styles. X may be any of the first five capital letters. Style A is the default.


The Wonderful World of Color Modification

If you know the hex values of the colors in the digit styles, you can change them. This is how to change the green color in the first digit style to red.

<img src="/cgi-bin/Count.cgi?df=crc1.dat|srgb=00ff00|prgb=ff0000">

"srgb" is the Source RGB value, which is pure green, in this case. "prgb" is the Pen RGB, or the new color, which in this case is pure red. To find out the rgb values of the colors in the image, save it with your browser and open it in your favorite bitmap graphics program.


Make a negative!

<IMG   SRC="/cgi-bin/Count.cgi?negate=T&dd=A|df=crc1.dat">

You can invert the colors in the image with the parameter "negate=T". Note that the frame is unaffected by this command.


Transparency

If you know the hex code of a color in a digit style, you can make it transparent. This sample makes the white color in style E transparent.

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

You use the parameter "tr=T" to tell it that you want a transparent color, and "trgb=xxxxxx" to tell it what color to transparentify. In this case, the color white (ffffff) is used.

Make the black color of the digit style A transparent:

<img src="/cgi-bin/Count.cgi?dd=A|tr=T|trgb=000000">

Make the green color of the digit style A transparent:

    <IMG   SRC="/cgi-bin/Count.cgi?dd=A|tr=T|trgb=00ff00">


The Magic Invisible Counter

    <img alt="" src="/cgi-bin/Count.cgi?sh=0|df=crc1.dat">

A hidden counter is up there. You use the "sh=0" parameter to make your counter invisible. The ALT="" in the <IMG> tag makes it invisible to text browsers too.


Monitoring your Counter

    <img src="/cgi-bin/Count.cgi?incr=F|df=crc2.dat">
    <img src="/cgi-bin/Count.cgi?incr=F|df=crc3.dat">
    <img src="/cgi-bin/Count.cgi?incr=F|df=crc4.dat">

By using the "incr=F" parameter, you can display the counter without incrementing it. This is useful for monitoring your hidden counters from the web. You just put calls to the counters with the "incr=f" parameter on a secret, unlinked html page. Then, no matter what ISP you are using, you can monitor your counter at TDL without incrementing it.


Number of digits

You may not want six digits in your counter. You can set the number of digits with the "md=x" parameter, where x is any number. This example is a five digit counter.

    <img src="/cgi-bin/Count.cgi?md=5|df=crc1.dat"> 

You may also want to turn off the padding without showing commas. To do that, you use the "pad=0" parameter. Here is a random, unpadded counter.

    <img src="/cgi-bin/Count.cgi?pad=0"> 

More fake counters

You can display a string literally. The valid characters in a string are 0123456789,:-ap

<img src="/cgi-bin/Count.cgi?lit=0123456789">
<img src="/cgi-bin/Count.cgi?dd=B&lit=0123456789">
<img src="/cgi-bin/Count.cgi?dd=C|lit=0123456789">
<img src="/cgi-bin/Count.cgi?dd=D&lit=0123456789">
<IMG   SRC="/cgi-bin/Count.cgi?ft=0&tr=1&trgb=ffffff|dd=E|lit=0123456789">
<img src="/cgi-bin/Count.cgi?lit=a1,456-:p">


Counter can be a Clock!

You can display time in 12 hr format,

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

or 24 hour format.

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

Use "display=clock" to make it a clock, and "tformat=24" to make it a 24 hour clock.


Display date

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

Use "display=date" to show the date. With either time or date, the frame, color, and rotation parameters still apply. Use timezone parameter to display time or date of any place in the world.


We hope you enjoy our new counter capability.

Back to Tips Page Mail Us
© 1996 The Diamond Lane. All rights reserved