I took the code and made it work as a UDT (User Defined Tag) I call Truncate Better on CMSMS (CMS Made Simple) . . . I added a "read more" link with variable text and put the user specified ...
Be great to have a file that tests your setup (like the one here: httpwwwphpinsidercom/smarty-forum/viewtopic.php?t=4500 ) but prettier and with more detail for troubleshooting as part of the package ...