game/onyx2/modules/templates/smarty/plugins/modifier.countdown.php
Nigel dd61d3b66b
All checks were successful
continuous-integration/drone/push Build is passing
Ajout d'une étape de linting dans DroneCi (#3)
Corrige un doublons laissé par le rebase semi-manuel

Ajout d'une étape de linting dans DroneCi

Fix linting

Co-authored-by: Nigel Sheldon <nigelsheldon@live.fr>
Reviewed-on: https://gitea.nemunai.re/halo-battle/game/pulls/3
2020-11-21 18:54:32 +00:00

29 lines
676 B
PHP

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