PDA

View Full Version : Adding data to page after page execution


Disasterpiece
01-31-2012, 11:04 AM
OK hard to find a title here...

I want to include some kind of profiling, logging execution time of certain processes to give the admin some info about what's going on and what's taking too much time.
This info gets collected throughout the page execution and should be placed into or below the footer.

Problem is, that apparently all templates are generated before the script execution stops.
I'm looking for a hook which is called after all important templates like showthread and forumhome are processed or all is finished and parsed but I can't find one.
The last hook which is called is showthread_complete but that's useless since my functions are called potentially everywhere.

I tried to register a global shutdown function in php to simply print my profiling data but this seems to mess with vbulletin css and js scripts...

help?

ForumsMods
01-31-2012, 11:33 AM
You can use global_complete or global_shutdown

Disasterpiece
01-31-2012, 12:21 PM
When I print something from those hooks, the text appears above the opening <html> tag.
Any way to append the output after the page or inside a certain template?