vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to use a variable from one template in another template? (https://vborg.vbsupport.ru/showthread.php?t=207294)

Illthis 03-04-2009 07:37 AM

How to use a variable from one template in another template?
 
Hello,
i tried to use the Picture ($blocks[profile_picture]) from the MEMBERINFO template in the template NAVBAR. Unfortunately the picture will only be included if i am on the site MEMBERINFO.
I have this problem with several other templates/variables

How can i use such variables globally and not only in one template?

thanks alot

Marco van Herwaarden 03-04-2009 08:00 AM

Variables are defined in a php-script (or plugin) and used in templates. You can only use variable that are defined in the script that calls the template.

Illthis 03-04-2009 05:34 PM

Thanks,
where can i find the scripts which call the templates?
or in my case, where can i find the script that calls the navbar template

if there is a tutorial for this a link would be sufficient. unfortunately i didnt find an answer to that in the documentation

thanks again

--------------- Added [DATE]1236197534[/DATE] at [TIME]1236197534[/TIME] ---------------

well ok its the script shown in my browser adressbar i assume :-)

but now im stuck with defining the variable for the profile_picture

i did find the array list in my member.php
$globaltemplates = array(
'MEMBERINFO',

and so on



but where is the declaration?

which parts of the code do i have to implement in my index.php to be able to use the profilepicture in my index.php respectively all the other scripts i want to be able to see the user picture

Dismounted 03-05-2009 05:02 AM

So what you want to do is to display a user's profile picture in the navbar?

Illthis 03-09-2009 09:00 AM

yes


All times are GMT. The time now is 06:30 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.01130 seconds
  • Memory Usage 1,710KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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