Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2005, 08:54 PM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default {$vbulletin->userinfo[variable]} STUFF

Okay... I've got a few questions...

Question 1
How can I use {$vbulletin->userinfo[variable]} in <if condition> statements? When I put that in there, I get an error saying I can't do that. So how would I do it?

Question 2
Why doesn't {$vbulletin->userinfo[signature]} let bb code work? I'm making a custom page without using an actual php file and I was told that {$vbulletin->userinfo[variable]} should pull everything. However, when I use {$vbulletin->userinfo[signature]}, it pulls exactly what's there. ie: [img]sadfsad[/img]

Question 3
Why doesn't <img src="{$vbulletin->userinfo[avatarurl]}"> work? Is there something else I can use to make it work?

HELP ME!!!
Reply With Quote
  #2  
Old 12-23-2005, 09:28 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1) Use $vbulletin->userinfo['variable'] in conditions, you dont need {}.

2) You need to initialise a bbcode parser class and parse the signature field.

3) You need to use fetch_userinfo with a specific option to join the avatar table before having it available.
Reply With Quote
  #3  
Old 12-23-2005, 09:40 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should use $bbuserinfo['whatever'] in templates - $vbulletin is not within the scope everywhere.
Reply With Quote
  #4  
Old 12-23-2005, 09:43 PM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't use that. I tried using that and it didn't work. When I showed it all to Marco, he told me to use {$vbulletin->userinfo[variable]}. >_> Then it all started working for the most part.


Quote:
Originally Posted by merk
1) Use $vbulletin->userinfo['variable'] in conditions, you dont need {}.

2) You need to initialise a bbcode parser class and parse the signature field.

3) You need to use fetch_userinfo with a specific option to join the avatar table before having it available.
Are number 2 and 3 possible without creating a php file?
Reply With Quote
  #5  
Old 12-24-2005, 12:05 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could possibly do 2/3 in hooks.

Andreas: I wasnt aware you could use $bbuserinfo inside the conditional statements. Are you saying that the template code converts $bbuserinfo into the proper "variable" for different scopes? (for both variables in templates and conditionals?)
Reply With Quote
  #6  
Old 12-24-2005, 12:06 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm almost 100% positive it doesn't. Marco and I worked with it before.
Reply With Quote
  #7  
Old 12-24-2005, 12:36 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$$bbuserinfo should always work in templates.
Reply With Quote
  #8  
Old 12-24-2005, 12:40 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was messing with the usercp template. When I tried using $bbuserinfo, it wouldn't work for me.
Reply With Quote
  #9  
Old 12-24-2005, 01:13 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@merk
replace_template_variables()
Basically it does $bbuserinfo => $GLOBALS['vbulletin']->userinfo, etc.
Reply With Quote
  #10  
Old 12-24-2005, 04:31 PM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

> initialise a bbcode parser class and parse the signature field
> use fetch_userinfo with a specific option to join the avatar table

How would I make hooks for these? I know how to make hooks... but what would I put in the hooks to make it work in the template?

I mean... there are several things not showing up... but at least this would give me an idea. Join date, referrals, messenger icons, etc are all not showing up. It hates me.
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 12:58 PM.


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.07557 seconds
  • Memory Usage 2,248KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete