Helpful Information
 
 
Category: Read An Article
Tip: Locate Uncached Templates in your hack codes

This small hack shows uncached templates to admins while you are browsing the board.

I find it handy when coding a large hack where you use a lot of new templates. Instead of going through the entire code and find out which templates you have, I just run the hack page and at the top I get all uncached templates names with this hack while I'm browsing it.

The hack is designed to work in test boards where you develop the project but I don't think it is a big deal if you install in a real board.

For newbies: Uncached templates add additional queries to your hack code so the best practise is to add their names in the $templatesused variable at the top of your code to make your hack more performance friendly.

Which "global.php" file?

Wow another glorius modification by Logician that i overlooked :)!

- miSt

the one under forum dir

I tried that one but I got no messages, and I know there's a few that are uncached ... and where *exactly* do ya put the code into the globa.php file?

anywhere at the start should work. For instance right after error_reporting(7);

Please make sure you browse the pages your uncached templates might exist after you installed the hack. It does not list all uncached templates right away after you installed it. It will display them while you are browsing your hack's pages.

Still not showing up for me ... I can't figure this one out!

Must be my old eyes failing me! :p

umm then you might be hacking an external file? If this is the case add line $show_uncached_templates=1 to your hack file either.

We can cure your problem alltogether by removing the on-off switch anyway:

Replace line:

if ($show_uncached_templates AND $bbuserinfo['usergroupid']==6 AND strpos($templatesused,$templatename)===false) {echo ','.$templatename;}


AS

if ($bbuserinfo['usergroupid']==6 AND strpos($templatesused,$templatename)===false) {echo ','.$templatename;}


and you are set. ;)

Also remember to check at the begining of your pages. That is where hack pastes your uncached templates.

Woaa.. You are really a magician. :rolleyes:










privacy (GDPR)