game/onyx2/modules/templates/smarty/plugins/modifier.countdown.php

29 lines
676 B
PHP
Raw Normal View History

2020-11-15 15:12:30 +00:00
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty capitalize modifier plugin
2020-11-15 15:12:30 +00:00
*
* Type: modifier<br>
* 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
2020-11-15 15:12:30 +00:00
* @return string
*/
function smarty_modifier_countdown($timer)
2020-11-15 15:12:30 +00:00
{
if ($timer > 3600) {
return intVal($timer/3600) . ":" . intVal(($timer%3600)/60) . ":" . ($timer%3600)%60;
} else {
return intVal($timer/60) . ":" . $timer%60;
}
2020-11-15 15:12:30 +00:00
}