vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to refresh activitystream each X second ? (https://vborg.vbsupport.ru/showthread.php?t=283649)

Altari 05-29-2012 05:15 PM

How to refresh activitystream each X second ?
 
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
Code:

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

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 [DATE]1338391354[/DATE] at [TIME]1338391354[/TIME] ---------------

Quote:

Originally Posted by Badshah93 (Post 2334420)
you will need to edit these line in activitystream.js file

Change this line
Code:

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

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
Code:

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

Code:

if(this.options.refresh){this.idlerefresh=this.options.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.


All times are GMT. The time now is 12:22 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01004 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete