Code: Select all
function distanceOfTimeInWords($fromTime, $toTime = 0) {
$distanceInSeconds = round(abs($toTime - $fromTime));
$distanceInMinutes = round($distanceInSeconds / 60);
if ( $distanceInMinutes < 90 ) {
return ELAPSED_ABOUT_ONE_HOUR_AGO;
}
}
$serendipity['smarty']->register_function('elapsed_time_words', 'timeAgoInWords');
function timeAgoInWords($params, &$smarty) {
return distanceOfTimeInWords($params['from_time'], time());
}
Has something changed about registering functions in config.inc.php? Ive noticed I cannot install plugins in this testing branch either - are these two issues related?Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/var/www/vhosts/domain.com/templates/don/admin/index.tpl" on line 184 "{elapsed_time_words from_time=$smarty.now}" unknown tag "elapsed_time_words"' in /var/www/vhosts/domain.com/bundled-libs/Smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php:657 Stack trace: #0 /var/www/vhosts/domain.com/bundled-libs/Smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php(443): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "el...', 184) #1 /var/www/vhosts/domain.com/bundled-libs/Smarty/libs/sysplugins/smarty_internal_templateparser.php(2388): Smarty_Internal_TemplateCompilerBase->compileTag('elapsed_time_wo...', Array) #2 /var/www/vhosts/domain.com/bundled-libs/Smarty/libs/sysplugins/smarty_internal_templateparser.php(3101): Smarty_Internal_Templateparser->yy_r36() #3 /var/www/vhosts/s in /var/www/vhosts/domain.com/bundled-libs/Smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 657