Help displaying Vatsim IDs

Could someone help me out please I am trying to get the vatsim id to be displayed here http://flyvva.org/index.php/pilots

The custom field is this Vatsim ID

and here is the .tpl I have

<h3><?php echo $title?></h3>

<?php
if(!$allpilots)
{
	echo 'There are no pilots!';
	return;
}
?>
<table width="100%" class="tablesorter" id="tabledlist">
<thead>
<tr>
<th>Pilot ID</th>
<th>Name</th>
<th>Vatsim ID</th>
<th>Rank</th>
<th>Flights</th>
    <th>Hours</th>
    </tr>
</thead>
<tbody>
<?php
foreach($allpilots as $pilot)
{
if($pilot->confirmed != 1)
    continue;
/* 
	To include a custom field, use the following example:

	<td>
		<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
	</td>

	For instance, if you added a field called "IVAO Callsign":

		echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');		
 */
?>
<tr>
<td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">
		<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>	</td>
<td>
	<img src="<?php echo Countries::getCountryImage($pilot->location);?>" 
		alt="<?php echo Countries::getCountryName($pilot->location);?>" />

	<?php echo $pilot->firstname.' '.$pilot->lastname?>	</td>
<td><?php echo PilotData::GetFieldValue($pilot->pilotid, 'Vatsim ID'); ?></td>

<td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
<td><?php echo $pilot->totalflights?></td>
    <td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
    <?php
}
?>
</tbody>
</table>

I too had an issue getting the Vatsim ID field to show.  Mine is named “vatsimid”.  In the end I had to add an extra field into the Pilot table, manually add vatsim ids from their registration, and call it within the pilot roster - not a good workaround, but works nonetheless.

Hi Piper,

you need also declare a new varible in the beginning:

<tr>

  <th>Pilot ID</th>

  <th>Name</th>

  <th>Vatsim ID</th>

  <th>Rank</th>

  <th>Flights</th>

    <th>Hours</th>

    <th>VATSIM ID</th>

    </tr>

it should work then.

But i have another question. I want to connect the vatsim id with the vataware website:

http://www.vataware.com/pilot.cfm?cid=

after the = there should be the vatsim id from the database.

Like i did it always in php it wouldn’t work here.

Has anyone an idea how to link a variable to an URL.

Thanks alot.

Mark

Hi Mark

With my silly fix above lol, my code is:

<td><a href="http://www.vataware.com/pilot.cfm?cid=<?php echo $pilot->vatsimid?>"><?php echo $pilot->vatsimid?></a></td>

Change $pilot->vatsimid to whatever you use to display the vatsim id on the page.

Hi Will,

i got it now running with this:

<td><a href="http://www.vataware.com/pilot.cfm?cid=<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID');?>" target=_blank><?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID');?></a></td>

and the standard custom fields.

Thanks alot for the hint.

Mark

Hi Mark

That’ll do it .  Thanks as well for reminding me about the missing “target=_blank” on mine!

Hey guys thanks for trying to help me, but I still cant get it through my head what/Where I need to Edit the following.

I added

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

as that is what is commented to do…

<h3><?php echo $title?></h3>

<?php
if(!$allpilots)
{
	echo 'There are no pilots!';
	return;
}
?>
<table id="tabledlist" class="tablesorter">
<thead>
<tr>
<th>Pilot ID</th>
<th>Name</th>
<th>Rank</th>
<th>Flights</th>
<th>Hours</th>
    <th>VATSIM ID</th>
</tr>
</thead>
<tbody>
<?php
foreach($allpilots as $pilot)
{
/* 
	To include a custom field, use the following example:

	<td>
		<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
	</td>

	For instance, if you added a field called "IVAO Callsign":

		echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');		
 */
?>
<tr>
<td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">
		<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>
</td>
<td>
	<img src="<?php echo Countries::getCountryImage($pilot->location);?>" 
		alt="<?php echo Countries::getCountryName($pilot->location);?>" />

	<?php echo $pilot->firstname.' '.$pilot->lastname?>
</td>
<td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
<td><?php echo $pilot->totalflights?></td>
<td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
    <td><?php echo PilotData::GetFieldValue($pilot->pilotid, 'Vatsim ID')?></td>
    </tr>
<?php
}
?>
</tbody>
</table>

