PDA

View Full Version : How can I access a custom profile field in forumdisplay.php?


BirdOPrey5
06-28-2010, 07:09 PM
Is this even possible? Basically I made an IF statement saying

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 1277756882 at 1277756882 ---------------

Also tried $bbuserinfo but no go either.

--------------- Added 1277772863 at 1277772863 ---------------

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
What type of field is field 5?
single row text field

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.