function smarty_function_parse_emoticons($params, &$smarty)
{
    global $site, $leht, $template;
    extract($params);
    if (!isset($text)) {
        return;
    }
    $text = do_smileys($text);
    ### add emoticons
    if (isset($name)) {
        # if template variable is set, then assign it:
        $smarty->assign(array($name => $text));
    } else {
        # if no template variable is set then print text out:
        print $text;
    }
}
/**
 * Smarty parse emoticons modifier plugin
 *
 * Type:     modifier<br>
 * Name:     parse_emoticons<br>
 * Purpose:  replace common emoticons with their respective graphical images
 *
 * @author	Saurus <saurus@saurus.info>
 * @param string
 * @return string
 */
function smarty_modifier_parse_emoticons($string)
{
    return do_smileys($string);
}