Hey guys, here is what the field looks like inside phpMyadmin if it helps http://i49.tinypic.com/1zpi2jt.jpg

Also where are the actual numbers stored I cant find it.. maybe that is the problem?

Try it with all caps, you’re doing:

“Vatsim ID”

Which won’t match “VATSIM ID”.

Hey Nabeel, I have tried that before I just did it again for giggles and no joy :frowning:

in the admin center it is “Vatsim ID”

Check in the phpvms_fieldvalues table and see if there are any values with fieldid 7 that have any data in the value column. That is where the code will ultimatly pull the data from.

How about trying VATSIM_ID?

simpilot, thats what I was looking for 7 doesn’t even exist in there so that must be my problem goes from 6 to 8

Well in the fields table look up the ID for vatsim id

It’s 7

Hey guys, here is what the field looks like inside phpMyadmin if it helps http://i49.tinypic.com/1zpi2jt.jpg

Also where are the actual numbers stored I cant find it.. maybe that is the problem?

<h3><?php echo $title?></h3>
<h5>O Piloto sĂł aparecera na lista Abaixo, ApĂłs ter completado 01:00 Hs (UMA HORA) de voo na VA, dĂşvidas contate um Staff !!!<h5>
<h5>
  <?php
if(! $allpilots )
{
    echo 'There are no pilots!' ;
    return;
}
?>
</h5>
<table id="tabledlist" class="tablesorter" width="800">
<tbody>
  <tr>
    <td width="23%" height="0" colspan="2" align="CENTER"><table id="tabledlist2" class="tablesorter" width="800">
      <thead>
        <tr>
          <th width="60" align="center">Piloto ID</th>
          <th width="30" align="center">Pais</th>
          <th width="138" align="center">Nome</th>
          <th width="69" align="center">Rank</th>
          <th width="40" align="center">Voos</th>
          <th width="50" height="0" align="center">Horas</th>
          <th width="181" height="45" align="CENTER">IVAO ID</th>
          <th width="192" height="45" align="CENTER">VATSIM ID</th>
        </tr>
      </thead>
      <tbody>
        <?php
foreach( $allpilots as $pilot )
{
?>
        <tr>
          <td width="60" align="center" nowrap><a href="<?php echo SITE_URL?>/index.php/profile/view/<?php echo $pilot->pilotid?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a></td>
          <td width="30" align="center"><img src="<?php echo Countries::getCountryImage($pilot->location);?>" 
		alt="<?php echo Countries::getCountryName($pilot->location);?>" /></td>
          <td width="138" align="center"><?php echo $pilot->firstname.' '.$pilot->lastname?></td>
          <td width="69" align="center"><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
          <td width="40" align="center"><?php echo $pilot->totalflights?></td>
          <td width="50" height="0" align="center"><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
          <td width="181" height="45" align="CENTER"><?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'IVAO ID' );
if( $fieldvalue != '' )
{
echo '<a href="http://www.ivao.aero/members/person/details.asp?ID='. $fieldvalue . '" target="_blank"><img src="http://status.ivao.aero/'. $fieldvalue .'.png" width="180" height="45" border="0" alt="Ivao ID" /></a>' ;
}
?>
            <div align="center"></div></td>
          <td width="192" height="45" align="CENTER"><?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'VATSIM ID' );
if( $fieldvalue != '' )
{
echo '<a href="http://www.vataware.com/pilot.cfm?cid=' . $fieldvalue . '" target="_blank"><img src="http://online.vatsimindicators.net/'. $fieldvalue .'/3453.png" width="180" height="45" border="0" alt="Ivao ID" /></a></a>' ;
}
?>
            <?php
}
?></td>
          
        </tr>
      </tbody>
    </table>    
</tbody>
</table>

en

good luck

br

boa sorte

It’s 7

Ok so look like no values have been saved. What if you goto your profile now and save a value for that field, do you see it show up in phpmyadmin?

Not still no joy,  I am able to view the pilots Vatsim ID in the admin center… but I don’t understand how if it’s not saving it to the database.

Can you enable DEBUG_MODE (set to true), and then try saving the field, and see if there’s anything in core/logs/log.txt?

tried it, log.txt is still empty