Artjom Posted May 4, 2010 Report Share Posted May 4, 2010 Hello everyone, how to make that conclusion was by a single field, rather than all at once each? core/templates/profile_edit.tpl <?php if($customfields) { foreach($customfields as $field) { echo '<dt>'.$field->title.'</dt> <dd>'; if($field->type == 'dropdown') { $field_values = SettingsData::GetField($field->fieldid); $values = explode(',', $field_values->value); echo "<select name=\"{$field->fieldname}\">"; if(is_array($values)) { foreach($values as $val) { $val = trim($val); if($val == $field->value) $sel = " selected "; else $sel = ''; echo "<option value=\"{$val}\" {$sel}>{$val}</option>"; } } echo '</select>'; } elseif($field->type == 'textarea') { echo '<textarea class="customfield_textarea"></textarea>'; } else { echo '<input type="text" name="'.$field->fieldname.'" value="'.$field->value.'" />'; } echo '</dd>'; } } ?> Example: not so PROFILE SETTINGS VATSIM ID VATSIM NAME YOUR SYSTEM but so PROFILE SETTINGS YOUR SYSTEM VATSIM SETTINGS VATSIM ID VATSIM NAME This code isn't work... <?php $customfield = SettingsData::GetField ($field->fieldid , 'VATSIM_NAME' ); {echo '<input type="text" name="VATSIM_NAME" value="'.$field->value.'" />' ;}?> Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 5, 2010 Administrators Report Share Posted May 5, 2010 I think it's SettingsData::getFieldValue - check the API docs, I can't remember off the top of my head Quote Link to comment Share on other sites More sharing options...
Artjom Posted May 5, 2010 Author Report Share Posted May 5, 2010 I think it's SettingsData::getFieldValue - check the API docs, I can't remember off the top of my head Thank you, This code works <?php echo '<dt>VATSIM ID</dt> <dd>'; $customfield = PilotData::GetFieldValue ($userinfo->pilotid , 'VATSIM ID' ); { echo '<input type="text" name="VATSIM ID" value="'.$customfield.'" />' ; } echo '</dd>'; ?> 1 Quote Link to comment Share on other sites More sharing options...
KDTeam Posted May 13, 2010 Report Share Posted May 13, 2010 Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.