Jump to content

How do I access custom fields data externally?


Vikestart

Recommended Posts

First offf, great idea making this section :D

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? :)

Link to comment
Share on other sites

Just in case someone wants to know how to access a specific profile field, I'll post it here :D

$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! :)

Link to comment
Share on other sites

  • 2 months later...

 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 :D

$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 :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...