Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Countdown script help, please

    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)

    Code:
    <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.
    Last edited by karlwarren; 12-30-2006 at 04:25 AM.

  • #2
    Banned
    Join Date
    Oct 2005
    Location
    I'm in GMT -5
    Posts
    314
    Thanks
    0
    Thanked 1 Time in 1 Post
    Code deleted. Author of the thread failed or refused to timely respond.
    Last edited by Ancora; 01-01-2007 at 12:30 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •