Jump to content

Live Flight's Board


kokosik7

Recommended Posts

would you mind sharing how you did that?

Hey,

Nice to see someone wants this.

you can find the code here Pastebin Code.

We have also included the FS Flight Keeper Functions although we have installed the SDK and use its own Databases because it will not send the Aircraft Type to the PHPVMS Database.

So now it shows two seperate Systems in one display FSFK Flights have a * added to the Flight Number and PHPVMS Flights are reported without a *.

If you need any other help let me know.

Link to comment
Share on other sites

dont know how to use this with my site and with kACARS. Can one help me?

    <h3 style="text-align: center;">Flight Departures Board</h3>
   <?php
   if(!$lastbids) {
   echo '<p align="center">There are currently no booked flights!</p></div>';
   return;
   }
   mysql_connect('localhost', 'xxx', 'xxx');
   mysql_select_db('flkeeper');
   $result = mysql_query("SELECT * FROM liveacars");
   $fsfk = mysql_num_rows($result);
   ?>
   <center>
   <table cellspacing="0" cellpadding="0" style="border:1px solid grey;">
       <thead>
           <tr style="font-size:14px; font-weight:bold;">
               <th align="center" style="background-color: #1F1F1F; width: 3.5%;"> </th>
               <th align="center" style="background-color: #1F1F1F; width: 10%;"><font color="#ff8710"><b>Flight</b></font></th>
               <th align="center" style="background-color: #1F1F1F; width: 30%;"><font color="#ff8710"><b>Departing</b></font></th>
               <th align="center" style="background-color: #1F1F1F; width: 30%;"><font color="#ff8710"><b>Arriving</b></font></th>
               <th align="center" style="background-color: #1F1F1F; width: 5%"><font color="#ff8710"><b>Aircraft</b></font></th>
               <th align="center" style="background-color: #1F1F1F; width: 18.5%;"><font color="#ff8710"><b>Status</b></font></th>
           </tr>
       </thead>
       <tbody>
       <?php
           $flights = ACARSData::GetACARSData();  
           if ($flights OR $fsfk > 0) {
               if($flights) {
               foreach($flights as $flight) {
                      $pid = $flight->pilotid + 100;?>
               <tr style="height:12px; font-size:14px; font-weight:normal;">
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding: 1px;"><?php if($flight->phasedetail == "Boarding") { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots_blink.gif'>"; } elseif($flight->phasedetail == "Arrived") { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots.gif'>"; } elseif($flight->phasedetail == "On Approach") { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots_yellow.gif'>"; } ?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F;"><font color="#ff961e"><?php echo $flight->flightnum?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 5px;"><font color="#ff961e"> <?php echo $flight->depapt?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 5px;"><font color="#ff961e"> <?php echo $flight->arrapt?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 0px;"><font color="#ff961e"> <?php echo $flight->aircraftname?> </td>
                   <td
   align="center" valign="middle"
   style="background-color: #1F1F1F;"><font
   color="#ff961e"><?php if($flight->phasedetail
   != 'Paused') { echo $flight->phasedetail; }
   else { echo "Cruise"; } ?></font></td>
               </tr>
               <?php
               }
               }
               while($row = mysql_fetch_assoc($result)) {
               mysql_select_db('berlin_vms');
               $dep = mysql_fetch_assoc(mysql_query("SELECT name FROM phpvms_airports WHERE icao = '$row[OriginAirport]'"));
               $arr = mysql_fetch_assoc(mysql_query("SELECT name FROM phpvms_airports WHERE icao = '$row[DestinationAirport]'"));
               $row['OriginAirport'];
               ?>
               <tr style="height:12px; font-size:14px; font-weight:normal;">
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding: 1px;"><?php if($row['Status'] == 0) { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots_blink.gif'>"; } elseif($row['Status'] == 4) { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots.gif'>"; } elseif($row['Status'] == 3) { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots_yellow.gif'>"; }?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F;"><font color="#ff961e"><?php echo $row['FlightNumber']; ?>*</td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 5px;"><font color="#ff961e"> <?php echo utf8_encode($dep['name']); ?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 5px;"><font color="#ff961e"> <?php echo utf8_encode($arr['name']); ?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 0px;"><font color="#ff961e"> <?php echo $row['Aircraft']; ?> </td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F;"><font color="#ff961e"><?php  if($row['Status'] == 0) { echo "Boarding"; } elseif($row['PauseMode'] != 0) { echo "Paused"; } elseif($row['Status'] == 1) { echo "Taxiing to Runway"; } elseif($row['Status'] == 2 && $row['AltitudeStatus'] == 1) { echo "Cruise"; } elseif($row['Status'] == 2 && $row['AltitudeStatus'] == 2) { echo "Climbing"; } elseif($row['Status'] == 2 && $row['AltitudeStatus'] == 0) { echo "Descending"; } elseif($row['Status'] == 3) { echo "Taxiing to Gate"; } elseif($row['Status'] == 4) { echo "Arrived"; } ?></font></td>
               </tr>
               <?php          
               }
           } else { ?>
               <tr><td width="20%" align="center" colspan="6" style="padding: 5px; font-size: 13px; font-weight: bold; color: #ff961e;">No Flights in Progress!</td></tr>
           <?php
           }
           ?>
       </tbody>
   </table>
   <p><i>The actual, flights and flights completed in the last <?php echo Config::Get('ACARS_LIVE_TIME') ?> minutes.<br />*Flight with FSFlightkeeper</i></p>

Link to comment
Share on other sites

Forgot to put instructions on where to put this.

This should replace everything in /lib/skins/yourskin/frontpage_recentbids.tpl

then you will have to activate this for the homepage by adding

MainController::Run('FrontBids', 'RecentFrontPage', 50);

and position it where you want it to show up in frontpage_main.tpl and it will work like a charm.

I will say it again if you do not have the FS Flight Keeper SDK installed you will have to comment the Flight Keeper Parts out of the script other than that it will work just as good as it works on our site.

Link to comment
Share on other sites

You only need to put information in if you are using FSFK, otherwise just comment it out

how do you mean it? Can you give an example?

The easiest way to get this is look at your existing acars file and copy all the code except the map display :) Whalla all your flights are displayed :)

But i find the other board better. ^^

Link to comment
Share on other sites

  • 2 weeks later...

If you do not use Flight Keeper from Aerosoft for your Pilots then you do not have to use this at all and can uncomment the lines that have to do with flight keeper

Happy new year @ all!

Hi Chris, congrats to AB VA! Looks nice!

I start now with FSFK integration to my va. What parts you´ve used from the FSFK Integration pack? only SQL-Tables? you integrate the fsfk sql-tables into your main phpvms database or to an extra db?

Thx for help.

Regards

Andreas Romahn

Link to comment
Share on other sites

Yeah, I would not recommend using the code he posted with your database info there, not smart. Just do what Mark said, much safer.

I tried but doesn´t work on frontpage_main.tpl. I paste the code without the part of the acars map, but nothing show up. maybe i forgot something.

Link to comment
Share on other sites

Ive got it working except these 2 errors, any ideas?

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/easternv/public_html/eva/lib/skins/eva/frontpage_recentbids.tpl on line 10

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/easternv/public_html/eva/lib/skins/eva/frontpage_recentbids.tpl on line 47

Link to comment
Share on other sites

I get this error warning but dont know whats wrong with my modified code of the Air Berlin Live Board I get only that error it works but it would be nice if someone could help me to get rid of that error!

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/simaerobatic/htdocs/AMI/lib/skins/brilliancev111/frontpage_recentbids.tpl on line 43

I deleted all Flight Keeper related maybe deleted too much?

<h3 style="text-align: center;">Flight Departures Board</h3>
   <?php
   if(!$lastbids) {
   echo '<p align="center">There are currently no booked flights!</p></div>';
   return;
   }
   ?>
   <center>
   <table cellspacing="0" cellpadding="0" style="border:1px solid grey;">
       <thead>
           <tr style="font-size:14px; font-weight:bold;">
               <th align="center" style="background-color: #1F1F1F; width: 3.5%;"> </th>
               <th align="center" style="background-color: #1F1F1F; width: 10%;"><font color="#ff8710"><b>Flight</b></font></th>
               <th align="center" style="background-color: #1F1F1F; width: 30%;"><font color="#ff8710"><b>Departing</b></font></th>
               <th align="center" style="background-color: #1F1F1F; width: 30%;"><font color="#ff8710"><b>Arriving</b></font></th>
               <th align="center" style="background-color: #1F1F1F; width: 5%"><font color="#ff8710"><b>Aircraft</b></font></th>
               <th align="center" style="background-color: #1F1F1F; width: 18.5%;"><font color="#ff8710"><b>Status</b></font></th>
           </tr>
       </thead>
       <tbody>
       <?php
           $flights = ACARSData::GetACARSData();  
           if ($flights > 0) {
               if($flights) {
               foreach($flights as $flight) {
                      $pid = $flight->pilotid + 100;?>
               <tr style="height:12px; font-size:14px; font-weight:normal;">
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding: 1px;"><?php if($flight->phasedetail == "Boarding") { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots_blink.gif'>"; } elseif($flight->phasedetail == "Arrived") { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots.gif'>"; } elseif($flight->phasedetail == "On Approach") { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots_yellow.gif'>"; } ?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F;"><font color="#ff961e"><?php echo $flight->flightnum?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 5px;"><font color="#ff961e"> <?php echo $flight->depapt?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 5px;"><font color="#ff961e"> <?php echo $flight->arrapt?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 0px;"><font color="#ff961e"> <?php echo $flight->aircraftname?> </td>
                   <td
   align="center" valign="middle"
   style="background-color: #1F1F1F;"><font
   color="#ff961e"><?php if($flight->phasedetail
   != 'Paused') { echo $flight->phasedetail; }
   else { echo "Cruise"; } ?></font></td>
               </tr>
               <?php
               }
               }
               while($row = mysql_fetch_assoc($result)) {
               mysql_select_db('amiva_vms');
               $dep = mysql_fetch_assoc(mysql_query("SELECT name FROM phpvms_airports WHERE icao = '$row[OriginAirport]'"));
               $arr = mysql_fetch_assoc(mysql_query("SELECT name FROM phpvms_airports WHERE icao = '$row[DestinationAirport]'"));
               $row['OriginAirport'];
               ?>
               <tr style="height:12px; font-size:14px; font-weight:normal;">
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding: 1px;"><?php if($row['Status'] == 0) { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots_blink.gif'>"; } elseif($row['Status'] == 4) { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots.gif'>"; } elseif($row['Status'] == 3) { echo "<img style='padding-left:3px;' src='http://www.airberlinva.de/lib/skins/airberlin/images/dots_yellow.gif'>"; }?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F;"><font color="#ff961e"><?php echo $row['FlightNumber']; ?>*</td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 5px;"><font color="#ff961e"> <?php echo utf8_encode($dep['name']); ?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 5px;"><font color="#ff961e"> <?php echo utf8_encode($arr['name']); ?></td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F; padding-right: 0px;"><font color="#ff961e"> <?php echo $row['Aircraft']; ?> </td>
                   <td align="center" valign="middle" style="background-color: #1F1F1F;"><font color="#ff961e"><?php  if($row['Status'] == 0) { echo "Boarding"; } elseif($row['PauseMode'] != 0) { echo "Paused"; } elseif($row['Status'] == 1) { echo "Taxiing to Runway"; } elseif($row['Status'] == 2 && $row['AltitudeStatus'] == 1) { echo "Cruise"; } elseif($row['Status'] == 2 && $row['AltitudeStatus'] == 2) { echo "Climbing"; } elseif($row['Status'] == 2 && $row['AltitudeStatus'] == 0) { echo "Descending"; } elseif($row['Status'] == 3) { echo "Taxiing to Gate"; } elseif($row['Status'] == 4) { echo "Arrived"; } ?></font></td>
               </tr>
               <?php          
               }
           } else { ?>
               <tr><td width="20%" align="center" colspan="6" style="padding: 5px; font-size: 13px; font-weight: bold; color: #ff961e;">No Flights in Progress!</td></tr>
           <?php
           }
           ?>
       </tbody>
   </table>
   <p><i>The actual, flights and flights completed in the last <?php echo Config::Get('ACARS_LIVE_TIME') ?> minutes.<br /></i></p>

if I discovered right the status did not self refresh till you click site refresh right!?

Link to comment
Share on other sites

  • 3 weeks later...

Really great utility this - congrats all round!

Just a quick Q though... it only seems to display the aircraft for FSFK flights, the readout is blank for kACARS, FSACARS etc.

I presume it's because there's no 'aircraftname' field in the _acarsdata table.

Is there a work around for this? Cheers!

(edit to add) Actually, I don't think I've got the whole thing working at all (I'm still getting '0' lines when using FSFK now - I don't think it's pulling the data from the flkeeper database. I've double checked all my paths etc. are correct. I was sure the first time I did it it worked (hence my original question).

TBH I've been trying to find a solution all day & quite frankly I'm completely stumped & more than a little frustrated!

Still have to say the flight board looks great tho!

Link to comment
Share on other sites

  • 2 weeks later...

Really great utility this - congrats all round!

Just a quick Q though... it only seems to display the aircraft for FSFK flights, the readout is blank for kACARS, FSACARS etc.

I presume it's because there's no 'aircraftname' field in the _acarsdata table.

Is there a work around for this? Cheers!

(edit to add) Actually, I don't think I've got the whole thing working at all (I'm still getting '0' lines when using FSFK now - I don't think it's pulling the data from the flkeeper database. I've double checked all my paths etc. are correct. I was sure the first time I did it it worked (hence my original question).

TBH I've been trying to find a solution all day & quite frankly I'm completely stumped & more than a little frustrated!

Still have to say the flight board looks great tho!

i got the same issue with the "0" when using FSFK. I tried out a lot, but nothing work. I´ve genarated a stand alone db for fsfk and use the fsfk integration stuff, maybee i used on the wrong places.

Andreas

Link to comment
Share on other sites

  • 3 weeks later...

Hello all !

I have figure out a way to get the traffic (NO need to have FSpax,FSFK,kACARS etc) from IVAO (still working to find a way for VATSIM) you can see demo here: http://www.greeceairwaysva.com/fss/index.php/online

i m waiting the approval from IVAO LD to release this for every one ! Say tunned !

Any news on this? Would be great because we use a similar system at the moment!

Link to comment
Share on other sites

you can try my version where I have eliminated fsfk parts of code

if I know how we can made it self refreshing when on frontpage without reloading whole site it would be perfect!

if anyone has an idea please let me know ;)

layout is styled to that which was used at airberlinva

http://school.simaerobatic.com/liveboard.zip

you can see it in action here (works 100% but at the moment it is not automatic refreshing!)

http://flyeurope-va.org

Best Regards

Thomas

Link to comment
Share on other sites

you can try my version where I have eliminated fsfk parts of code

if I know how we can made it self refreshing when on frontpage without reloading whole site it would be perfect!

if anyone has an idea please let me know ;)

layout is styled to that which was used at airberlinva

http://school.simaerobatic.com/liveboard.zip

you can see it in action here (works 100% but at the moment it is not automatic refreshing!)

http://flyeurope-va.org

Best Regards

Thomas

Hi Thomas. The link to your file is dead. That is exactly what I was looking for a week or two ago.

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