Jump to content

Live Flights Airline Logo


Soundman9

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Members

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.'" />'; ?>

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

I have a similar problem. I want to put up the logos of the airlines that are currently flying. I have tried using this code but it is trying to show, "http://sta-va.com/airlines/.png" not with airline name in it. Is it that I have put the code in wrong?

Thank you very much,

John Finberg

Code: https://gyazo.com/af10ada27e9e0e5c7eed7c5f36fa8c53

Page: https://gyazo.com/33364823e54f9a5c7639fce2b45818b3

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

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