vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=314055

Activity Stream Javascript Fix (timeout)
by tbworld
01 Sep 2014 06:49

Found a small "glitch" in vbulletin's activity stream's javascript. Essentially, the timeout timer is not being initiated unless a "mousemove" event is fired. This will only affect the largest of boards and those boards that heavily use the activity stream. Otherwise you would be wasting your time with this patch and the rest of this text will surely bore you. :)

Background
------------
My daughter had a redesign idea for her activity stream, so I finally had a bit of time to redevelop the JavaScript/AJAX for her new page. She wanted a dynamic window widget for her modified activity stream with additional filters and presentation information. When working with the new floating widget I noticed that the activity stream never timed out when the widget was not in focus. This will not do as her users want to have this window float on their desktops and will probably forget that it is there. I did not want 400 users banging on the server indefinitely for AJAX updates. vBulletin has done a fair job in their code here so updates are very minimized, unless the user asks for an update via the AJAX activity indicator. On my daughters board this additional click is optional so the updates can be a real-time stream.

Once a "mousemove" event is triggered then everything works as expected. In most cases most users will perform this just viewing the page. This is only a real problem if this window/widget is not the current focus, thus impossible for an initial "mousemove" event.

Anyway, here is the fix. (Do not bother with this unless you are doing something similar).

In "/clientscript/vbulletin_activitystream.js" make the following changes and additions.

Search for:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add to the bottom of the file:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Have fun. :)


All times are GMT. The time now is 04:11.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.