Should fix #122
Swap $smarty->register_function(... for $smarty->registerPlugin('function', .... Also got rid of assign by ref which is also deprecated; couldn't see a reason for it needing to be by ref.
$smarty->register_function(...
$smarty->registerPlugin('function', ...