Quote:
Originally Posted by CAG CheechDogg
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>
|
This works very well. However the refresh time should be a little high, I have mine set to 15 minutes. This is because if someone is posting a reply or starting a new thread, if the refresh time is very low, the page will be refreshing when the user is trying post, and if the page is refreshed before the post is finished, the user's post will be cleared. Now i have my vB settings to save a draft of the user post before the refresh, so the user just has to click "Restore Auto-Saved Content" at the bottom of the Input Area. I don't know if that is a default setting or not, im not sure. But if its not, you could see how that could become a problem if the refresh time was really low.