HTMLisEasy.com
HTML tutorials for the rest of us...
MegaCounter
What is MegaCounter?
Well, it's a counter for your homepage.
 
Why is it special?
Because it's configurable.
 
I hate to tell you Joe, that's no big thing. Lot's of counters are configurable.
True, but this one is a little more configurable. Like, you can also configure how many hits per day you get.
 
How's that?
You see, MegaCounter is a high quality FAKE. It is powered by javascript, and your visitors will probably never know the difference. Here, check it out...
 

Go ahead, reload the page and look at the counter. Write down the counter number, try it again in an hour and see what it says. I can assure you that in an hour it will be about 84 hits further along. Come back about this time tommorrow and it will be about 2000 hits further. Why? Because the hit counter for this page is "configured" to get 2000 hits per day.
 
How does it work?
Like I said, it uses javascript for the math and to display the counter. It uses browser cookies to remember the last counter value and time of last visit. Combine the two and you got one dandy fake counter.
 
Will it actually record hits to my pages?
No. You can't make a real hit counter using javascript. But you can impress the heck out of your friends because as far as they can tell, you're getting tons of hits.
 
Can I get one for my page?
You bet. You just need to insert two chunks of code into your page. Place this within your HEAD section...


<!-- Start MegaCounter HEAD tag code -->
<SCRIPT language="JavaScript"><!--
/***********************************************************\
  MegaCounter v1.1
  A "configurable" hit counter for the rest of us...
  by Joe Barta  http://www.htmliseasy.com/megacounter/
\***********************************************************/
text_string = "visitors since 9/5/98";
txt_color = "#000000"  // Text string color
counter = 587113;      // Counter starts at this,
revision = 1;          // Every time you alter your initial counter value (above), you must also change the revision number.
page_code = 1;         // Unless you want every page to use the same counter, you'll need to use a different page code for each page.
hitsperday = 2000;     // How many hits per day you want.
bg_color = "#222222"   // Background color of counter
fg_color = "#66FF66"   // Foreground color of counter
link_color = "#0000FF" // Color of link back (Powered by MegaCounter)
back_color = "#FFFFFF" // Color of white space in counter area
//--></SCRIPT>
<SCRIPT language="JavaScript" SRC="http://www.htmliseasy.com/megacounter/generic_cookie_1yr.js"></SCRIPT>
<SCRIPT language="JavaScript" SRC="http://www.htmliseasy.com/megacounter/megacounter.js"></SCRIPT>
<!-- End MegaCounter HEAD tag code -->

 
And place the following where you want the counter...


<!-- Start MegaCounter BODY tag code -->
<SCRIPT language="JavaScript"><!--
document.write("<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\" BGCOLOR=\"" + back_color + "\"><TR>");
document.write("<TD BGCOLOR=\"" + bg_color + "\"><FONT FACE=\"andale mono,arial\"");
document.write("COLOR=\"" + fg_color + "\"><B>&nbsp;" + counter + "</B></FONT></TD>");
document.write("<TD><FONT SIZE=\"2\" COLOR=\"" + txt_color + "\" FACE=\"arial,helvetica\">&nbsp;" + text_string + "</FONT></TD>");
document.write("</TR><TR><TD COLSPAN=2><A HREF=\"http://www.htmliseasy.com/megacounter/\"><FONT ");
document.write("SIZE=\"1\" COLOR=\"" + link_color + "\" FACE=\"arial,helvetica\">Powered by MegaCounter</FONT></A></TD></TR></TABLE>");
//--></SCRIPT>
<!-- Start MegaCounter BODY tag code -->

 
Or - if you'd like one without the credit...
 

 
Place this code where you want the counter...


<!-- Start MegaCounter BODY tag code -->
<SCRIPT language="JavaScript"><!--
document.write("<TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\" BGCOLOR=\"" + back_color + "\"><TR>");
document.write("<TD BGCOLOR=\"" + bg_color + "\"><FONT FACE=\"andale mono,arial\"");
document.write("COLOR=\"" + fg_color + "\"><B>&nbsp;" + counter + "</B></FONT></TD>");
document.write("<TD><FONT SIZE=\"2\" COLOR=\"" + txt_color + "\" FACE=\"arial,helvetica\">&nbsp;" + text_string + "</FONT></TD>");
document.write("</TR></TABLE>");
//--></SCRIPT>
<!-- Start MegaCounter BODY tag code -->


So how do I configure it?
First of all, you can use it straight out of the box. You don't have to do anything to it. However, if you wish, there are a few knobs you can fiddle with. Just look at the blue items in the above code. Everything is fairly self-explanatory.
 
Can I use it on multiple pages?
Sure. Just use a different page code for each page you use it on. You can then configure each page differently.
 
How long will it "keep count"?
The cookie is set for 1 year. If a visitor comes back anytime within that year, he'll get the planned increase, plus he'll get his cookie set for another year. Theoretically it could go on forever.
 
What if someone has javascript disabled?
They won't see anything. The counter is itself written to the page using javascript. No javascript, no counter.
 
What if someone has cookies disabled?
Then the counter will show, but it won't "keep count".
 
What if someone has their browser disabled?
Oh yeah, you're a funny guy :-)