MyBB Community Forums

Full Version: Visitor counts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hello.

I know there's plugins that deal with the ability to count and show who's been online today, but these only depict registered users. Is there a way to show a TOTAL visitor count - maybe by differentiating between IP addresses and counting that way? I know the old version of the forum (1.2.14 for example) had this facility, but 1.4 and it's various plugins doesn't yet. Any ideas?
There was one that showed members, guests and bots, but this hasn't been updated for 1.4 yet.
I suppose it could be done without plugins if you want it to be a permanent feature on your board.

I have no idea what your level of PHP and mySQL understanding is (so I do apologise!) but why not add a quick function to do this?

Simply create a function that checks if the user has visited before... maybe something like:

$query = $db->simple_select(TABLE_PREFIX."sessions", "*", "ip=".$_SERVER['REMOTE_ADDR']."");

$vistedbefore=$db->fetch_field($query, "ip");

if(!$vistedbefore){
     // update a table in the database
}

It must be before $session is called in global.php and then just do a simple_select to call the information back you added into the database. That means that only unique IP addresses are added to the total count, although that means it doesn't detect a user logging in from different locations.

There could be one slight problem - myBB cleans out sessions daily, which means a single IP address will stay in the system for 24 hours (I think), which in turn might lead to duplicated data... I haven't checked the task out to see how it works exactly...

No idea whether it will work (haven't tested it), but sounds plausible... and probably not the most efficient code in the world - if you need more help in implementing this then feel free to ask Smile

Or you could just ask the 1.2 mod author to update the code, or maybe give it a go yourself?...

Shy
Why not rely on server logs? Stats packages like Webalizer can help summarize things.
TAHNX , BUT PLZ CAN U TELL ME, THIS TEMPLEITS WHERE CAN I ADD IN MY ADMIN CP ?
PLZ I NEED UR HELP, IN WHICH SECTOR ?
hmm - thank you, but the web stats packages I've played with I find a nightmare to impliment. (Like Webalizer and Adstats). I just think a plugin that does this sort of stats would be a really useful thing
(2008-09-02, 07:18 PM)PeteSa Wrote: [ -> ]hmm - thank you, but the web stats packages I've played with I find a nightmare to impliment. (Like Webalizer and Adstats). I just think a plugin that does this sort of stats would be a really useful thing

Labrocca should be updating it soon, keep an eye on mybbcentral.com and see if it is released.
(2008-09-01, 06:41 PM)PeteSa Wrote: [ -> ]Hello.

I know there's plugins that deal with the ability to count and show who's been online today, but these only depict registered users. Is there a way to show a TOTAL visitor count - maybe by differentiating between IP addresses and counting that way? I know the old version of the forum (1.2.14 for example) had this facility, but 1.4 and it's various plugins doesn't yet. Any ideas?

+1

This one would be great.

How about a counter to the portal, too?

Options to discriminate Bots, Spiders, and Admins, would be even better Wink
Bots and spiders are the same thing, and as I said, they're shown seperatly in Labrocca's plugin.
Yo,

Been keeping an eye out for new plugins from Labrocca but as of yet, haven't seen one dealing with this. What sort of timescale are we talking of on this?

Thank you.
Pages: 1 2 3