SkilledPilotA320 Posted October 7, 2012 Report Posted October 7, 2012 Hello there I am trying to place Airline logo on Flight Stats, but i am unable to, can any one help me out plz I tried using this code <img src="<?php echo fileurl('/lib/images/airlines/'.$airline->icao.'.gif'); ?>" alt="<?php echo $airline->name;?>" /> I have two airlines, Air India (AIC) & Air India Express (AXB). Thanx!! Quote
Moderators Parkho Posted October 7, 2012 Moderators Report Posted October 7, 2012 Your code should be fine and view the images but you may want to try changing "fileurl" to "SITE_URL" and see if it does make any differences. Also, make sure that you're directing to the correct path of the image. Quote
SkilledPilotA320 Posted October 7, 2012 Author Report Posted October 7, 2012 still not working, can u give me the full code? images location http://airindiavirtu...irlines/AXB.gif http://airindiavirtu...irlines/AIC.gif Quote
Moderators Parkho Posted October 7, 2012 Moderators Report Posted October 7, 2012 Okay. Where do you use the $airline->icao? You gotta have something like below: <?php $airlines = OperationsData::getAllairlines(); foreach($airlines as $airline) { ?> <img src="<?php echo fileurl('/lib/images/airlines/'.$airline->icao.'.gif'); ?>" alt="<?php echo $airline->name;?>" /> <?php } ?> Quote
SkilledPilotA320 Posted October 8, 2012 Author Report Posted October 8, 2012 Bro, its still not working Check whether my code is correct <META HTTP-EQUIV="refresh" CONTENT="30"> <div style="position:relative"><h1>Flight Stats</h1> <p style="text-align: right; position:absolute; right:5px;top:0;"><strong>Share</strong><span class='st_blogger' ></span><span class='st_twitter' ></span><span class='st_facebook' ></span><span class='st_yahoo' ></span><span class='st_email' ></span></p> </div> <img alt="" border="1" height="136" src="http://www.airindiavirtual.com/images/flightstats_pg.jpg" width="950" /></p> <h3> Live Flight Departure/Arrival Board</h3> <table width="100%" cellspacing="0" cellpadding="4"> <tr class="title-row"> <th width="105">Airline</th> <th width="77"> Flight #</th> <!--<img src="http://airindiavirtual.com/lib/skins/aivirtual/images/logo.png"><th width="50" " height="22" background="" class="style1"><span class="tablesorterBIS"> <div align="center"> Aircraft</span></th>--> <th width="200">Depart</th> <th width="200">Arrival</th> <th width="80">Status</th> </tr> <?php $rowCounter = 1; ?> <?php $results = ACARSData::GetACARSData(); if (count($results) > 0) { foreach($results as $row) { $font = "<font color=''>"; // Standard font color if nothing below is TRUE if($row->phasedetail == 'Boarding') $font = "<font color='#2ba600'>"; //This should set the font color to red when Taxiing. if($row->phasedetail == 'Landed') $font = "<font color='#FFBF00'>"; //This should set the font color to red when Taxiing. if($row->phasedetail == 'En Route') $font = "<font color='#2A7F00'>"; //This should set the font color to green when Cruise. if($row->phasedetail == 'Departed') $font = "<font color='#FF0000'>"; //This should set the font color to red when Taxiing. if($row->phasedetail == 'Approach') $font = "<font color='#690d0d'>"; //This should set the font color to green when Cruise. if($row->phasedetail == 'Arrived') $font = "<font color='#e13838'>"; //This should set the font color to red when Taxiing. // You can add more checks here for whatever you wish ?> <tr class="listingTable <?php if( ($rowCounter % 2) == 0 ){ echo ' evenCol'; } $rowCounter++; ?>"> <td align="center"><img src="<?php echo fileurl('/lib/images/airlines/'.$airline->icao.'.gif'); ?>" alt="<?php echo $airline->name;?>" /></td> <td align="center"><?php echo $row->flightnum;?></td> <!--<td align="center"><?php echo $row->aircraftname;?></td>--> <td align="center"><?php echo $row->depname;?></td> <td align="center"><?php echo $row->arrname;?></td> <td align="center"><?php echo $font.$row->phasedetail;?></td> </tr> <?php } } ?> </table> <?php if(!$results) { echo '<p align="center">No Online Flights Scheduled!</p>'; return; } ?> Quote
Moderators Parkho Posted October 8, 2012 Moderators Report Posted October 8, 2012 Try this: <META HTTP-EQUIV="refresh" CONTENT="30"> <div style="position:relative"><h1>Flight Stats</h1> <p style="text-align: right; position:absolute; right:5px;top:0;"><strong>Share</strong><span class='st_blogger' ></span><span class='st_twitter' ></span><span class='st_facebook' ></span><span class='st_yahoo' ></span><span class='st_email' ></span></p> </div> <img alt="" border="1" height="136" src="http://www.airindiavirtual.com/images/flightstats_pg.jpg" width="950" /></p> <h3> Live Flight Departure/Arrival Board</h3> <table width="100%" cellspacing="0" cellpadding="4"> <tr class="title-row"> <th width="105">Airline</th> <th width="77"> Flight #</th> <!--<img src="http://airindiavirtual.com/lib/skins/aivirtual/images/logo.png"><th width="50" " height="22" background="" class="style1"><span class="tablesorterBIS"> <div align="center"> Aircraft</span></th>--> <th width="200">Depart</th> <th width="200">Arrival</th> <th width="80">Status</th> </tr> <?php $rowCounter = 1; ?> <?php $results = ACARSData::GetACARSData(); if (count($results) > 0) { foreach($results as $row) { $font = "<font color=''>"; // Standard font color if nothing below is TRUE if($row->phasedetail == 'Boarding') $font = "<font color='#2ba600'>"; //This should set the font color to red when Taxiing. if($row->phasedetail == 'Landed') $font = "<font color='#FFBF00'>"; //This should set the font color to red when Taxiing. if($row->phasedetail == 'En Route') $font = "<font color='#2A7F00'>"; //This should set the font color to green when Cruise. if($row->phasedetail == 'Departed') $font = "<font color='#FF0000'>"; //This should set the font color to red when Taxiing. if($row->phasedetail == 'Approach') $font = "<font color='#690d0d'>"; //This should set the font color to green when Cruise. if($row->phasedetail == 'Arrived') $font = "<font color='#e13838'>"; //This should set the font color to red when Taxiing. // You can add more checks here for whatever you wish ?> <tr class="listingTable <?php if( ($rowCounter % 2) == 0 ){ echo ' evenCol'; } $rowCounter++; ?>"> <td align="center"> <?php $airlines = OperationsData::getAllAirlines(); foreach($airlines as $airline) { ?> <img src="<?php echo fileurl('/lib/images/airlines/'.$airline->icao.'.gif'); ?>" alt="<?php echo $airline->name;?>" /> <?php } ?></td> <td align="center"><?php echo $row->flightnum;?></td> <!--<td align="center"><?php echo $row->aircraftname;?></td>--> <td align="center"><?php echo $row->depname;?></td> <td align="center"><?php echo $row->arrname;?></td> <td align="center"><?php echo $font.$row->phasedetail;?></td> </tr> <?php } } ?> </table> <?php if(!$results) { echo '<p align="center">No Online Flights Scheduled!</p>'; return; } ?> Quote
SkilledPilotA320 Posted October 8, 2012 Author Report Posted October 8, 2012 STILL NOT WORKING LOOK at the IMAGE, and thats the error... Quote
Moderators Parkho Posted October 8, 2012 Moderators Report Posted October 8, 2012 Can you clear your browser's cache cause it should show you the images. Quote
SkilledPilotA320 Posted October 9, 2012 Author Report Posted October 9, 2012 I tryed in all Browsers, and i get different errors bro - GOOGLE CHROME - FIRE FOX - INTERNET EXPLORER Quote
Moderators Parkho Posted October 9, 2012 Moderators Report Posted October 9, 2012 Okay. Now try to put the image itself like <img src="<?php echo fileurl('/lib/images/ABD.gif') ;?>"> see if this shows the images. Quote
CPC900 Posted October 9, 2012 Report Posted October 9, 2012 I was trying this as well. Could not get it to work either, but with: <img src="<?php echo fileurl('/lib/images/CPC.gif') ;?>"> That did show the picture, but obviously with multiple airlines, it defeats the purpose Quote
Moderators Parkho Posted October 9, 2012 Moderators Report Posted October 9, 2012 Using explode() function, you have to separate the string (CPC) from (CPC1234) which is the flight number in ACARS data and then say if this string is equal to the airline code show the image. That's the only way you can show the image on live flights for each flight. Otherwise the image will not show or shows as many airline's logo as you have. Quote
freshJet Posted October 9, 2012 Report Posted October 9, 2012 I don't work with multiple airlines but you could add a column in your phpvms_airlines table called 'image' and add the image URL for each airline and then in the foreach loop enter: <img src="http://www.yoursite.com/ib/images/<?php echo airline->image?>.gif" /> Quote
Moderators Parkho Posted October 9, 2012 Moderators Report Posted October 9, 2012 Okay try this. It's tested and working: <META HTTP-EQUIV="refresh" CONTENT="30"> <div style="position:relative"><h1>Flight Stats</h1> <p style="text-align: right; position:absolute; right:5px;top:0;"><strong>Share</strong><span class='st_blogger' ></span><span class='st_twitter' ></span><span class='st_facebook' ></span><span class='st_yahoo' ></span><span class='st_email' ></span></p> </div> <img alt="" border="1" height="136" src="http://www.airindiavirtual.com/images/flightstats_pg.jpg" width="950" /></p> <h3> Live Flight Departure/Arrival Board</h3> <table width="100%" cellspacing="0" cellpadding="4"> <tr class="title-row"> <th width="105">Airline</th> <th width="77"> Flight #</th> <!--<img src="http://airindiavirtual.com/lib/skins/aivirtual/images/logo.png"><th width="50" " height="22" background="" class="style1"><span class="tablesorterBIS"> <div align="center"> Aircraft</span></th>--> <th width="200">Depart</th> <th width="200">Arrival</th> <th width="80">Status</th> </tr> <?php $rowCounter = 1; ?> <?php $results = ACARSData::GetACARSData(); if (count($results) > 0) { foreach($results as $row) { $font = "<font color=''>"; // Standard font color if nothing below is TRUE if($row->phasedetail == 'Boarding') $font = "<font color='#2ba600'>"; //This should set the font color to red when Taxiing. if($row->phasedetail == 'Landed') $font = "<font color='#FFBF00'>"; //This should set the font color to red when Taxiing. if($row->phasedetail == 'En Route') $font = "<font color='#2A7F00'>"; //This should set the font color to green when Cruise. if($row->phasedetail == 'Departed') $font = "<font color='#FF0000'>"; //This should set the font color to red when Taxiing. if($row->phasedetail == 'Approach') $font = "<font color='#690d0d'>"; //This should set the font color to green when Cruise. if($row->phasedetail == 'Arrived') $font = "<font color='#e13838'>"; //This should set the font color to red when Taxiing. // You can add more checks here for whatever you wish ?> <tr class="listingTable <?php if( ($rowCounter % 2) == 0 ){ echo ' evenCol'; } $rowCounter++; ?>"> <td align="center"> <?php $code = substr($row->flightnum, 0,3); ?> <img src="<?php echo fileurl('/lib/images/airlines/'.$code.'.gif'); ?>" alt="<?php echo $airline->name;?>" /> </td> <td align="center"><?php echo $row->flightnum;?></td> <!--<td align="center"><?php echo $row->aircraftname;?></td>--> <td align="center"><?php echo $row->depname;?></td> <td align="center"><?php echo $row->arrname;?></td> <td align="center"><?php echo $font.$row->phasedetail;?></td> </tr> <?php } } ?> </table> <?php if(!$results) { echo '<p align="center">No Online Flights Scheduled!</p>'; return; } ?> Screenshot: 1 Quote
mseiwald Posted October 9, 2012 Report Posted October 9, 2012 I did the same with substr on my site and that works great. <?php $airlinecode = substr($row->flightnum, 0,2); ?> <img src="<?php echo fileurl('/lib/images/airlines/'.$airlinecode.'.gif'); ?>" alt="<?php echo $airline->name;?>" /> Quote
Moderators Parkho Posted October 9, 2012 Moderators Report Posted October 9, 2012 I did the same with substr on my site and that works great. <?php $airlinecode = substr($row->flightnum, 0,2); ?> <img src="<?php echo fileurl('/lib/images/airlines/'.$airlinecode.'.gif'); ?>" alt="<?php echo $airline->name;?>" /> Yep. Quote
SkilledPilotA320 Posted October 9, 2012 Author Report Posted October 9, 2012 THANK YOU BROOOOOOOOOOOO ITS WORKING NOW :) THNX A LOT Quote
Moderators Parkho Posted October 9, 2012 Moderators Report Posted October 9, 2012 THANK YOU BROOOOOOOOOOOO ITS WORKING NOW :) THNX A LOT No doubt! 1 Quote
CPC900 Posted October 9, 2012 Report Posted October 9, 2012 Now, I just wanted to add this to my existing acarsmap.tpl file, but it doesn't work. I see Air India did it on a SEPARATE page; but I wanted it on the acarsmap page. I added a: <td><b>Airline</b></td> for the heading and then added: <?php $code = substr($row->flightnum, 0,2); ?> <td><img src="<?php echo fileurl('/lib/skins/cpc/images/airlines/'.$code.'.gif'); ?>" alt="<?php echo $airline->name;?>" /> </td> above the pilotID info section, but did not work. http://www.canadianc...index.php/acars Quote
Moderators Parkho Posted October 9, 2012 Moderators Report Posted October 9, 2012 What do you have instead of " $row->flightnum " in your acars.tpl? it has to be "$something->flightnum" , so just replace that with" $row->flightnum" Quote
ARV187 Posted June 16, 2013 Report Posted June 16, 2013 (edited) To multiple airlines, is possible with this data from core/modules/Acars.php? Could be $flight->pilotcode instead of $flight->flightnum? public function data() { $flights = ACARSData::GetACARSData(); if(!$flights) $flights = array(); $this->acarsflights = array(); foreach($flights as $flight) { if($flight->route == '') { $flight->route_details = array(); } else { $flight->route_details = NavData::parseRoute($flight->route); } $c = (array) $flight; // Convert the object to an array $c['pilotid'] = PilotData::[color=#b22222][u][b]GetPilotCode($c['code'][/b][/u][/color], $c['pilotid']); // Normalize the data if($c['timeremaining'] == '') { $c['timeremaining'] == '-'; } if(trim($c['phasedetail']) == '') { $c['phasedetail'] = 'Enroute'; } /* If no heading was passed via ACARS app then calculate it P.D: I get it: <?php $code = substr($flight->code, 0,3); ?> <img src="<?php echo fileurl('/lib/skins/templatemo_254_agency/images/airlines/'.$code.'.png'); ?>" alt="<?php echo $airline->name;?>" /> Edited June 16, 2013 by ARV187 Quote
flyalaska Posted April 6, 2014 Report Posted April 6, 2014 I know this is an old post, I ran into a problem. Nothing I do will work. All I get is a broken image. Right click the broken image and I get. http://www.flyaka.com/images/airline/.png I have tried every code that was posted on this page, nothing. Any help would be appreciated. Quote
mikaelartur Posted May 29, 2019 Report Posted May 29, 2019 this work for me in profile_main.php Departure Board I put photo in /lib/images/airline/ (ROT.png, etc) <?php $code = substr($lastbid->code, 0,3); ?> <td><img src="<?php echo fileurl('/lib/images/airline/'.$code.'.png'); ?>" alt="<?php echo $airline->name;?>" width="70" height="35" /></td> 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.