News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

[NOT SOLVED] Getting profile fields value

Started by cddude, July 27, 2014, 03:34:57 PM

Previous topic - Next topic

cddude

Hello.

Trying to make a small little mod for my site. From display.template.php I'm trying to pull the value of the first custom profile field. I have tried this, but it doesn't work:
$message['member']['custom_fields']['value'][0]
How to do this?

Better yet, instead of getting the value from first custom profile field, how to do an if statement to get the value for the profile field where its' title == xxx?

Thanks!

cddude


samborabora

I believe it was something like:

foreach ($context['custom_fields'] as $field)
if($field['colname'] == "cust_*****")
echo (empty($field['value']) ? 'they ve said nothing' : $field['value']);


Where cust_***** is the name of the field, which can be found by Chrome inspecting the input field. Check this whole thread, it may be of help? http://www.simplemachines.org/community/index.php?topic=524970.0

Advertisement: