Log in

View Full Version : index.php


oninuva
07-11-2006, 11:59 PM
i was looking at the index.php file and i have a question. how do they sort out what goes first and stuff.

The beggining is like this

/ ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array('holiday');

// get special data templates from the datastore
$specialtemplates = array(
'userstats',
'birthdaycache',
'maxloggedin',
'iconcache',
'eventcache',
'mailqueue'
);

// pre-cache templates used by all actions
$globaltemplates = array(
'FORUMHOME',
'forumhome_event',
'forumhome_forumbit_level1_nopost',
'forumhome_forumbit_level1_post',
'forumhome_forumbit_level2_nopost',
'forumhome_forumbit_level2_post',
'forumhome_lastpostby',
'forumhome_loggedinuser',
'forumhome_moderator',
'forumhome_pmloggedin',
'forumhome_subforumbit_nopost',
'forumhome_subforumbit_post',
'forumhome_subforumseparator_nopost',
'forumhome_subforumseparator_post'

well that means they are taking the templates out right? and then in the templates it has how the page should look like? so its sort of like a puzzle? and the templates are the pieces?

and when they say this

[code]require_once('./global.php');[code]

i dont get that :(

Brad
07-12-2006, 12:02 AM
We build an array of templates before including global.php for one reason: so we can pull all these templates with one SQL query.

If you do not include a needed template in these arrays, vBulletin will have to run an extra query to fetch it from the database. This means there will be more load placed on the database server.

If you add a new custom template, and fetch it via a plug-in you'll need to also place that template into the cache array. You can add new template to this list by using the hook: cache_templates.

oninuva
07-12-2006, 12:04 AM
ok thanks :)

html is so much easier IMO

When they say "Fetch" it means they are using that template or file?

If yes how does it know what to use in the template? or does it just use the whole template?

Sorry for asking questions but this all new to me