Back to vBulletin 4.x Template Modifications

Session Auto-Refresh (if user has not close the browser: show as online!)
Mod Version: 1.0, by Scandal

vB Version: 4.x.x Rating: (4 votes - 5.00 average) Installs: 17
Released: 26 Oct 2014 Last Update: Never Downloads: 51
Not Supported Template Edits  

A template modification for session auto-refresh!
What does this mod do?
By default, vbulletin refreshes the session only on a page refresh - move to new page by the user. With this, when a user has not close the browser, it continuous display as ONLINE, on the page the browser is.

Copy and paste the following code at the end of your headinclude template and you're ready!

On the *zip package below you can find also the code for vB3 version.

Credits: to madness85 for him idea and the donation for creating this hack.
HTML Code:
<vb:if condition="$show[member]">
    <script type="text/javascript">
      var sc_sessionrefresh_handleSuccess = function(o)
      {
      	if(o.responseText !== undefined)
      	{
      		if (sc_sessionrefresh_callback.object_name[o.tId] !== undefined)
      		{
      			fetch_object(sc_sessionrefresh_callback.object_name[o.tId]).innerHTML = o.responseText;
      		}
      	}
      }
      var sc_sessionrefresh_handleFailure = function(o)
      {
      	if(o.responseText !== undefined)
      	{
      		alert(o.responseText);
      	}
      }
      var sc_sessionrefresh_callback =
      {
      	success: sc_sessionrefresh_handleSuccess,
      	failure: sc_sessionrefresh_handleFailure,
      	timeout: vB_Default_Timeout,
      	cache: false,
      	object_name: new Array()
      } 
      function sc_sessionrefresh_fetch()
      {	
      	var sUrl = document.URL;                    
      	var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, sc_sessionrefresh_callback);
      	return true;
      }
      setInterval(function () {
        sc_sessionrefresh_fetch(); 
      }, {vb:raw vboptions.cookietimeout} * 1000);
    </script>
</vb:if>

Download

File Type: %1$s sc_session_autorefresh_vB3_vB4.zip (2.0 KB, 62 downloads)


vblts.ru supports vBulletin®, 2022-2024