what about writing a new smarty plugin?