DECIMAL COUNTER

Home
Submit
Search
Contact

DECIMAL COUNTER


This page was visited     times since yesterday !!!

What a popular page ! Just kidding, it is a fake counter. Not really. It works, you can see it by reloading this page. I just started it from 22.5 million :) To demonstrate its unique feature - familiar look of big numbers (did you notice those commas?). Actually, you do not need it if you have less than 1000 visitors on you page.



What is it? A text counter for your web pages, of course!

Why text? Because it is 100 or even 1000 times faster than fancy graphical ones!

What is unique? Decimal points, which make the counter more readable while displaying big numbers.



Info: The counter was written in plain vanilla C, which makes it even faster than regular CGI scripts. It was compiled and tested under BSD UNIX, so I am not quite sure about UNIX System V or Windows NT (might be problems with flock function, which is necessary to lock the counter file while writing data). The counter requires SSI (Server Side Includes) and telnet access to your server to compile the source.

How to install:
  • First, telnet to your account, copy source code to your cgi-bin directory and compile it: cc count.c -o count.cgi
  • Second, go to the directory where the page which will display the counter is located and create a file which will keep a number of visitors. The easiest way to do that is to perform a command: echo 345 > mypage.count , where "345" is a starting point of your counter (like mine 22.5 million) and "mypage.count" is the name of a file. You must change a file permission to allow to write new values in it: chmod 666 mypage.count . If you want to repeat the second step for all the pages you want to display the counter, just be sure to go to appropriate directory.
  • Third, and the last and the most delicate one. Put this code <!--#exec cmd="../../cgi-bin/count.cgi mypage.count" --> where you want your counter to be displayed. Do not rush! You must show a proper location (path) of your count.cgi program relatively to the location of a page which will display the counter. The rule is: the path name must define the location of the file (count.cgi) relative to the current directory. Another rule: every SSI command must always end with --> , and there must be a space between it and the ending quotation character: " -->

If you did everything slowly and nicely, try your page, reload it and see what happens.

Some Tricks: As the counter requires SSI, it means that you can change its font and color attributes as you do with text usually. Look, by implementing this code: <FONT SIZE="+2" FACE="Comic Sans MS" COLOR="#FF3300"><B><!--#exec cmd="../../cgi-bin/count.cgi counter.count" --></B></FONT> you will get a new look of you counter:

Got an idea? Good luck !

The Decimal Counter is free without any limitations. Copyright
© Eugene Vassiltsov

 DECIMAL COUNTER

Home
Submit
Search
Contact