Log in

View Full Version : $templatesused - a question


N9ne
03-16-2003, 02:00 PM
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:$templatesused = 'foo1,foo2,foo3';
$templatesused .= ',foo3,foo4,foo5';vB3:// 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?

$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
Today at 07:15 PM Xenon said this in Post #8 (https://vborg.vbsupport.ru/showthread.php?postid=367577#post367577)
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 :(

N9ne
03-16-2003, 05:33 PM
Today at 06:54 PM freddie said this in Post #5 (https://vborg.vbsupport.ru/showthread.php?postid=367555#post367555)
vB2:$templatesused = 'foo1,foo2,foo3';
$templatesused .= ',foo3,foo4,foo5';vB3:// 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',
)
);


Looks good to me :).

Erwin
03-16-2003, 09:10 PM
That looks nice, freddie. Can't wait. :)