The Arcive of vBulletin Modifications Site. |
|
Session Auto-Refresh (if user has not close the browser: show as online!) Details »»
|
|||||||||||||||||||||||||||||
|
Session Auto-Refresh (if user has not close the browser: show as online!)
Developer Last Online: Nov 2023
A template modification for session auto-refresh! :up:
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 Now
Show Your Support
|
|||||||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
Looks good. I just added the script. Thanks.
|
|
#3
|
|||
|
|||
|
Installed.
EDIT. It doesn't seem to be working
|
|
#4
|
||||
|
||||
|
How to conform as it is working?!
|
|
#5
|
|||
|
|||
|
It still stay the same for me.
|
|
#6
|
||||
|
||||
|
I would use this instead and just wrap it around the same conditional:
Change the minutes and seconds highlighted in red to your choice.... Code:
<vb:if condition="$show[member]">
<script type="text/javascript">// <![CDATA[
/*
Auto Refresh Page with Time script
By JavaScript Kit (javascriptkit.com)
Over 200+ free scripts here!
*/
//enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
var limit="00:10"
if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
else
curtime=cursec+" seconds left until page refresh!"
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}
function makeDoubleDelegate(function1, function2) {
return function() {
if (function1)
function1();
if (function2)
function2();
}
}
window.onload = makeDoubleDelegate(window.onload, beginrefresh );
// ]]></script>
</vb:if>
|
|
#7
|
|||
|
|||
|
Thanks Scandal. Looks good.
|
|
#8
|
||||
|
||||
|
Quote:
|
|
#9
|
|||
|
|||
|
you must have your Session Timeout higher than in the code above for it to work {vb:raw vboptions.cookietimeout} * 1000); mine is set to 1800
@CAG CheechDogg nice script but that actually refreshes the page
|
![]() |
|
|