21293 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 969 Views |
-
currently online visitors counter?

8 February 2010 at 7:48am
Have searched up and down, but there seems to be no built in way to show the count of "currently online unique visitors". (NOT a hitcounter!)
Before I reinvent the wheel, is there a silverstripe solution available already?
Not that I like such counters, but it is a customer requirement ...
-
Re: currently online visitors counter?

8 February 2010 at 9:06am
The forum has such a feature (as you can see in the footer. How this works is not 'online' as such but people who have logged in in the last 15min. If you're logged in it updates the LastVisited time on every page visit so you can do something like.
function CurrentlyOnline() {
return DataObject::get('Member','LastVisited > NOW() - INTERVAL 15 MINUTE');
} -
Re: currently online visitors counter?

8 February 2010 at 9:20am
Thanks, Will, yes for logged in visitors this is an easy solution.
I assume I have to create a table to keep track of the IPs of all visitors (not forum, not logged in), that'll give me something similar, and to avoid that table getting too big to delete old entries from time to time.
-
Re: currently online visitors counter?

8 February 2010 at 9:55am
Yes you would have to keep a separate system for managing IP visitors. Deleting old entries from that table after like 3 days would be smart as well.
| 969 Views | ||
|
Page:
1
|
Go to Top |


