| 1 |
<?php |
<?php |
| 2 |
// $Id: countdown.tpl.php,v 1.1 2008/05/12 13:36:55 deekayen Exp $ |
// $Id: countdown.tpl.php,v 1.1.2.2 2008/07/25 16:12:52 deekayen Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file countdown.tpl.php |
* @file countdown.tpl.php |
| 25 |
$min_left = floor(($difference - $days_left*60*60*24 - $hrs_left*60*60)/60); |
$min_left = floor(($difference - $days_left*60*60*24 - $hrs_left*60*60)/60); |
| 26 |
$secs_left = floor(($difference - $days_left*60*60*24 - $hrs_left*60*60 - $min_left*60)); |
$secs_left = floor(($difference - $days_left*60*60*24 - $hrs_left*60*60 - $min_left*60)); |
| 27 |
|
|
| 28 |
print t('%i days', array('%i' => $days_left)); |
print format_plural($days_left, '1 day', '@count days'); |
| 29 |
if ($accuracy == 'h' || $accuracy == 'm' || $accuracy == 's') { |
if ($accuracy == 'h' || $accuracy == 'm' || $accuracy == 's') { |
| 30 |
print t(', %i hours', array('%i' => $hrs_left)); |
print format_plural($hrs_left, ', 1 hour', ', @count hours'); |
| 31 |
} |
} |
| 32 |
if ($accuracy == 'm' || $accuracy == 's') { |
if ($accuracy == 'm' || $accuracy == 's') { |
| 33 |
print t(', %i minutes', array('%i' => $min_left)); |
print format_plural($min_left, ', 1 minute', ', @count minutes'); |
| 34 |
} |
} |
| 35 |
if ($accuracy == 's') { |
if ($accuracy == 's') { |
| 36 |
print t(', %i seconds', array('%i' => $secs_left)); |
print format_plural($secs_left, ', 1 second', ', @count seconds'); |
| 37 |
} |
} |
| 38 |
print t(($passed) ? ' since %s.' : ' until %s.', array('%s' => variable_get('countdown_event_name', ''))); |
|
| 39 |
|
$event_name = variable_get('countdown_event_name', ''); |
| 40 |
|
$url = variable_get('countdown_url', ''); |
| 41 |
|
$event_name = empty($url) || $url == 'http://' ? $event_name : l($event_name, $url, array('absolute' => TRUE)); |
| 42 |
|
|
| 43 |
|
print t(($passed) ? ' since !s.' : ' until !s.', array('!s' => $event_name)); |
| 44 |
|
|
| 45 |
if ($accuracy != 'd') { |
if ($accuracy != 'd') { |
| 46 |
$path = drupal_get_path('module', 'countdown'); |
$path = drupal_get_path('module', 'countdown'); |