forked from halo-battle/game
Update Smarty to v2.6.31 (fix compatibility with PHP 7.2)
This commit is contained in:
parent
aebcb5b82b
commit
f88f9499d0
400 changed files with 3366 additions and 49622 deletions
|
|
@ -7,27 +7,24 @@
|
|||
|
||||
|
||||
/**
|
||||
* Smarty countdown modifier plugin
|
||||
* Smarty capitalize 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
|
||||
* Name: capitalize<br>
|
||||
* Purpose: capitalize words in the string
|
||||
* @link http://smarty.php.net/manual/en/language.modifiers.php#LANGUAGE.MODIFIER.CAPITALIZE
|
||||
* capitalize (Smarty online manual)
|
||||
* @author Monte Ohrt <monte at ohrt dot com>
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function smarty_modifier_countdown($secondes)
|
||||
function smarty_modifier_countdown($timer)
|
||||
{
|
||||
$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;
|
||||
if ($timer > 3600)
|
||||
return intVal($timer/3600) . ":" . intVal(($timer%3600)/60) . ":" . ($timer%3600)%60;
|
||||
else
|
||||
return intVal($timer/60) . ":" . $timer%60;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue