LavaNet Home

ANNOUNCEMENTS   SEARCH LAVANET
07/02/09 LavaNet News and Announcements - Holiday hours for July 3 - 4, 2009.

LavaNet offices will be closed on July 3 - 4, 2009 with limited technical support from 9am - 5pm on Friday, July 3. All departments will be open on Monday, July 6 for normal business hours.

 
NAVIGATION

CONTACT
Phone
(808) 545-LAVA

Fax
(808) 529-0596

Address
733 Bishop Street
Makai Tower, Suite #1170
Honolulu, HI 96813

Maps

 

CGI counters example

Jump to: navigation, search

Contents

Frame Color and Thickness

A frame with a bluish color is wrapped by default. You have to use ft=0 to ignore this feature.

Image:Cgi1.JPG<img src="/cgi-bin/Count.cgi"> 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.

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

Image:Cgi3.JPG<img src="/cgi-bin/Count.cgi?ft=6"> Random digits. Wrapped frame is with default color and thickness.

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

Image:Cgi5.JPG<img src="/cgi-bin/Count.cgi?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:

Image:Cgi6.JPG<img src="/cgi-bin/Count.cgi?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.

Image:Cgi7.JPG<img src="/cgi-bin/Count.cgi?frgb=gold|df=x.dat">

Comma can be Displayed

Image:Dcomma.JPG<img src="/cgi-bin/Count.cgi?ft=0|df=x.dat|comma=T">


Rotation

Image:Cgi8.JPG Image:Cgi9.JPG Image:C10.JPG

<img src="/cgi-bin/Count.cgi?ft=0|rotate=Y|df=x.dat">

<img src="/cgi-bin/Count.cgi?ft=0&degrees=180|df=x.dat">

<img src="/cgi-bin/Count.cgi?ft=0&degrees=90"df=x.dat> The first counter is rotated default 270 degrees toward right, no angle is specified as rotate keyword is used.


Digit Styles

Image:C11.JPG Image:C12.JPG Image:C13.JPG Image:C14.JPG Image:C15.JPG Image:C16.JPG

<img src="/cgi-bin/Count.cgi?dd=A|df=x.dat">

<img src="/cgi-bin/Count.cgi?dd=B|df=x.dat">

<img src="/cgi-bin/Count.cgi?dd=B|frgb=69;139;116&df=x.dat">

<img src="/cgi-bin/Count.cgi?dd=C|df=x.dat">

<img src="/cgi-bin/Count.cgi?dd=D|ft=3|df=x.dat">

<img src="/cgi-bin/Count.cgi?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 the digits directory, rename the digits to zero.gif, one.gif....nine.gif and use the directory name with dd.


Change any color

Change green color to red:

Image:Gr2rd.JPG

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


Negate the colors

Image:C17.JPG

<img src="/cgi-bin/Count.cgi?negate=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.

Image:Ct1.JPG<img src="/cgi-bin/Count.cgi?dd=E|ft=0|tr=T|trgb=ffffff"> You can use the RGB triplets for the color like:

Image:Ct2.JPG<img src="/cgi-bin/Count.cgi?dd=E|ft=0|tr=T|trgb=255;255;255"> Make the black color of the digit style A transparent:

Image:Ct3.JPG<img src="/cgi-bin/Count.cgi?dd=A|tr=T|trgb=000000&df=x.dat"> , or <img src="/cgi-bin/Count.cgi?dd=A|tr=T|trgb=0;0;0&df=x.dat"> , or <img src="/cgi-bin/Count.cgi?dd=A|tr=T|trgb=black&df=x.dat"> Make the green color of the digit style A transparent:

Image:Ct4.JPG <img src="/cgi-bin/Count.cgi?dd=A|tr=T|trgb=00ff00&df=x.dat"> , or <img src="/cgi-bin/Count.cgi?dd=A|tr=T|trgb=0;255;0&df=x.dat"> , or <img src="/cgi-bin/Count.cgi?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.cgi?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

Image:C18.JPG Image:C19.JPG Image:C20.JPG

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

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

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


Number of digits

Say you want to display the counter in 5 digits only.

Image:C21.JPG<img src="/cgi-bin/Count.cgi?md=5|df=x.dat"> or you do not want to left pad with zero, you want to display exact digits.

Image:C22.JPG<img src="/cgi-bin/Count.cgi?pad=0|df=x.dat">


Literal

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

Image:C23.JPG Image:C24.JPG Image:C25.JPG Image:C26.JPG Image:C27.JPG Image:Litall.JPG

<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 as clock

Display time in 12 hr format.

Image:Clock12.JPG<img src="/cgi-bin/Count.cgi?display=clock"> Dispaly time in 24 hour format.

Image:Clock24.JPG<img src="/cgi-bin/Count.cgi?display=clock|tformat=24"> Display date

Image:Date.JPG<img src="/cgi-bin/Count.cgi?display=date"> Use timezone parameter to display time or date of any place in the world.


Copyright © 2006 LavaNet, Inc. All rights reserved.   News | Support | Services | About Us | System Status | Webmail | Press Box | Privacy & Copyright