PDA

View Full Version : Countdown Timer


nalexandre
17 May 2009, 02:46
Info:

This is a little mod i made, because i was looking for a similar mod, but did not find anything, so i made this one. Hope someone use it!! :)

What does it do?

It putīs a countdown timer on the head of your forum.

Features:

Easy to use/install.

Installation:

My choice was at the top, but change it as you like.

Go to AdminCP>Styles & Templates>Header>Find "<!-- nav buttons bar -->" , right before paste this:

<script LANGUAGE="JavaScript">
<!--
// by CMBP
var now = new Date();
var event = new Date("Dec 31 2009 12:00:00");
var seconds = (event - now) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
ID=window.setTimeout("update();", 1000);
function update() {
now = new Date();
seconds = (event - now) / 1000;
seconds = Math.round(seconds);
minutes = seconds / 60;
minutes = Math.round(minutes);
hours = minutes / 60;
hours = Math.round(hours);
days = hours / 24;
days = Math.round(days);
document.form1.days.value = days;
document.form1.hours.value = hours;
document.form1.minutes.value = minutes;
document.form1.seconds.value = seconds;
ID=window.setTimeout("update();",1000);
}
// -->
</script>
<p><font face="Arial" size="3">Countdown To December 31, 2009, at 12:00: </font></p>
<form name="form1"><p><font face="Arial" size="2">Days <input type="text" name="days" value="0" size="3"> Hours
<input type="text" name="hours" value="0" size="4"> Minutes <input type="text" name="minutes" value="0"
size="7"> Seconds <input type="text" name="seconds" value="0" size="7"> </font> </p>
</form>

Redifine the target time to countdown as you wish " in red"

Screenshots:

See the example in attach.

Thank you.

Come2Daddy
18 May 2009, 09:46
actually, I'v been looking for this, too

thanx for sharing :)

highlander56
20 May 2009, 16:36
I like this script...nice.
But....how does one go about actually setting the time?
Perhaps I am missing something obvious.:D

Regards

Michael

nalexandre
20 May 2009, 17:31
Hi, to set the target time you must enter the date where i put in red.

<script LANGUAGE="JavaScript">
<!--
// by CMBP
var now = new Date();
var event = new Date("Dec 31 2009 12:00:00");
var seconds = (event - now) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
ID=window.setTimeout("update();", 1000);
function update() {
now = new Date();
seconds = (event - now) / 1000;
seconds = Math.round(seconds);
minutes = seconds / 60;
minutes = Math.round(minutes);
hours = minutes / 60;
hours = Math.round(hours);
days = hours / 24;
days = Math.round(days);
document.form1.days.value = days;
document.form1.hours.value = hours;
document.form1.minutes.value = minutes;
document.form1.seconds.value = seconds;
ID=window.setTimeout("update();",1000);
}
// -->
</script>
<p><font face="Arial" size="3">Countdown To December 31, 2009, at 12:00: </font></p>
<form name="form1"><p><font face="Arial" size="2">Days <input type="text" name="days" value="0" size="3"> Hours
<input type="text" name="hours" value="0" size="4"> Minutes <input type="text" name="minutes" value="0"
size="7"> Seconds <input type="text" name="seconds" value="0" size="7"> </font> </p>
</form>

Thanks and sorry about my english :)

highlander56
20 May 2009, 19:10
Thanks.
When I installed it in a web page, it did not count down.
Now, it does....

Thanks!

Michael

mpjaicom
04 Jun 2009, 23:30
I've been looking for this.

Is there a way to add text to this. Maybe i'm missing it.

Thanks.

SVTCobraLTD
05 Jun 2009, 01:39
I've been looking for this.

Is there a way to add text to this. Maybe i'm missing it.

Thanks.

Isnt this the part for the text??

// -->
</script>
<p><font face="Arial" size="3">Countdown To December 31, 2009, at 12:00: </font></p>
<form name="form1"><p><font face="Arial" size="2">Days <input type="text" name="days" value="0" size="3"> Hours
<input type="text" name="hours" value="0" size="4"> Minutes <input type="text" name="minutes" value="0"
size="7"> Seconds <input type="text" name="seconds" value="0" size="7"> </font> </p>
</form>