I am stuck again. I have this code which is for a custom module (Groups duplicate) in conjunction with the Sub-Profiles module:
/* this section checks logged in member to see if they are a sub-profile
or not. */
$aParent = mysql_query("SELECT * FROM `Profiles` WHERE `ID` = '" .
$_COOKIE['memberID'] . "'");
while ($row = mysql_fetch_array($aParent)) {
$parent_profile = $row["parent_profile"];
$parent_id = $row["ID"];
}
if ($parent_profile != "0") { /* If they are not a Sub-Profile creator, then get the sub-profile creators
ID number and list all sub-profiles created by that person. */
$aProviders = $GLOBALS['MySQL']->getPairs("SELECT `ID` ,
`NickName` FROM `Profiles` WHERE `parent_profile` = '$parent_profile'",
'NickName', 'NickName');
}
else { /* If they are Sub-Profile creator, then list all sub-profiles created by the logged in user. */
$aProviders = $GLOBALS['MySQL']->getPairs("SELECT `ID` ,
`NickName` FROM `Profiles` WHERE `ID` = '$parent_id' OR `parent_profile` =
'$parent_id'", 'NickName', 'NickName');
}
Then I have a form using the dolphin forms coding with this field:
'provider' => array(
'type' => 'select',
'values' => $aProviders,
'name' => 'provider',
'caption' => _t('_cf_clients_form_caption_provider_id'),
'required' => true,
'db' => array (
'pass' => 'Xss',
),
'display' => true,
),
As it is right now, it works. It retrieves the sub-profiles and then lists them in the select field.
But - I am asking for help because I need to display the sub-profiles as First Name and Last Name, not NickName (snapshot3). As you will notice in the last visible select field there is ProfessorSr74 - I want it to say Calvin Fowler.
I do have my advanced settings set to use First Name Last Name
Any help would be appreciated. Thanks in advance.