HighFlyerPL185 Posted July 24, 2013 Report Posted July 24, 2013 I'd like to place an image above the data in the ACARS bubble, however I'd like it to detect and choose an image for the airline the flight is operated for. However, I'd only like to keep one airline in the system. I imagined it like, if the flight number is FE3XXX, the ACARS bubble would display one image, but if it's any other, for e.g. FEXXXX, it would display image of another airline. Quote
Administrators simpilot Posted July 28, 2013 Administrators Report Posted July 28, 2013 Just as an example, if you name the images the same as the first three digits of the schedule you can then reduce the flight number to those three digits and call the image using that. Maybe if you had a flight number of ABC1234 and had an image named ABC.jpg to use for all ABC flights something like this should work; <img src="your path to your image<?php substr($fligthnumberstring, 0, 3); ?>.jpg" alt="My Airline Image" /> Quote
HighFlyerPL185 Posted July 28, 2013 Author Report Posted July 28, 2013 Surely it needs some kind of an if/else statement though to display the image if this particular flight is that flight number, but how can I pick it up from the ACARS Map? Would something like this with the variable provided work or is it completely useless? if ( <%=flight.flightnum%> => FE0000 ) { Image. } elseif ( <%=flight.flightnum%> => FE3000 ) { Image } elseif ( <%=flight.flightnum%> => FE4000 ) { Image } if { <%=flight.flightnum%> Quote
Strider Posted July 29, 2013 Report Posted July 29, 2013 No you dont need an if else statement, as long as the code is the name of the image, then it will pick that image, and not another one. Quote
Administrators simpilot Posted July 29, 2013 Administrators Report Posted July 29, 2013 You will not need an if selector unless you are going to have an image for all flights and only a few odd numbered flights have something different. The example I set was to use the icao code basically to id what image you want displayed with the flight as that was what I thought you wanted. If you have an individual image for every flight this will also work as you will just have to name every image the same as the flight number, ie - you would have an image ABC1111.png for flight ABC1111 and an image named ABC2222.png for flight ABC2222, and so on. If you only have a couple of flights you want an alternate iimage for then yes, you can build an if selector. if($fligthnumberstring == 'ABC1111') { $image = 'ABC1111'; } elseif($fligthnumberstring == 'ABC2222') { $image = 'ABC2222'; }[/color] else { $image = 'mydefaultimge'; } Then <img src="your path to your image<?php echo $image; ?>.jpg" alt="My Airline Image" /> Quote
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.