Okay, So I use jantorre (thanks!) custom charts database code which is:
<h3>Procedures and Information</h3>
<table width="98%" align="center">
<tr style="background-color: #333; color: #FFF;">
<td>Charts for <?php echo $schedule->depicao?></td>
<td>Charts for <?php echo $schedule->arricao?></td>
</tr>
<tr align="center">
<td width="50%" valign="top">
<a href="<?php $data = OperationsData::GetAirportInfo($schedule->depicao); echo $data->chartlink; ?>" target="_blank">
<img border="0" src="http://www.yoursite.com/images/charts/<?php echo $schedule->depicao?>.gif"
width="387px" height="594px" alt="No chart available" /></a><br>
<a href="<?php $data = OperationsData::GetAirportInfo($schedule->depicao); echo $data->vacc; ?>" target="_blank">Local VACC</a>
</td>
<td width="50%" valign="top">
<a href="<?php $data = OperationsData::GetAirportInfo($schedule->arricao); echo $data->chartlink; ?>" target="_blank">
<img border="0" src="http://www.yoursite.com/images/charts/<?php echo $schedule->arricao?>.gif"
width="387px" height="594px" alt="No chart available" /></a><br>
<a href="<?php $data = OperationsData::GetAirportInfo($schedule->arricao); echo $data->vacc; ?>" target="_blank">Local VACC</a>
</td>
</tr>
</table>
And everything works great but i need it to work for both .png and .gif .
So Lorathon (Big Thanks!) wrote a small piece of code to help me out.
public function displayChart($icao)
{
$chart = SITE_ROOT.'/images/charts/'.$icao.'.png';
if(!file_exists($chart))
{
// PNG image Does NOT exist so look for GIF image
$chart = SITE_ROOT.'/images/charts/'.$icao.'.gif';
if(!file_exists($chart))
{
// GIF image does not exist either
return false;
}
}
// Return image path
return $chart;
}
And suggested to insert it like so in schdule_brief.tpl
<h3>Procedures and Information</h3>
<table width="98%" align="center">
<tr style="background-color: #333; color: #FFF;">
<td>Charts for <?php echo $schedule->depicao?></td>
<td>Charts for <?php echo $schedule->arricao?></td>
</tr>
<tr align="center">
<td width="50%" valign="top">
<a href="<?php $data = OperationsData::GetAirportInfo($schedule->depicao); echo $data->chartlink; ?>" target="_blank">
<img border="0" src="<?php echo self::displayChart($schedule->depicao)?>"
width="387px" height="594px" alt="No chart available" /></a><br>
<a href="<?php $data = OperationsData::GetAirportInfo($schedule->depicao); echo $data->vacc; ?>" target="_blank">Local VACC</a>
</td>
<td width="50%" valign="top">
<a href="<?php $data = OperationsData::GetAirportInfo($schedule->arricao); echo $data->chartlink; ?>" target="_blank">
<img border="0" src="<?php echo self::displayChart($schedule->arricao)?>"
width="387px" height="594px" alt="No chart available" /></a><br>
<a href="<?php $data = OperationsData::GetAirportInfo($schedule->arricao); echo $data->vacc; ?>" target="_blank">Local VACC</a>
</td>
</tr>
</table>
<?php
public function displayChart($icao)
{
$chart = SITE_ROOT.'/images/charts/'.$icao.'.png';
if(!file_exists($chart))
{
// PNG image Does NOT exist so look for GIF image
$chart = SITE_ROOT.'/images/charts/'.$icao.'.gif';
if(!file_exists($chart))
{
// GIF image does not exist either
return false;
}
}
// Return image path
return $chart;
}
?>
And I’m getting : Parse error: syntax error, unexpected T_PUBLIC in /home/brtvirtu/public_html/lib/skins/ObsessBlue/schedule_briefing.tpl on line 140
And line 140 is
public function displayChart($icao)
Please Help! Or suggest something else
Thanks!