Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Tip: Locate Uncached Templates in your hack codes
Logician's Avatar
Logician
Join Date: Nov 2001
Posts: 4,449

MCSE, MCDBA, Coder

inside vb code
Show Printable Version Email this Page Subscription
Logician Logician is offline 07-11-2003, 10:00 PM

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.
Attached Files
File Type: txt show uncached template to admins.txt (1.4 KB, 68 views)
Reply With Quote
  #2  
Old 07-20-2003, 03:23 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Which "global.php" file?
Reply With Quote
  #3  
Old 07-20-2003, 03:28 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow another glorius modification by Logician that i overlooked !

- miSt
Reply With Quote
  #4  
Old 07-20-2003, 03:33 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the one under forum dir
Reply With Quote
  #5  
Old 07-20-2003, 03:44 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 07-20-2003, 03:58 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 07-20-2003, 04:59 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Must be my old eyes failing me!
Reply With Quote
  #8  
Old 07-20-2003, 05:23 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
PHP Code:
 if ($show_uncached_templates AND $bbuserinfo['usergroupid']==AND strpos($templatesused,$templatename)===false) {echo ','.$templatename;} 
AS
PHP Code:
 if ($bbuserinfo['usergroupid']==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.
Attached Images
File Type: jpg snap1.jpg (66.3 KB, 0 views)
Reply With Quote
  #9  
Old 07-21-2003, 11:34 PM
Mr. Brian's Avatar
Mr. Brian Mr. Brian is offline
 
Join Date: Jan 2003
Location: Internet
Posts: 300
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Woaa.. You are really a magician.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:58 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04354 seconds
  • Memory Usage 2,300KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (2)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete