vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How can I access a custom profile field in forumdisplay.php? (https://vborg.vbsupport.ru/showthread.php?t=245460)

BirdOPrey5 06-28-2010 07:09 PM

How can I access a custom profile field in forumdisplay.php?
 
Is this even possible? Basically I made an IF statement saying
PHP Code:

if  ($post[field5] == "Yes")
   Do 
Something... 

also tried it with single quotes around 'field5' but in neither case does the if statement ever become true even when I know Field5 is a Yes/No option box and set to "Yes" exactly.

Is there someway of accessing the custom field from the php file?:confused:

Any help is much appreciated.

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

Also tried $bbuserinfo but no go either.

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

OK got it working 2 ways...

$vbulletin->userinfo[field5]
and
$vbulletin->userinfo['field5']

My question is now- which is the 'proper' way to code it for maximum compatibility- is there a difference?

erdiyilmaz 03-02-2011 02:37 PM

i tried to show custom fields in forumdisplay template but i couldn't :(

when i tried: $vbulletin->userinfo[field5] there was seemed "Array[field5]"

how can i use custom fields in forumdisplay template?

BirdOPrey5 03-02-2011 03:18 PM

What type of field is field 5?

Lynne 03-02-2011 05:29 PM

If in a plugin, you use $vbulletin->userinfo[fieldx] to grab fieldx for the viewer.

If in a template, you use $bbuserinfo[fieldx] to grab fieldx for the viewer.

erdiyilmaz 03-03-2011 06:12 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2168741)
What type of field is field 5?

single row text field

Quote:

Originally Posted by Lynne (Post 2168785)
If in a plugin, you use $vbulletin->userinfo[fieldx] to grab fieldx for the viewer.

If in a template, you use $bbuserinfo[fieldx] to grab fieldx for the viewer.

when i use $bbuserinfo[fieldx]; it works. but only internet explorer, in firefox doesn't. have you got any suggestions?

Lynne 03-03-2011 05:06 PM

You would have to post your exact code in order for us to figure out why it isn't working.


All times are GMT. The time now is 06:54 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.01059 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
  • (2)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