Initial commit
This commit is contained in:
commit
998d011cd3
233 changed files with 36893 additions and 0 deletions
33
onyx/modules/templates/smarty/plugins/modifier.countdown.php
Normal file
33
onyx/modules/templates/smarty/plugins/modifier.countdown.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* Smarty plugin
|
||||
* @package Smarty
|
||||
* @subpackage plugins
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Smarty countdown modifier plugin
|
||||
*
|
||||
* Type: modifier<br>
|
||||
* Name: countdown<br>
|
||||
* Date: Apr 15, 2009
|
||||
* Example: {$seconds|countdown}
|
||||
* @version 1.0
|
||||
* @author Nemunaire <nemunaire at gmail dot com>
|
||||
* @param timestamp
|
||||
* @return string
|
||||
*/
|
||||
function smarty_modifier_countdown($secondes)
|
||||
{
|
||||
$heures = intval($secondes/3600);
|
||||
if ($heures < 10) $heures = '0'.$heures;
|
||||
$minutes = intval(($secondes%3600)/60);
|
||||
if ($minutes < 10) $minutes = '0'.$minutes;
|
||||
$secondes = $secondes%60;
|
||||
if ($secondes < 10) $secondes = '0'.$secondes;
|
||||
|
||||
return $heures.':'.$minutes.':'.$secondes;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in a new issue