Jump to content

Can someone make me a flight board ?


orpheas

Recommended Posts

We'll start from here.

1. In your skin folder, open the frontpage_main.tpl and place the code (located below) where you want the board to show.

2. Download the attached file and unzip it to your desktop.

3. Upload the "images" folder (in its entirety) to your root directory (it should look like this: public_html/images)

You can change the table images to suit your needs!

<table align="center" border="0" width="100%">
<thead>
	<tr>
		<th background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Last 10 Flights</font></th></tr>
</thead>
</table>
<?php
$count = 10;
$pireps = PIREPData::getRecentReportsByCount($count);
?>

<table align="center" border="0" width="100%">
  <thead>
    <tr border="0">
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Pilot</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Airline</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Flight #</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Origin</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Arrival</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Landing Rate</font></th>
    </tr>
   </thead>
   <tbody>
<?php

if(count($pireps) > 0)
{
 foreach ($pireps as $pirep)
 {
   $pilotinfo = PilotData::getPilotData($pirep->pilotid);
   $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); 

   echo "<tr>";
   echo "<td align=center background='images/tables/board.png'> <font face=Verdana size=2 color=#E8D33D> $pirep->firstname $pirep->lastname </font></td>";
   echo '<td align=center width=120px bgcolor=#000000><a href="'.fileurl('/index.php/pireps/viewreport/'.$pirep->pirepid.'').'"><img src="'.fileurl('/images/airline/'.$pirep->code.'.gif').'" alt="'.$airline->name.'" width="127px" height="32px" /></a></td>';
   echo "<td align=center background='images/tables/board.png'> <font face=Verdana size=2 color=#E8D33D> $pirep->code  $pirep->flightnum </font></td>";
   echo "<td align=center background='images/tables/board.png'> <font face=Verdana size=2 color=#E8D33D> $pirep->depname </font></td>";
   echo "<td align=center background='images/tables/board.png'> <font face=Verdana size=2 color=#E8D33D> $pirep->arrname </font></td>";
   echo "<td align=center background='images/tables/board.png'> <font face=Verdana size=2 color=#E8D33D> $pirep->landingrate ft/min</font></td>";
   echo "</tr>";
 }
}
else
{
   echo "<tr><td>There are no recent flights!</td></tr>";
}
?>

</tbody>
</table>

The table is designed to show the last 10 flights. If you want the table to show more/less, you will need to change both of the following codes to show the amount you want.

$count = 10;

and change the number on the header from "Last 10 Flights" to the number you changed".

images.zip

  • Like 1
Link to comment
Share on other sites

<table align="center" border="0" width="100%">
<thead>
	<tr>
		<th background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Last 10 Flights</font></th></tr>
</thead>
</table>
<?php
$count = 10;
$pireps = PIREPData::getRecentReportsByCount($count);
?>

<table align="center" border="0" width="100%">
  <thead>
    <tr border="0">
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Pilot</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Airline</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Flight #</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Origin</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Arrival</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='2' color="#FFFFFF">Landing Rate</font></th>
    </tr>
   </thead>
   <tbody>
<?php

if(count($pireps) > 0)
{
 foreach ($pireps as $pirep)
 {
   $pilotinfo = PilotData::getPilotData($pirep->pilotid);
   $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); 

   echo "<tr>";
   echo "<td align=center background='images/tables/board.png'> <font face=Verdana size=2 color=#E8D33D> $pirep->firstname $pirep->lastname </font></td>";
   echo '<td align=center width=120px bgcolor=#000000><a href="'.fileurl('/index.php/pireps/viewreport/'.$pirep->pirepid.'').'"><img src="'.fileurl('/images/airline/'.$pirep->code.'.gif').'" alt="'.$airline->name.'" width="127px" height="32px" /></a></td>';
   echo "<td align=center background='images/tables/board.png'> <font face=Verdana size=2 color=#E8D33D> $pirep->code  $pirep->flightnum </font></td>";
   echo "<td align=center background='images/tables/board.png'> <font face=Verdana size=2 color=#E8D33D> $pirep->depname </font></td>";
   echo "<td align=center background='images/tables/board.png'> <font face=Verdana size=2 color=#E8D33D> $pirep->arrname </font></td>";
   echo "<td align=center background='images/tables/board.png'> <font face=Verdana size=2 color=#E8D33D> $pirep->landingrate ft/min</font></td>";
   echo "</tr>";
 }
}
else
{
   echo "<tr><td>There are no recent flights!</td></tr>";
}
?>

</tbody>
</table>

Thank Jeff :)

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 2 weeks later...
  • 9 months later...

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