I've never used PHP, but can't you use ServerSideIncludes as a template?

In perl forums there's post templates anyway, and they're still given CSS classes to allow easy customising. In PHP forums you could use an object to do the same thing I guess