Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 01 Sep 2014, 07:49
tbworld tbworld is offline
 
Join Date: Oct 2008
Activity Stream Javascript Fix (timeout)

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.

Last edited by tbworld; 01 Sep 2014 at 08:03.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 08:03.

Layout Options | Width: Wide Color: