Help - Search - Members - Calendar
Full Version: Hit Counter Location
Movable Type Community Forum > Additional Resources > Tips and Tricks
joe monkeyweb
Hi all,

Big noob here. My host provides a nice little counter and I'd like to insert the code on my MT. It worked fine on Blogger, but I just don't know where to insert it in all the various templates on MT. Any help is appreciated. Thanks.

Oh, here's the code (paren for brackets as necessary):

(?php
$client_IP_address = getenv("REMOTE_ADDR");
$counter_data_URL = "http://counter.rochenhost.com/textcounter.php?user=monkeyweb&name=First%20Counter&ip_address=$client_IP_address";
$counter_page_data = fopen($counter_data_URL, "r") or die("Counter Error!");
print fgets($counter_page_data, 1024);
?)

(img src="http://counter.rochenhost.com/counter.php?user=monkeyweb&name=First Counter")
joe monkeyweb
Anyone?
iki
You'll want to put it in your main index template. Where depends on where you want it to show up. Usually on the default templates (you never said which version, so this might be off) the template goes "blog on the left, sidebar on the right" and it's listed in that order on the template - blog stuff then sidebar stuff toward the bottom.

Just stick it in the template and then play with it until you get it where you'd like it. MT uses CSS extensively, so if you don't know how that works, you'll want to do a google search or get some books on it. That's what I did, and it really helped.

Good luck!
joe monkeyweb
Thanks very much! biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.