News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Hit Counter

Started by James Woodcock, December 27, 2004, 07:23:46 AM

Previous topic - Next topic

James Woodcock

Seeing as SMF already has a hit counter if enabled.  Could you please post a bit of code that I could place on the main site that when triggered adds a +1 to that score so it tracks site hits as well as forum?

[Unknown]

With SSI.php...

<?php trackStats(array('hits' => '+')); ?>

But, you have to use obExit(); then, or it won't save.  You can also do this:

<?php trackStats(array('hits' => '+')); trackStats(); ?>

Which will save it there.

-[Unknown]

James Woodcock

wicked ill try that in a mo

James Woodcock

<?php trackStats(array('hits' => '+')); trackStats(); ?>

Works like a charm, you should have that in SSI visible in the demo so people can add it :)

Midgard

how to "for index.template.php" ?

James Woodcock

the forum already counts hits, I wanted it extended for the site.  To view the hits, look in more stats at the bottom of your board index.  Also make sure you have 'track hits' enabled in your forum options.

Jerry

#6
I think maybe Midgard wants to show the number on the bottom of the forums?


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

James Woodcock

ahh right, would be good I suppose to show how many hits today and in total in SSI somewhere anyway

Midgard

Quote from: Jerry on December 27, 2004, 09:25:24 AM
I think maybe Migrad wants to show the number on the bottom of the forums?

Yes, i have this... You understand me Jerry :) Thanks :)

Advertisement: