vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   "Fetching" multiple templates? (https://vborg.vbsupport.ru/showthread.php?t=76694)

Deaths 02-20-2005 04:54 PM

"Fetching" multiple templates?
 
I basicly have a couple of "module" which I want to show in the navbar.
However, this is partly template based...

When I call a template the way I know
PHP Code:

eval('print_output("' fetch_template 

it just calls 1 template, and not the other ones.

What's the command for calling a template in a way that I can still call the final template?

Help would be appreciated, hoping for a quick reply :)

Zachery 02-20-2005 04:57 PM

Quote:

Originally Posted by Deaths
eval('print_output("' . fetch_template

becomes

eval('$var("' . fetch_template

;)

Deaths 02-20-2005 04:58 PM

EDIT:
It just returns a blank page for me :-/.

Could you maybe post a brief example on how I should this code?

Thanks

deathemperor 02-21-2005 09:13 AM

print_output means after reading that line it will stop doing anything after that line to print out the template in its param.

so before print_output you just have to code:

eval('$something = "' . fetch_template('template_name') . '";');

just use it as many times as you want to create the templates, and of course it can only be used within the template feched by print_output.

hope I made myself clear.

Jolten 02-21-2005 09:46 AM

I'm assuming you have one template as a main container and your other templates would be internal nested templates....

Basically.. use
PHP Code:

eval('$var = "' fetch_template('template_name') . '";'); 

Throughout your code. Then in the main template include $var where you want the internal templates to appear. Then call the master template at the end of the php file with
PHP Code:

eval('print_output("' fetch_template ... 


Deaths 02-21-2005 06:14 PM

I understand the print_output part, as I am no noob to PHP.

What I did not understand, was if I have to define the $var, and if so, what should it contain, etc...

Zachery 02-21-2005 06:21 PM

Quote:

Originally Posted by Deaths
I understand the print_output part, as I am no noob to PHP.

What I did not understand, was if I have to define the $var, and if so, what should it contain, etc...

PHP Code:

eval('$var = "' fetch_template('template_name') . '";'); 


$var as in a $varible. like lets say you want to use the postbit template once

PHP Code:

eval('$postbit = "' fetch_template('postbit') . '";'); 

Now you can use $postbit in the template you are printing.

Guest190829 02-21-2005 07:01 PM

Quote:

Originally Posted by Deaths

What I did not understand, was if I have to define the $var, and if so, what should it contain, etc...

No, you don't have to define $var as it's being define with fetch templates as whatever template you want to use. As Zachery said you would then you $var in your "main" template.

Deaths 02-22-2005 08:51 AM

Quote:

Originally Posted by Zachery
PHP Code:

eval('$var = "' fetch_template('template_name') . '";'); 

$var as in a $varible. like lets say you want to use the postbit template once

PHP Code:

eval('$postbit = "' fetch_template('postbit') . '";'); 

Now you can use $postbit in the template you are printing.

Ah, I see.

So, basicly, in the main template, I can use the $var which I used to "fetch" the template?

I can't try it now, but I think I understood it, thanks.

Zachery 02-22-2005 01:23 PM

Quote:

Originally Posted by Deaths
Ah, I see.

So, basicly, in the main template, I can use the $var which I used to "fetch" the template?

I can't try it now, but I think I understood it, thanks.

Yeap :)


All times are GMT. The time now is 03:15 PM.

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.01026 seconds
  • Memory Usage 1,745KB
  • 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
  • (7)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete