Jump to content

Recommended Posts

Posted

Hi

We have some code to pull the airline logo for our recent flights board - but I would like to return the same for the live flight info. For some reason the same code does not work and instead of returning the airline logo it returns VTA as the answer all the time for every flight and displays the airline logo.

The code we use for the recent flight board is below and works fine. I have tried editing it but cannot find the solution. Should it be looking at the $PIREP data or something else? Like I say this code works on recent flights but not live flights.

<?php echo '<img class="img-responsive" src="'.fileurl('/airlines/'.$pirep->code.'.png').'" alt="'.$airline->name.'" />'; ?>

Thanks

Posted

Thanks for your response. That code did not work for us. We are not trying to input the logo on the live flight map bubble. We have a live flights board which we are trying to post it in. I have images below of the issue with the new code and also how it displays normally with the wrong logo.

logos%201_zpsqsh7gfda.jpg

With the old code you can see it looks for VTA.png for every flight instead of the airline icao .png

logo%202_zpscjzffs1o.jpg

Posted

The code for the recent flights is posted in the top of the thread. If you need anything more please let me know. It seens to return the VA icao VTA rather than the airline logo such as AAL

  • Moderators
Posted

No, I would need the code for the current flights in orderto check the variable you are using inorder toparse the data for the current flights section.

  • Members
Posted

first the code for the acars table is different than the pireps table

as you can see you have 2 flights

1 is AAL80

and

2 is SIA321

so what do you have to do is split the airline code from the flight number for example for

AAL80 will be a) AAL and b)80 and now you can use the code assumed you have it named AAL.png

that can be done with the included function

SchedulesData::getProperFlightNum(flightnumber)

so in your case it will be

$ProperFN=SchedulesData::getProperFlightNum($pirep->flightnum);

and to show the image

  <?php echo '<img class="img-responsive"  src="'.fileurl('/airlines/'.$ProperFN[code].'.png').'" alt="'.$airline->name.'" />'; ?>

  • 3 weeks later...
  • 1 month later...
Posted

Hi,

I tried making that change but it did not work. It still returns the same error. Sorry for the really late response for some reason I was not following the topic.

Thank you very much,

John Finberg

  • Members
Posted (edited)

Als you can paste your code here at the forum with the code tag so it will be easyer for us to help you

Here your code

Edited by Vangelis
Posted

Hi,

Here is the code I am using.

<?php
$ProperFN=SchedulesData::getProperFlightNum($flight->flightnum);
?>
<script type="text/html" id="acars_map_row">
<tr class="<%=flight.trclass%> table-data">
<td><a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a></td>
<td><%=flight.flightnum%></td>
<td><%=flight.depicao%></td>
<td><%=flight.arricao%></td>
<td><%=flight.phasedetail%></td>
<td><%=flight.alt%></td>
<td><%=flight.gs%>
</tr>
</script>

Thank you very much,

John Finberg

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...