New from the WaxJeely blog today, there's a post that steps you through the creation of a custom Smarty function in PHP.
In this tutorial, we'll write our first custom smarty, and get the ball rolling in the right direction for being able to do pretty much anything you want to do with...okay, this post is going to say "Smarty" a lot, in case you can't already tell. Let's get started.
They go through where to find and put your files, what the class will be doing, and how to use the new functionality. There's three files involved - an index.php, a template file, and a file for the function itself.