# pilots list code onto profile file?

**URL:** <https://forum.phpvms.net/t/pilots-list-code-onto-profile-file/2950>\
**Category:** Development Help\
**Created:** [July 1, 2010, 8:45pm UTC](https://forum.phpvms.net/t/pilots-list-code-onto-profile-file/2950 "2010-07-01T20:45:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas](https://forum.phpvms.net/user_avatar/forum.phpvms.net/thomas/32/35_2.png) [@Thomas](https://forum.phpvms.net/u/Thomas)\
**Post date:** [July 1, 2010, 8:45pm UTC](https://forum.phpvms.net/t/pilots-list-code-onto-profile-file/2950/1 "2010-07-01T20:45:09Z")

</div>

Hey Guys,

So, If you go into your admin panel where you can create custom fields you can mirror them so they show on your pilots\_list.tpl, So if i made a field called “Vatsim ID” and I used this code;

```
<?php echo PilotData::GetFieldValue($pilot->pilotid, 'Vatsim ID'); ?>

```

It would show on my Pilot Roser/List.

However, I was messing around and wondering if their is any way I can make it so I can have a custom field on my pilot\_public\_profile.tpl page without using the following code;

```
<?php

// Show the public fields

    if($allfields)
  {
    foreach($allfields as $field)
  {
    echo "<li><strong>$field->title: </strong>$field->value</li>";
  }
}
?>

```

I want it so instead of showing ALL of the custom fields It would only show the ones I want. I know that you can choose in the admin panel to not show certain fields on the Pilot’s profile however I still need this code

I thought something like this might of done it but it messed up my site

```
<?php echo PilotData::GetFieldValue($pilot->userinfo, 'Vatsim ID'); ?>

```

Cheers,

Thomas.

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [July 2, 2010, 7:01pm UTC](https://forum.phpvms.net/t/pilots-list-code-onto-profile-file/2950/2 "2010-07-02T19:01:50Z")

</div>

instead of

```
<?php echo PilotData::GetFieldValue($pilot->userinfo, 'Vatsim ID'); ?>

```

try

```
<?php echo PilotData::GetFieldValue($userinfo->pilotid, 'Vatsim ID'); ?>

```

---

<div class="post-metadata">

**Author:** ![Thomas](https://forum.phpvms.net/user_avatar/forum.phpvms.net/thomas/32/35_2.png) [@Thomas](https://forum.phpvms.net/u/Thomas)\
**Post date:** [July 2, 2010, 7:05pm UTC](https://forum.phpvms.net/t/pilots-list-code-onto-profile-file/2950/3 "2010-07-02T19:05:43Z")

</div>

Yeah, That worked, Thanks Simpilot! +5
