Login     Sign up
Auto refress page
putribetha (@putribetha)
Join date: Sep 17th 2010
Community posts: 34
View Profile
Send Message

copy paste
[code]<script>
<!--

//enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
var limit="2:50"

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)
}
}

window.onload=beginrefresh
//-->
</script>[/code]
beffore </head> in your page.tpl.php

164 months ago
Eliz zeta (@eliz)
Join date: Nov 29th 2010
Community posts: 153
View Profile
Send Message

very good idea , this will be cool in a network with too many activities at the same time to mantain user connected. but be careful, if you click share in the same time page is refreshing, you will get this :
[url]http://yourdomain.com/streampublish[/url]
" content shared "

So at the moment, this code shoud be modified ยก the reload page shoud be dashboard because when you reload and the same time clicking on share, the page is streampublish

164 months ago
arizon efendi (@arizon)
Join date: Aug 26th 2010
Community posts: 145
View Profile
Send Message

the problem will come if you upload a big file.

sudah ada di forum ini dulu, dan dah dihapus admin. upload blm selesai, halaman udah ngerefresh.... capek deh jadinya.

163 months ago
Eliz zeta (@eliz)
Join date: Nov 29th 2010
Community posts: 153
View Profile
Send Message

what a bout using window.location.replace instead of reload, it will do the same, replacing streampublish with dashboard, the only problem is when we are uploading a file.
any idea ?

163 months ago
Eliz zeta (@eliz)
Join date: Nov 29th 2010
Community posts: 153
View Profile
Send Message

ok, maybe that s the solution, using openforms

if ( openForms==0 ) {
// No Windows Open - Reloading
window.location.reload(true);
} else {
// Windows Open - NO Reload
}
}
it s not tested yet

163 months ago
putribetha (@putribetha)
Join date: Sep 17th 2010
Community posts: 34
View Profile
Send Message

To solve the problem at the time of uploading large files. You can stop the auto-reload by clicking the X on your internet browser.
you can see a good time to stop the auto-reload, and I do this successfully .

Untuk mencegah kegagalan pada saat upload file besar, bisa dengan menghentikan auto refress , tapi harus pada waktu yang tepat, ini berhasil saya lakukan kok bos. dan kita kan bisa sesuaikan waktu auto reload misal jadi 5 menit sekali

163 months ago
arizon efendi (@arizon)
Join date: Aug 26th 2010
Community posts: 145
View Profile
Send Message

oke...nice job bro.. thanks

163 months ago
John D (@johnd)
Join date: Oct 29th 2010
Community posts: 132
View Profile
Send Message

I think auto-reload included in the script would be great.

I dont think its a major problem, but it would be a nice addition :)

163 months ago