actually a little known fact about php, is that you can include it via SSI, and its parsed properly.
meaning you can write little 'panels' and include them via SSI.
im working on one right now, you can take a look @ it, at
http://www.tribalwar.com/forum_index.shtml (shhh

)
as you can see, its a .shtml page, and ive got PHP SSI'd in, and its working properly.
you just cant pass it arguments the same way.
edit: you'll have to register, unfortunately. make sure though, you check the bottom two settings to see it working fully.
edit #2: its the my TW part. first panel, left nav bar.