| 1 |
<?php |
<?php |
| 2 |
// $Id: countdown.module,v 1.4 2007/01/15 23:34:37 deekayen Exp $ |
// $Id: countdown.module,v 1.4.2.1 2008/05/12 13:56:28 deekayen Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Count to or from a specified date and display the output in a block |
* Count to or from a specified date and display the output in a block |
| 162 |
$block .= t(', %i seconds', array('%i' => $secs_left)); |
$block .= t(', %i seconds', array('%i' => $secs_left)); |
| 163 |
} |
} |
| 164 |
$block .= t(($passed) ? ' since %s.' : ' until %s.', array('%s' => variable_get('countdown_event_name', ''))); |
$block .= t(($passed) ? ' since %s.' : ' until %s.', array('%s' => variable_get('countdown_event_name', ''))); |
| 165 |
|
if ($accouracy != 'd') { |
| 166 |
|
$path = drupal_get_path('module', 'countdown'); |
| 167 |
|
drupal_add_js($path .'/countdown.js'); |
| 168 |
|
|
| 169 |
|
$block['content'] .= <<<___EOS___ |
| 170 |
|
<script type="text/javascript"><!-- |
| 171 |
|
init_countdown('$accuracy'); |
| 172 |
|
// --></script> |
| 173 |
|
___EOS___; |
| 174 |
|
} |
| 175 |
return $block; |
return $block; |
| 176 |
} |
} |