TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

October 06, 2024, 09:00:15 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,395
  • Total Topics: 21,244
  • Online today: 162
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 57
  • Total: 57

Recent topics pop up window?

Started by captjlucpicard, October 29, 2006, 02:20:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

captjlucpicard

Has anyone ever tried to make a Recent topics pop up window that would refresh automatically every 30 seconds or so?

akulion

shouldnt be too hard

im a bit short of time so ill give u the components and u can have a go at it.

For the popup define the link in this way:


<a href="http://YOURSITE.COM/recent.php" onclick="window.open('http://YOURSITE.COM/recent.php','dp','height=300,width=450'); return false;">Recent Topics</a>


Define height and width according to ur needs above.
The recent.php file will basically contain a call to the SSI functions and one of the snippets for recent topics display codes which are around in the block code snippets section.

additionally the popup window will have an "auto refresh" script in it..here is a good one which shows time based progress:


<script language="JavaScript">

//Refresh page script- By Brett Taylor (glutnix@yahoo.com.au)
//Modified by Dynamic Drive for NS4, NS6+
//Visit http://www.dynamicdrive.com for this script

//configure refresh interval (in seconds)
var countDownInterval=60;
//configure width of displayed text, in px (applicable only in NS4)
var c_reloadwidth=200

</script>


<ilayer id="c_reload" width=&{c_reloadwidth}; ><layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer></ilayer>

<script>

var countDownTime=countDownInterval+1;
function countDown(){
countDownTime--;
if (countDownTime <=0){
countDownTime=countDownInterval;
clearTimeout(counter)
window.location.reload()
return
}
if (document.all) //if IE 4+
document.all.countDownText.innerText = countDownTime+" ";
else if (document.getElementById) //else if NS6+
document.getElementById("countDownText").innerHTML=countDownTime+" "
else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
document.c_reload.document.c_reload2.document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
document.c_reload.document.c_reload2.document.close()
}
counter=setTimeout("countDown()", 1000);
}

function startit(){
if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
countDown()
}

if (document.all||document.getElementById)
startit()
else
window.onload=startit

</script>


u can specify the time inside the script where it says so in the comments

:up: hope that helps u out - gota run

aku