I have to admit it's been some time since I laid my hands on an MCCodes script, so best practices out the window.
I would like to give MCCodes developers a useful tip.
How many times haven't you missed a $h->endpage(); initialization? I know I have had my fair share of times.
When it comes to output buffering for template systems, it's really a nuisance to work with.
So, I've come up with a hack for it...
MCCodes uses a class named headers for all it's templating needs, and using a bit of OOP knowledge one can automatically "close" a script that doesn't have the endpage() initialization present.
It's called a destructor. It executes automatically every time the class is destroyed, or in human terms, when the script has finished executing.
One can simply place the endpage() initialization in there, with a logical statement, so that you never get caught of guard by it again.
So here's a little bit of code that could make your life easier... It works on all versions of MCCodes, to my knowledge that is.
It might be useful to some, and not to others.
But I just thought I would share this age old hack.