Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Changing the 'Currently online' list to update every 1 min?
Avatar
David Norman
Member
sp_UserOfflineSmall Offline
Oct 27, 2014 - 10:54 pm

Hi guys

As you may remember I'm not a tech and learn as I go with coding.

I have had paid members ask why the Currently Online stat lists people that aren't actually online (even if they refresh their page). This was after I had already changed the (sp_stats_interval) con job down to 0.1 (6 mins).

I explained it only refreshes when the system runs a special background job (my tech talk :) )

I have now changed it to 0.02 (72 secs) in Cron Inspector, though I suspect it will now be updating all stats in that footer stat box that often.

Is that going to be a huge load on the server doing this every 72 secs, given is already running a lot of WP, SP plugins and Quick Chat plugin?

Is there a way to have the Currently Online stats update every 30 - 60 secs, though not update all the other stats that often?

 

As a side question: If I want to hide/remove one of the stats from that Footer box (like the Most Ever Online), what code do I have to put in front of the relevent one in the spFoot.php ?

Thanks for your help,
David

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 27, 2014 - 11:36 pm

how did you change the stats interval?  if you removed and then readded the stats cron with new interval, keep in mind it may only be temporary if simple press has to reload the cron... you would want to change the actual value for the stats cron on forum - options - display settings...

and yes, it will update all the stats...  is it a huge load?  not really, just another half dozen or so queries per page load when run... 

but afraid to tell you that the current users online is not part of the stats cron...  the stats update by themselves, not as part of any cron...  so you really shouldnt be seeing any difference...  if a user logs out, they will be moved from the currently online immediately... but if they just leave the site, they wont be removed until their current login times out, which I believe is 20 minutes...  you can adjust the track user timeout on forum - components - login and registration...

Avatar
David Norman
Member
sp_UserOfflineSmall Offline
Oct 28, 2014 - 12:09 am

Thanks for the quick reply. I have had a look at those settings.

I had changed the cron timing in options > general display > Display Forum Stats to 0.02. It shows up in the cron Inspector as (72 sec). If it's not going to affect the updating of Current Online list, then i will change it back to something longer.

if a user logs out, they will be moved from the currently online immediately… but if they just leave the site, they wont be removed until their current login times out

So  would they have to click the 'Log out' button on the forum to offically stop showing up immediately on leaving? I also have a Logout link (see attachment) which shows the same request address when I hover over each. So suspect this would do the same thing. However, if they just close the browser tab or browser, then SP will show them as online until the 'default' time elapses (currently 20 mins)?

you can adjust the track user timeout on forum – components – login and registration

What consitutes inactivity? If they are still logged to the forum area, though watching one of the videos in the membership area (accessible from that page) for over the set Tracking Timeout period, will the system show them as offline, even though they are logged in?
If yes, what type of activity will trigger to show them as back online again?

Thanks,
David

 

SP-Logout.pngImage Enlarger

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 28, 2014 - 12:12 am

yes, any wp logout will trigger removal from being online...

simply going to another site or closing the browser will not log out a user so they will show online until they timeout...  they timeout after no activity for the time...  loading any page or simple press popup will restart the timeout countdown...  caution, dont set the timeout too short... if they are reading a long topic and it takes longer to read than the timeout, they "may" have to log back in...

Avatar
David Norman
Member
sp_UserOfflineSmall Offline
Oct 28, 2014 - 12:24 am

Thanks. That clears it up at lot for me.

I guess a short Timeout setting would also be a problem if they are adding or replying to a post (or PM reply) and even though they are typing in the respective field, it takes them longer than the timeout setting before they either, upload an attachment, preview the post/PM or actually send it? I suspect typing in a field won't register as 'activity'?

Cheers
David

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 28, 2014 - 12:30 am

Correct, typing in a input field or textarea will not reset the timeout.... They may not get logged out (or may - wp is finicky) but just show up as not online until they do another page load...

Avatar
David Norman
Member
sp_UserOfflineSmall Offline
Oct 28, 2014 - 12:32 am

Understood. Thanks for your prompt advice yet again. :)

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 28, 2014 - 5:18 am

The one thing Steve did not mention here is that the 'online' list only tracks people visiting the forum. It does not track people visiting the overall website. So if they hit the forum - they  get tracked and added to the list. This is immediate. As Steve said, if they log out of the site they get removed from the list - also immediate. But if they leave the site OR leave the forum pages to view other areas of the site, the timeout starts to tick down.

If you want to track who is visiting the site generally then there are WordPress plugins that can do this.

andy-signature.png
YELLOW
SWORDFISH
Avatar
David Norman
Member
sp_UserOfflineSmall Offline
Oct 28, 2014 - 6:09 am

Yes, thank you for confirming that. I am only interested in listing people on forum pages. The others that are watching member videos will still show up in my Quick Chat 'online' list (which is embedded at the bottom of each Forum page), for at least an hour.

Cheers,
David

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 28, 2014 - 8:07 pm

good deal...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 643
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17343
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10117
Posts: 79590