Vikestart Posted March 4, 2015 Posted March 4, 2015 First offf, great idea making this section I've got the following code to pull member data to an external website: global $member; require_once($_SERVER['DOCUMENT_ROOT'] . '/forums/init.php'); \IPS\Session\Front::i(); $member = \IPS\Member::loggedIn(); And it works fine. print_r($member); outputs a lot of useful information. However, I can't seem to find the information for custom profile fields. Where is this located, and how do you pull it?
newbie LAC Posted March 4, 2015 Posted March 4, 2015 Hello,$member->profileFieldsreturn array with custom fields and groups
Vikestart Posted March 4, 2015 Author Posted March 4, 2015 Thanks for the answer However, I tried the following: $member_fields = $member->profileFields; print_r($member_fields); And it doesn't return anything.
Ryan Ashbrook Posted March 4, 2015 Posted March 4, 2015 It's a method, actually. Try:$member_fields = $member->profileFields(); print_r( $member_fields );
Vikestart Posted March 4, 2015 Author Posted March 4, 2015 It's a method, actually. Try: $member_fields = $member->profileFields(); print_r( $member_fields ); Yup, that worked! Thanks a lot!
Vikestart Posted March 5, 2015 Author Posted March 5, 2015 Just in case someone wants to know how to access a specific profile field, I'll post it here $member_pf = $member->profileFields(); echo $member_pf['core_pfieldgroups_3']['core_pfield_11']; As an example, that would echo the value of field 11, from within the 3rd field group. Thanks!
Maudit Posted May 18, 2015 Posted May 18, 2015 Hallo Vikestart, I'm new in IPB and not very good with php, I try to change the display of search user to add some custom field added to profile, here: core>front>search>member how could add this code in this format? Just in case someone wants to know how to access a specific profile field, I'll post it here $member_pf = $member->profileFields(); echo $member_pf['core_pfieldgroups_3']['core_pfield_11']; As an example, that would echo the value of field 11, from within the 3rd field group. Thanks! Thanks for helping
Recommended Posts
Archived
This topic is now archived and is closed to further replies.