vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   $templatesused - a question (https://vborg.vbsupport.ru/showthread.php?t=50274)

N9ne 03-16-2003 02:00 PM

$templatesused - a question
 
Say you already have a $templatesused variable in a file, but it's getting very long, can you just add another $templatesused=... etc below it? Would it work?

filburt1 03-16-2003 02:12 PM

No because it's used to cache the templates before including global.php. Any uncached templates must be queried from the database.

(I think)

N9ne 03-16-2003 02:48 PM

I just figured out that you can indeed add another templatesused var, below it, as long as you have $templatesused = ",blah_template,blah,blah";

So basically start with a comma.

Dpcows 03-16-2003 03:23 PM

you need to add a . before the =

So:

$templatesused .= ",blah_template,blah,blah";

Freddie Bingham 03-16-2003 04:54 PM

vB2:
PHP Code:

$templatesused 'foo1,foo2,foo3';
$templatesused .= ',foo3,foo4,foo5'

vB3:
PHP Code:

// pre-cache templates used by all actions
$globaltemplates = array(
    
'PM',
    
'pm_messagelist_userbit',
    
'pm_messagelistbit',
    
'pm_messagelist_emptyfolder',
    
'pm_receipts',
    
'pm_receiptsbit',
    
'usercpmenu',
    
'usercpnav'
);
// pre-cache templates used by specific actions
$actiontemplates = array(
    
'editfolders' => array(
        
'pm_editfolderbit'
    
),
    
'showpm' => array(
        
'postbit',
        
'postbit_online',
        
'postbit_reputation',
        
'postbit_buttons',
        
'postbit_userinfo',
        
'postbit_bbcode_code',
        
'postbit_bbcode_html',
        
'postbit_bbcode_php',
    )
); 


Xenon 03-16-2003 05:08 PM

are these "templateused" in the file where they are needed, or are they stored in a extra file which will be included from global.php?

nevertheless i like the new style :)

Dean C 03-16-2003 05:12 PM

I don't makes it more complicated if you don't know PHP very well :(

- miSt

Xenon 03-16-2003 05:15 PM

if you don't know php very well you shouldn't play with vb's source code ;)

filburt1 03-16-2003 05:20 PM

Maybe I'm not getting something but wouldn't this be more logical?
PHP Code:

$templateengine->cachetemplates(array("name1""name2",...)); 

i.e., not storing stuff in variables and then referencing them in a global scope.

Dean C 03-16-2003 05:27 PM

Quote:

Today at 07:15 PM Xenon said this in Post #8
if you don't know php very well you shouldn't play with vb's source code ;)
Always trying to make me feel inferior aren't you :(


All times are GMT. The time now is 06:22 AM.

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.01132 seconds
  • Memory Usage 1,737KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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