Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 02-20-2005, 04:54 PM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default "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
Reply With Quote
  #2  
Old 02-20-2005, 04:57 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Deaths
eval('print_output("' . fetch_template
becomes

eval('$var("' . fetch_template

Reply With Quote
  #3  
Old 02-20-2005, 04:58 PM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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

Thanks
Reply With Quote
  #4  
Old 02-21-2005, 09:13 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 02-21-2005, 09:46 AM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ... 
Reply With Quote
  #6  
Old 02-21-2005, 06:14 PM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #7  
Old 02-21-2005, 06:21 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 02-21-2005, 07:01 PM
Guest190829
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #9  
Old 02-22-2005, 08:51 AM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 02-22-2005, 01:23 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:51 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04428 seconds
  • Memory Usage 2,256KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (7)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (9)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete