2006/1/22 1:24
shank
Not too shy to talk
Posts: 144
Since: 2004/8/17
2006/1/30 15:53
bradburn
Posts: 105
Since: 2005/1/26
JMorris wrote:Here's an amazingly simple PHP-based countdown timer I found. We chose to use this script over a Javascript version because we have a lot of dial-up visitors and adding more javascripts to the site was slowing it down.Live demo (bottom-right block on homepage): http://cit.wvup.eduJust paste the following code (exactly as shown) in a Custom PHP block and edit to suite: ?> // enter target date below like this: "January 2, 2001" $target = "February 10, 2006"; // enter string of what this start date is. $top_text appears above the counter, $bottom_text displays below the counter $top_text = "There are "; $bottom_text = "until the last day to apply to graduate in May!"; //-------------------------- $now = strtotime ("now"); $then = strtotime ("$target"); $difference = $then - $now; $num = $difference/86400; $days = intval($num); $num2 = ($num - $days)*24; $hours = intval($num2); $num3 = ($num2 - $hours)*60; $mins = intval($num3); $num4 = ($num3 - $mins)*60; ?> echo $top_text ?> echo $days ?> : echo $hours ?> : echo $mins ?> Days | Hrs | Mins echo $bottom_text ?> James
?> // enter target date below like this: "January 2, 2001" $target = "February 10, 2006"; // enter string of what this start date is. $top_text appears above the counter, $bottom_text displays below the counter $top_text = "There are "; $bottom_text = "until the last day to apply to graduate in May!"; //-------------------------- $now = strtotime ("now"); $then = strtotime ("$target"); $difference = $then - $now; $num = $difference/86400; $days = intval($num); $num2 = ($num - $days)*24; $hours = intval($num2); $num3 = ($num2 - $hours)*60; $mins = intval($num3); $num4 = ($num3 - $mins)*60; ?> echo $top_text ?> echo $days ?> : echo $hours ?> : echo $mins ?> Days | Hrs | Mins echo $bottom_text ?>
Advanced Search
285 user(s) are online (211 user(s) are browsing Support Forums)
Members: 0
Guests: 285