Countdown To 2011

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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
    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: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    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

    Comment


      #3
      Originally posted by subzero View Post
      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?

      Comment


        #4
        anywhere u want it to show am presuming.
        Wapchat4u


        Topsites4u

        Comment


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

          Comment


            #6
            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>';
            ?>

            Comment

            Working...
            X