Pulling a custom profile field from the database actually takes a lot more steps.. here is a quick guide.
Your first step is to require all this loading stuff:
require_once( ROOT_PATH.'sources/classes/class_custom_fields.php' );
$this->custom_fields = new custom_fields( $this->ipsclass->DB );
$this->custom_fields->member_id = $this->ipsclass->member['id'];
$this->custom_fields->cache_data = $this->ipsclass->cache['profilefields'];
$this->custom_fields->admin = intval($this->ipsclass->member['g_access_cp']);
$this->custom_fields->supmod = intval($this->ipsclass->member['g_is_supmod']);
Now you have an object called $this->custom_fields that will help us get the data we need. Note that for the above to have worked, we needed the 'profilefields' cache loaded, and we need to have certain member data loaded.
Alright.. now the messy part.
$this->custom_fields->member_data = array();
$this->custom_fields->mem_data_id = $member['id'];
$this->custom_fields->member_data = $member;
$this->custom_fields->admin = intval($this->ipsclass->member['g_access_cp']);
$this->custom_fields->supmod = intval($this->ipsclass->member['g_is_supmod']);
$this->custom_fields->member_id = $this->ipsclass->member['id'];
$this->custom_fields->init_data();
$this->custom_fields->parse_to_view( 1 );
if ( count( $this->custom_fields->out_fields ) )
{
foreach( $this->custom_fields->out_fields as $i => $data )
{
if ( $data )
{
$member['custom_fields'] .= "\n".$this->custom_fields->method_format_field_for_topic_view( $i );
}
}
}
We are assuming here you have an array called $member that contains all the really important data for the member we are loading the custom profile data for. It needs to at least contain that member's row in ibf_pfields_data (or whatever that table is called). I can't recall exactly how much information it needs, but you can always open class_custom_fields.php and take a look around.
See if that helps any.