vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Checking template variables.. (https://vborg.vbsupport.ru/showthread.php?t=48793)

stryka 02-11-2003 11:25 AM

Checking template variables..
 
How do I check what template variables are being stored/called via functions.php.

Reason is... i have a custom template that calls $footer sucessfully but does not get any other custom template.

Thanx

Quote:

<?php
error_reporting(7);
$templatesused='cust_header,footer,cust_notfound,c ust_main';


require(getenv('DOCUMENT_ROOT').'/global.php');
$var = $DB_site->query_first("SELECT * FROM etc ");

if($var)
{
eval("dooutput(\"".gettemplate('cust_main')."\");" );
}
else
{
eval("dooutput(\"".gettemplate('cust_notfound')."\ ");");
}

?>


//cust_main is called successfully along with cust_notfound but cust_header & anything else called
in cust_main do not get displayed


Xenon 02-11-2003 12:12 PM

$header and $footer are defined in global.php

so you have to define your variables before you can call em in templates..

stryka 02-11-2003 12:27 PM

but i thought all template variables are defined in functions.php and that's why $cust_main is successfully called?

whats the diff with the other variable/template within $cust_main

i found // ###################### Start templates #######################

within global.php - should i add my custom template to the default list?actually , that didnt work...

trying to undestand how this thing works

Xenon 02-11-2003 12:32 PM

nope, the part in functions.php just caches the content of templates, that you don't have to catch em from the db with every call.

you always have to define variables before you can use them.

example:

PHP Code:

eval("\$cust_header = \"".gettemplate('cust_header')."\";");
eval(
"dooutput(\"".gettemplate('cust_main')."\");"); 

now you can use $cust_header in your cust_main template

stryka 02-11-2003 12:40 PM

XENON THANK-YOU SO MUCH ...

I am obviously new to PHP and just trying to put things together... it took awhile to see how i call variables via non-vb pages and then i realized the power of custom templates... and this last answer you provided me know lets me do anything...

I definetly will come back in a couple weeks to collect all my custom template questions/answers for other newbies...

thanx again...

p.s. i think my next question will be... Where can i go to see how to add other templates to the cache? I have atleast two that will be called on every Non VB page...

Xenon 02-11-2003 01:10 PM

:)
glad i could help :)

at PS: $templateused is the variable where you have to add templates to add em to the cache :)
in global.php it will affect every page ;)


All times are GMT. The time now is 01: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.01124 seconds
  • Memory Usage 1,724KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete