SkilledPilotA320 Posted October 7, 2012 Report Share 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 Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 7, 2012 Moderators Report Share 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 Link to comment Share on other sites More sharing options...
SkilledPilotA320 Posted October 7, 2012 Author Report Share 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 Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 7, 2012 Moderators Report Share 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 Link to comment Share on other sites More sharing options...
SkilledPilotA320 Posted October 8, 2012 Author Report Share 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 Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 8, 2012 Moderators Report Share 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 Link to comment Share on other sites More sharing options...
SkilledPilotA320 Posted October 8, 2012 Author Report Share Posted October 8, 2012 STILL NOT WORKING LOOK at the IMAGE, and thats the error... Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 8, 2012 Moderators Report Share Posted October 8, 2012 Can you clear your browser's cache cause it should show you the images. Quote Link to comment Share on other sites More sharing options...
SkilledPilotA320 Posted October 9, 2012 Author Report Share Posted October 9, 2012 I tryed in all Browsers, and i get different errors bro - GOOGLE CHROME - FIRE FOX - INTERNET EXPLORER Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 9, 2012 Moderators Report Share 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 Link to comment Share on other sites More sharing options...
CPC900 Posted October 9, 2012 Report Share 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 Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 9, 2012 Moderators Report Share 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 Link to comment Share on other sites More sharing options...
freshJet Posted October 9, 2012 Report Share 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 Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 9, 2012 Moderators Report Share 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 Link to comment Share on other sites More sharing options...
mseiwald Posted October 9, 2012 Report Share 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 Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 9, 2012 Moderators Report Share 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 Link to comment Share on other sites More sharing options...
SkilledPilotA320 Posted October 9, 2012 Author Report Share Posted October 9, 2012 THANK YOU BROOOOOOOOOOOO ITS WORKING NOW :) THNX A LOT Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 9, 2012 Moderators Report Share Posted October 9, 2012 THANK YOU BROOOOOOOOOOOO ITS WORKING NOW :) THNX A LOT No doubt! 1 Quote Link to comment Share on other sites More sharing options...
CPC900 Posted October 9, 2012 Report Share 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 Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 9, 2012 Moderators Report Share 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 Link to comment Share on other sites More sharing options...
ARV187 Posted June 16, 2013 Report Share 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 Link to comment Share on other sites More sharing options...
flyalaska Posted April 6, 2014 Report Share 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 Link to comment Share on other sites More sharing options...
mikaelartur Posted May 29, 2019 Report Share 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 Link to comment Share on other sites More sharing options...
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.