Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2004, 06:53 PM
flat6 flat6 is offline
 
Join Date: Apr 2004
Location: Toronto
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default how does template caching work?

I'm looking at the following:

PHP Code:
// get special data templates from the datastore
$specialtemplates = array(
    
'smiliecache',
    
'bbcodecache',
    
'banemail',
);

// pre-cache templates used by all actions
$globaltemplates = array(
    
'USERCP_SHELL',
    
'usercp_nav_folderbit'
); 
It seems that beyond declaring the names of the array, nothing else happens. What am I stupidly overlooking :ermm:
Reply With Quote
  #2  
Old 05-24-2004, 07:01 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It puts these files into the datacache which means they can be called with out needing to run a query to do it
Reply With Quote
  #3  
Old 05-24-2004, 07:06 PM
flat6 flat6 is offline
 
Join Date: Apr 2004
Location: Toronto
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So, I've got a new template, called modifywidget. How would I go about getting this new template cached? I'm guessing there's more to it than just $widgettemplates = array('modifywidget');, but I'm not sure where the rest of the behind-the-scenes templace caching action takes place.
Reply With Quote
  #4  
Old 05-24-2004, 07:09 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$globaltemplates = array('modifywidget');
Reply With Quote
  #5  
Old 05-24-2004, 07:12 PM
flat6 flat6 is offline
 
Join Date: Apr 2004
Location: Toronto
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But where does it do its caching thing? I want to see its guts Logically, there should be a DB query someplace, or at least some functions behind this.
Reply With Quote
  #6  
Old 05-24-2004, 07:26 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Look in init.php
Reply With Quote
  #7  
Old 05-24-2004, 07:44 PM
flat6 flat6 is offline
 
Join Date: Apr 2004
Location: Toronto
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent. One last thing, what's the rule of thumb for using $globaltemplates vs. $actiontemplates? The comments say "pre-cache templates used by all actions" vs "pre-cache templates used by specific actions". I'm basically going to be calling this from a function, so I'm leaning towards $actiontemplates, but not sure about the usage guides :nervous: <- hah, that smiley's great.

Edit: wait, is it that the subarray must be named by the name of the function, and will only be accessible from that function, while global can be used anywhere in the file?
Reply With Quote
  #8  
Old 05-24-2004, 07:47 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

special templates is ONLY for calling things that have been stored in the datastore table as far as im aware. if your just using templates you have made in vBulletin's tempalte system you use globaltemplates
Reply With Quote
  #9  
Old 05-24-2004, 07:50 PM
flat6 flat6 is offline
 
Join Date: Apr 2004
Location: Toronto
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's three things as far as I can see, $globaltemplates, $actiontemplates and $specialtemplates. I'm staying away from that last one, but from looking over vB3 code, it seems they're very stingy with the $globaltemplates and prefer to use $actiontemplates.
Reply With Quote
  #10  
Old 05-24-2004, 08:08 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

globaltemplates are for templates that are NOT used in actions, action templates are templates that are used in actions within the file, take at https://vborg.vbsupport.ru/showthread.php?t=59939
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 05:38 AM.


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.04149 seconds
  • Memory Usage 2,255KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete