Jump to content

Code to show IVAO status image in roster


Strider

Recommended Posts

Here is the code for the IVAO status image in the roster:

$feildvalue = PilotData::GetFieldValue($pilot->pilotid, 'IVAO ID');

if($feildvalue != '')
{
echo '<img src="http://status.ivao.aero/R/'.$feildvalue.'.png">';
}

Place it in your pilots_list.tpl, and save it to your skin folder.

Change the IVAO ID to what ever it is in your database. You can use the correct spelling for feildvalue to what you want, you can even change it to another name if you like.

  • Like 1
Link to comment
Share on other sites

  • 6 months later...
  • 1 year later...

Here is the code for the IVAO status image in the roster:

$feildvalue = PilotData::GetFieldValue($pilot->pilotid, 'IVAO ID');

if($feildvalue != '')
{
echo '<img src="http://status.ivao.aero/R/'.$feildvalue.'.png">';
}

Place it in your pilots_list.tpl, and save it to your skin folder.

Change the IVAO ID to what ever it is in your database. You can use the correct spelling for feildvalue to what you want, you can even change it to another name if you like.

Remplace echo '<img src="http://status.ivao.aero/R/'.$feildvalue.'.png">'; to echo '<img src="http://status.ivao.aero/R/'.$fieldvalue.'.png">';

it had a little mistake

thanks

Link to comment
Share on other sites

  • 3 months later...

It's not working here, someone can help me please ??

Thanks !!

It's my code.

<?php

ini_set('display_errors', 0 );

error_reporting(0);

?>

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>

<style type="text/css">

<!--

.style3 {color: #FFFFFF; font-size: 12px; }

.style4 {font-size: 12px}

.style5 {color: #FF0000}

-->

</style>

<h3 align="center">

<?php

if(!$pilot_list) {

echo 'There are no pilots!';

return;

}

?>

</h3>

<div align="center">

<table width="678" height="64" class="" id="">

<thead>

<tr>

<th bgcolor="#FF0000"><div align="center"><span class="style3">Matricula</span></div></th>

<th bgcolor="#FF0000"><div align="center"><span class="style3">Nome</span></div></th>

<th bgcolor="#FF0000"><div align="center"><span class="style3">Cargo</span></div></th>

<th bgcolor="#FF0000"><div align="center"><span class="style3">Horas Voadas</span></div></th>

<th bgcolor="#FF0000"><div align="center"><span class="style3">IVAO</span></div></th>

</tr>

</thead>

<tbody>

<?php

foreach($pilot_list 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><div align="center"><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>" class="style4">

<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </div></td>

<td>

<div align="center"><span class="style4"><?php echo $pilot->firstname.' '.$pilot->lastname?> </span><span class="style4"><img src="<?php echo Countries::getCountryImage($pilot->location);?>"

alt="<?php echo Countries::getCountryName($pilot->location);?>" /></span></div></td>

<td><div align="center"><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></div></td>

<td><div align="center"><span class="style4"><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></span></div></td>

<td><div align="center">$feildvalue = PilotData::GetFieldValue($pilot->pilotid, 'VID_IVAO');

if($feildvalue != '')

{

echo '<img src="http://status.ivao.aero/R/'.$feildvalue.'.png">';

}</div></td>

<?php

}

?>

</tbody>

</table>

</div>

post-350-0-93884600-1434027444_thumb.png

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...