vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Board Optimization - Plugin Based Template Cache (https://vborg.vbsupport.ru/showthread.php?t=113002)

orban 04-22-2006 07:49 PM

It saves the eval(template). eval() is kind of "bad", because it can't be cached by a PHP cache.

Kihon Kata 04-25-2006 12:46 AM

I'm coming back to post that this hack has sped up my site sooo much faster! Thanks ORban

Boofo 04-28-2006 10:10 PM

Quote:

Originally Posted by orban
I don't know what the plugin authors thought with modifying templates on run time.

Not having to edit templates and making installs easier for the end user. ;)

orban 04-28-2006 10:14 PM

Uhm, you can add templates to product.xmls?

Also you might have modified the templates so the str_replace doesn't even work anymore.

Boofo 04-28-2006 10:17 PM

Quote:

Originally Posted by Urban
Hum, you can add templates to product.XML?

You can do it with search and replace. Check out my Last 15 Searches hack. I did it in there. More products are being released that do this now. I do it whenever I can for the reasons stated above. ;)

orban 04-28-2006 10:50 PM

Code:

$vbulletin->templatecache['search_forums'] = str_replace('$navbar', '$navbar' . ' $last15searches', $vbulletin->templatecache['search_forums']);
Somebody might not have a $navbar.

Boofo 04-28-2006 10:56 PM

Quote:

Originally Posted by orban
Code:

$vbulletin->templatecache['search_forums'] = str_replace('$navbar', '$navbar' . ' $last15searches', $vbulletin->templatecache['search_forums']);
Somebody might not have a $navbar.

So far, that hasn't happened yet and really shouldn't unless they are REALLY screwing with their templates. That is standard in alot of templates for vb. When I do search and replaces, I only work from the Master Template set (the default one) and no other products or hacks that I know of use that spot in that certain template. ;)

orban 04-28-2006 11:01 PM

Why not add $last15searches to the navbar template?

Like $vbulletin->templatecache['navbar'] = $vbulletin->templatecache['navbar'].'.$last15searches'; or something, because would work with the template cache too.

Boofo 04-28-2006 11:09 PM

Quote:

Originally Posted by orban
Why not add $last15searches to the navbar template?

Like $vbulletin->templatecache['navbar'] = $vbulletin->templatecache['navbar'].'.$last15searches'; or something, because would work with the template cache too.

Because the replace for that is a template edit. You would then have to manually edit the template. With the way I did it, you don't have to touch the template and it will be better on ungrades where vb adds to or changes to the template. ;)

orban 04-28-2006 11:11 PM

No you don't? That's PHP code to be run in the plugin, instead of your str_replace.


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01742 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete