Log in

View Full Version : How to refresh activitystream each X second ?


Altari
05-29-2012, 05:15 PM
Hello,

I would like to automatically refresh the activity stream every, maybe 5 seconds. Is there a way to do this ? (Vb's default setting is only for minutes).

I had a look in clientscript/vbulletin_activitystream.js and change some things, but that's not enough and do nothing.

Thank you.

Badshah93
05-29-2012, 07:21 PM
you will need to edit these line in activitystream.js file

Change this line
if(this.options.refresh*60000>300000){this.idlerefresh=this.options.refresh*6000 0}else{this.idlerefresh=300000}


To
if(this.options.refresh*1000>60000){this.idlerefresh=this.options.refresh*1000} else{this.idlerefresh=60000}


now if you enter 5 in vB default setting, it will be treated as 5 seconds.

setishock
05-30-2012, 01:16 AM
Does your forum really get that busy that you need to refresh every 5 seconds as opposed to every 5 minutes? The more things you give to VB to do more often will chew up CPU cycles as well as pounding on your database. Your host may not appreciate that.

RSNF
05-30-2012, 01:17 PM
Taking a huge gamble by doing every 5 seconds.............Just saying

Altari
05-30-2012, 02:13 PM
This depend of users viewing the activity stream isn't it ? I have something like 400-600 users on my board at the same time, but nomore than 10/20 users watching the activity stream, so the the server load should be negligible ? (Dedicated server)

--------------- Added 1338391354 at 1338391354 ---------------

you will need to edit these line in activitystream.js file

Change this line
if(this.options.refresh*60000>300000){this.idlerefresh=this.options.refresh*6000 0}else{this.idlerefresh=300000}


To
if(this.options.refresh*1000>60000){this.idlerefresh=this.options.refresh*1000} else{this.idlerefresh=60000}


now if you enter 5 in vB default setting, it will be treated as 5 seconds.
Thank you for your help, but that's not enough and this doesn't work.

Badshah93
05-30-2012, 03:35 PM
try this one (last code was refrshing in every 60 seconds or more)

Replace
if(this.options.refresh*60000>300000){this.idlerefresh=this.options.refresh*6000 0}else{this.idlerefresh=300000}


With

if(this.options.refresh){this.idlerefresh=this.opt ions.refresh*1000}else{this.idlerefresh=60000}

Altari
05-31-2012, 08:30 AM
This work well, thank you, i have set 10 sec.

Thank you.