11
shank
Re: I would like a module that can do a countdown ticker
  • 2006/1/22 1:24

  • shank

  • Not too shy to talk

  • Posts: 144

  • Since: 2004/8/17


Now if some one could figure out how to make this automatically update so you could make it say there are so many days till the next event on the tinyevents module.
s l s h a n k l e @ b e l l s o u t h . n e t

12
bradburn
Re: I would like a module that can do a countdown ticker
  • 2006/1/30 15:53

  • bradburn

  • Not too shy to talk

  • Posts: 105

  • Since: 2005/1/26


Quote:

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.edu

Just 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;
?>
<div style="font-weight:bold;" align="center"> <? echo $top_text ?><br />
  <table border="0" cellspacing="0" cellpadding="0" style="color:#00CC00;font-size:10px;font-family:'Courier New', Courier, mono;border-top:2px solid #AAAAAA;border-right:2px solid #333333;border-bottom:2px solid #333333;border-left:2px solid #AAAAAA;background-color:#000;padding:0px;width:125px;">
    <tr align="center" valign="middle">
      <td><? echo $days ?></td>
      <td>:</td>
      <td><? echo $hours ?></td>
      <td>:</td>
      <td><? echo $mins ?></td>
    </tr>
    <tr align="center" valign="middle">
      <td>Days</td>
      <td>|</td>
      <td>Hrs</td>
      <td>|</td>
      <td>Mins</td>
  </table>
  <? echo $bottom_text ?> </div>
<?



James


When you put the expiry date in for the countdown, the count down is set to stop at Midnight. Is there a way to set which time the count down stops at? I would like the countdown to finish at a 18:00 on the expiry date, not at 00:00 when the day starts....

Does anyone know how I could do that using this script?
Many many thanks for any help!

Login

Who's Online

280 user(s) are online (155 user(s) are browsing Support Forums)


Members: 0


Guests: 280


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits