vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How-To Cache Templates (https://vborg.vbsupport.ru/showthread.php?t=104532)

Muellmann 06-02-2007 02:10 AM

Very useful info. I followed the instructions to remove the uncached ones thx. :cool:

apn3a 12-12-2007 04:29 AM

i have a php script that i am having trouble with. it is not written for vbulletin, but i would like to include it in my vb's template. this script has about 3-4 php files. i create a php file from which i run my script (followed the instructions from How to create a vbulletin powered page). i only include once the index.php of my script, which runs other php files from inside of it.

my problem is the following: when i run the script, everything is fine, the template is there etc. when i enter the details the script asks for, and i hit submit, the new window that opens does not have the vb template. i've tried everything, no luck. the window that opens when i hit submit has no action (etc. xxx.php?=something.) its just xxx.php. the funny thing is that if i have an error in my form, the template stays as it is even though a new window opens. the problem only occurs when i hit submit. please help :(

noonespecial 04-22-2008 09:04 PM

My question is "Why"?

What does caching templates do? What benefit is there for the programmer and the end user?

Opserty 04-23-2008 03:06 PM

Caching templates means that all the templates are fetched with a single query at the beginning of the script, if you fetch un-cached templates during the script the script has to make database queries to fetch it. Thus using server resources that you don't need to.

Blackhat 10-04-2008 10:49 AM

Quote:

Originally Posted by Princeton (Post 922108)
add the template to the cache_templates hook (plugin):
Code:

$globaltemplates[] = 'Marquee_Text';

That works for me too. So I need to have to plugins for one template. One to call it and one for caching it, right ?

Call it
PHP Code:

eval('$sidebar= "' fetch_template('sidebar') . '";'); 

Cache it
Code:

$globaltemplates[] = 'sidebar';
and can I cache several templates in the same plugin ?

Thanks :)


All times are GMT. The time now is 09:00 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.01286 seconds
  • Memory Usage 1,725KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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