WideroeVirtual Posted May 14, 2016 Report Share Posted May 14, 2016 I have the custom profile field for my pilots vatsim id, enabled on profile and during registration. But how do i add this to the roster? This is required by vatsim for partnership. Thank you! Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted May 14, 2016 Moderators Report Share Posted May 14, 2016 The code to show field values is, just add your own image name where it says "NAME OF YOUR IMAGE" <?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'vatsim id ); if( $fieldvalue != '' ) { echo '<a href="https://vataware.com/pilot/' . $fieldvalue . '" target="_blank"><img src="'.SITE_URL.'/NAME OF YOUR IMAGE" width="90" height="55" border="0" alt="Vatsim ID" /></a><br />Vatsim Stats' ; } else { echo 'Vatsim Stats<br />No Data Found'; } ?> Quote Link to comment Share on other sites More sharing options...
WideroeVirtual Posted May 14, 2016 Author Report Share Posted May 14, 2016 Never mind, i kind of figured out. But the whole page looks really ugly, and it does not say vatsim id on top of the roster page. Full pilots_list: <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> </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'); */ // To skip a retired pilot, uncomment the next line: //if($pilot->retired == 1) { continue; } ?> <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> <?php } ?> </tbody> </table> Quote Link to comment Share on other sites More sharing options...
WideroeVirtual Posted May 14, 2016 Author Report Share Posted May 14, 2016 The code to show field values is, just add your own image name where it says "NAME OF YOUR IMAGE" <?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'vatsim id ); if( $fieldvalue != '' ) { echo '<a href="https://vataware.com/pilot/' . $fieldvalue . '" target="_blank"><img src="'.SITE_URL.'/NAME OF YOUR IMAGE" width="90" height="55" border="0" alt="Vatsim ID" /></a><br />Vatsim Stats' ; } else { echo 'Vatsim Stats<br />No Data Found'; } ?> Where would i add this? (ref. the pilots_list i pasted above) Quote Link to comment Share on other sites More sharing options...
web541 Posted May 14, 2016 Report Share Posted May 14, 2016 <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'); */ // To skip a retired pilot, uncomment the next line: //if($pilot->retired == 1) { continue; } ?> <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> <?php } ?> </tbody> </table> 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.