The problem with PHP in templates is that the templates get parsed first. If you try to add PHP code for somthing like a counter, it probably won't work.
I was able to install a PHP counter (BBClone) by modifying the PHP files rather than the templates themselves. If this is what you are trying to do, send me a PM and I can give you more details.