...

View Full Version : Countdown script help, please



karlwarren
12-30-2006, 03:11 AM
I'm editing a version of a countdown script which combines
php and javascript

full code here:
http://www.karlwarren.com/limitscript/enh/codetest.txt
original code here:
http://www.karlwarren.com/limitscript/enh/codetest2.txt
usage example here:
http://www.karlwarren.com/limitscript/enh/codetest.php

The script is slightly limited in that it appears to only allow
me to count up to 28 days from now... I would like
to solve this particular issue and have an unlimited "countdown from".

I would also like it to format the countdown as follows:

Time remaining: x days, 23:33:32
even if x = 365 or more as an "offer" might last a year or more.
And once the offer is over, just like it does now, it refreshes the
page and displays an expired message instead of the counter.

I'm assuming my "problem" and possible solution relates to this section of code... (I may be wrong)


<script language="JavaScript">
<!--
function showtime() {
setTimeout("showtime();",1000);
sourcedate.setTime(sourcedate.getTime()-1000);
var hh = (sourcedate.getDate()-1)*24 + sourcedate.getHours()-1;
if ( hh < 0 ) {
document.all["clock"].innerText = '';
this.location.href = this.location.href; // Reload the page
}
var mm = sourcedate.getMinutes();
var ss = sourcedate.getSeconds();
if (hh >= 0) {
document.all["clock"].innerText = ((hh < 10) ? "0" : "") + hh + ((mm <
10) ? ":0" : ":") +
mm + ((ss < 10) ? ":0" : ":") + ss;
}
}

sourcedate = new Date(<?= date("Y,m,d,H,i,s",$seconds_left);?>);
//-->



I will be eternally grateful for any help and a solution.
Many thanks in advance.

Karl.

Ancora
12-30-2006, 12:04 PM
Code deleted. Author of the thread failed or refused to timely respond.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum