Results 1 to 6 of 6

Thread: Countdown To 2011

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Location
    Notts, UK
    Posts
    5
    Thanks
    0
    Thanked 20 Times in 2 Posts
    Rep Power
    0

    Default Countdown To 2011

    alri peeps,bit of help needed, can any1 code the countdown to 2011 for wapdesirev2.. can u plz post it ere... Thankz

  2. #2
    Super Moderator subzero's Avatar
    Join Date
    Mar 2006
    Location
    Your Screen.
    Posts
    3,973
    Thanks
    442
    Thanked 380 Times in 181 Posts
    Blog Entries
    7
    Rep Power
    0

    Default

    Code:
    function countdown()
    {
    //A
    $today = time();
    
    //B
    $event = mktime(0,0,0,12,25,date("Y"));
    
    //C
    $apart = $event - $today;
    
    //D
    if ($apart >= -86400)
    {
      $myevent = $event;
    }
    
    //E
    else
    {
      $myevent = mktime(0,0,0,12,25,date("Y")+1);
    }
    
    //F
    $countdown = round(($myevent - $today)/86400);
    
    //G
    if ($countdown > 1)
    {
      echo "$countdown days until Christmas";
    }
    
    //H
    elseif (($myevent-$today) <= 0 && ($myevent-$today) >= -86400)
    {
      echo "Today is Christmas!";
    }
    
    //I
    else
    {
      echo "$countdown day until Christmas";
    }
    }
    echo countdown();
    Visit: [Only registered and activated users can see links. Click Here To Register...]
    Visit: [Only registered and activated users can see links. Click Here To Register...]
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Location
    Notts, UK
    Posts
    5
    Thanks
    0
    Thanked 20 Times in 2 Posts
    Rep Power
    0

    Default

    Quote Originally Posted by subzero [Only registered and activated users can see links. Click Here To Register...]
    Code:
    function countdown()
    {
    //A
    $today = time();
    
    //B
    $event = mktime(0,0,0,12,25,date("Y"));
    
    //C
    $apart = $event - $today;
    
    //D
    if ($apart >= -86400)
    {
      $myevent = $event;
    }
    
    //E
    else
    {
      $myevent = mktime(0,0,0,12,25,date("Y")+1);
    }
    
    //F
    $countdown = round(($myevent - $today)/86400);
    
    //G
    if ($countdown > 1)
    {
      echo "$countdown days until Christmas";
    }
    
    //H
    elseif (($myevent-$today) <= 0 && ($myevent-$today) >= -86400)
    {
      echo "Today is Christmas!";
    }
    
    //I
    else
    {
      echo "$countdown day until Christmas";
    }
    }
    echo countdown();
    Wher does the echo countdown bit?

  4. #4
    Senior Member
    Join Date
    May 2007
    Location
    newcastle
    Posts
    537
    Thanks
    37
    Thanked 44 Times in 20 Posts
    Rep Power
    0

    Default

    anywhere u want it to show am presuming.
    [Only registered and activated users can see links. Click Here To Register...]


    [Only registered and activated users can see links. Click Here To Register...]

  5. #5
    Senior Member
    Join Date
    Mar 2009
    Posts
    176
    Thanks
    84
    Thanked 42 Times in 18 Posts
    Rep Power
    5

    Default

    ech owont work in v2 change it to $main.=

  6. #6
    Junior Member
    Join Date
    Sep 2008
    Location
    uk
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Code:
    <?PHP
    date_default_timezone_set('Europe/London');  
    
    
         if ($date->format('n')==12 && $date->format('d')>24){
         $thisyear = $date->format('Y') + 1;}
         else{ $thisyear = $date->format('Y'); }
    
    
         $time = mktime(0, 0, 0, 12, 25, $thisyear, 23) - time();
         $days = floor($time/86400);
         $hours = floor(($time-($days*86400))/3600);
         $mins = floor (($time-($days*86400)-($hours*3600))/60);
         $secs = floor ($time-($days*86400)-($hours*3600)-($mins*60));
         $tsecs = $time;
         $tmins = round($time/3600*60);
         $thours = round($time/3600);
    
    
    
    
    
    
    /*
    ************************************************
    HOW TO DISPLAY THE NUMBER OF DAYS LEFT
    otherwise you would have to say something
    like "Only 1 day(s) left". This looks better!
    ************************************************
    */
    if ($days == 1){
    $daysremain = 'day';}
    
    
    if ($days == 0){
    $daysremain = '';}
    
    
    else{
    $daysremain = 'days';}
    
    
    if ($days == 0){
    $days = '';}
    
    
    /*
    ************************************************
    HOW TO DISPLAY THE NUMBER OF HOURS LEFT
    ************************************************
    */
    if ($hours == 1){
    $hoursremain = 'hour';}
    
    
    if ($hours == 0){
    $hoursremain = '';}
    
    
    else{
    $hoursremain = 'hours';}
    
    
    if ($hours == 0){
    $hours = '';}
    
    
    /*
    ************************************************
    AND NOW FOR THE MINUTES
    ************************************************
    */
    if ($mins == 1){
    $minsremain = 'minute';}
    
    
    if ($mins == 0){
    $minsremain = '';}
    
    
    else{
    $minsremain = 'minutes';}
    
    
    if ($mins == 0){
    $mins = '';}
    
    
    
    
          echo '<div><h2>UK Countdown To Christmas '. $thisyear .'</h2>';
    
    
               echo'It\'s only <b>' . $days . '</b> '. $daysremain .' <b>' . $hours . '</b> '. $hoursremain .' and <b>' .  $mins . '</b> '. $minsremain .' until Christmas!<br/>';
    
    
          echo '<br/>That\'s only <b>' . number_format($tmins) . '</b> minutes<br/>which is about <b>' . number_format($thours) . '</b> hours!<br/></div>';
    ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. countdown script
    By riderz in forum Coding Forum
    Replies: 0
    Last Post: 22-09-09, 16:41
  2. countdown
    By djdeny in forum Scripts Forum
    Replies: 0
    Last Post: 09-10-08, 22:12

Tags for this Thread

Bookmarks

Posting Permissions

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

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19