Crystal Wind Communications, Inc.

How to Put a Hit-Counter on Your Website


  Many of you have been asking for a counter for your pages, and I have been going through several different counter programs and scripts until I found one that I liked. Well, suffice to say, I found one, and it is now available for use by our subscribers and clients.
  It has been compiled and configured in such a way that the calling page must reside on our system, in an effort to thwart "counter- terrorism" -grin-. While the coding looks pretty formidable, I think that you will find this counter program to be very useful and configurable.
  Please read the following instructions VERY CAREFULLY before attempting to use the counter, and then bugging me about why it won't work. -smile- You will notice in the documentation that the data file for the counter must be created before you can use it. This is also to combat "counter-terrorism" and also to prevent you from using a counter data file that someone else is already using. So, when you have completed setting up your counter, send me email (webmaster@xtalwind.net) and I will be happy to create this file for you. I will use the name you request unless it is already in use, in which case I will email you the filename for your DAT file.
NOTE: At the end of the documentation is a link to demonstrations of the usage of these settings, and examples of each of the available styles of digits.
  ENJOY!


BEGIN QUOTED TEXT FROM DOCUMENTATION

   How to call the program? Let me tell you first, do not get frustrated because it has lots of options. I'll explain each option step by step. If you keep reading, you'll see it's really simple.

You can refer to the program like this: <img src="/cgi-bin/count.cgi?ft=9|frgb=69;139;50|tr=0| trgb=0;0;0|wxh=15;20|md=6|dd=A|st=5|sh=1|df=count.dat" align=absmiddle> NOTE : This is all one line, but wrapped here for display purposes...As usual, if you see something capitalized, it's that way for a purpose!!!!

   The string between ? and " is called the QUERY_STRING. Make sure there are no new lines in the <img src= line and no space in the QUERY_STRING. Here are explanations and examples of each term in the program:

ft=9: ft means frame thickness. If you want to wrap the counter with an ornamental frame, you define the frame thickness like this: Here 9 is the thickness of the frame in pixels. This value can be any positive number greater than 1. For a nice 3D effect, use a number greater than 5. If you do not want a frame, just use ft=0.

frgb=69;139;50 frgb defines the color of the frame. Here 69 is the red component, 139 is the green component and 50 is the blue component of the color. The valid range of each component is >=0 and <= 255. The components must be separated by ; character. Note even if you define ft="0," these components must be present, so just use 0;0;0 in that case.

tr="0"; tr defines if you want transparency in the counter image. Here tr="0," that is, I do not want a transparent image. If you want a transparent image, define tr="1." Note that Coun.cgi does not care if your digits are transparent GIFs or not. You must tell explicitly which color you want to make transparent. trgb="0;0;0" if tr="1," then black color of the image will be transparent. Here 0;0;0 are the red, green and blue components of the color you want to make transparent.

wxh="15;20": The wxh string defines the width and height of an individual digit image. Each digit must have the same width and height. If you like to use digits not supplied with my distribution, find out the width and height of the digits and specify them here.

md="6": md defines the maximum number of digits to display. It can be>= 5 and <= 10. If your counter number is less than md, the left digits will be padded with zeros. Here md="6" means display the counter with maximum 6 digits. If you do not want to left pad with zeros, use pad="0" instead of md="6." Note you can either use md="some_number" or pad="0," in this field, but youcan not use both. If you use pad="0," then the digits will be displayed exactly without padding.

dd="A" : dd means digit directory. A indicates that it will use my LED digits located at the directory A. The base of the directory A is defined with DigitDir at step 1. NOTE : See the examples following this documentation for the exact "A" to use here on CWCi.

st="5": st means start, that is start the counter with this value. st is only significant if you compiled the program with DALLOW_FILE_CREATION. If you compiled with this option, the datafile will be created to the directory defined byDataDir in the config.h file and 5 will be written to it. This option is new in this release. NOTE : I did not compile with this, so when we create your data file, we'll look up and see how many hits you've had so far and enter that value in the data file. Though this item will be ignored, it must still be there.

sh="1": sh means show. If sh="0," then no digit images will be displayed, however a transparent 1x1 transparent GIF image will be returned, which will give the illusion of nothing being displayed. Althouh it will seem that nothing is displayed, the counter will still be incremented. This option is new in this release.

df="count.dat": df means data file. This is the file which will contain the counter number. The base directory of this file is defined with DataDir in config.h file. NOTE : This file must exist before the counter will work, so you MUST contact me to get the file created for you!!

Error Messages: Count will try to return an image in any event. That is, even if it fails for some reason, it will write the error messages in GIF format. The text error messages also will be written to the counter log file defined with LogFile in the directory defined with LogDir in the config.h file. If you see any of these images, please check the Counter log file you defined with LogDir and LogFile. If the program could not create the log file, it will write the error messages to stderr. In that case, if you configured your httpd server to write the log to a file, the error messages will be written to this file.


Examples of the useage of these settings and of digit styles

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, and the author's name is not used in advertising or publicity pertaining to distribution of the software without specific written prior permission. If the program is included in a book, publication or software distribution media for sale, the author must be notified about it. The software CAN NOT be distributed without source code. 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. . Note: This program is developed in my own time. My employer SEMCOR, Inc. has nothing to do with it. If you are using this program, I like to hear from you. Please add your web page URL to the database via this form. You can drop me a line if you like. If you are having any problem with the program, please let me know as well. Feel free to send any suggestion. If you think that the program is cool, please consider sending me a picture postcard of the area where you live. Thanks to all of you who sent me the nice postcards. I get enormous number of thank mails everyday, it's amazing. I really appreciate it. Muhammad A Muquit SEMCOR, Inc. 65 West Street Road Warminster, PA 18974 USA End of quoted Text


The Crystal Wind is the Storm, and the Storm is Data, and the Data is Life.
                            --The Players Litany from 'The Long Run' by Daniel Keys Moran


| Home | CWCi Policies | Quarantined Email | Rates | Help & Docs | Subscriber Services | Domains |
| Search | Subscribers' Websites | Businesses & Resources | News & Weather | Virus Info | Shop@ |

Copyright © 2002 by Crystal Wind Communications and ScyGraphics