Plugin Directory

Changeset 525682


Ignore:
Timestamp:
03/31/2012 09:57:51 PM (14 years ago)
Author:
yorokobi
Message:
 
Location:
fs-pax-pirep/trunk
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • fs-pax-pirep/trunk/fs-pax-pirep.php

    r452271 r525682  
    55Plugin URI: http://www.federalproductions.com/studio/game-add-ons/fs-pax/
    66Description: Adds scripted PIREP display as a plugin to WordPress
    7 Version: 1.0.3
     7Version: 2.0
    88Author: Ted Thompson
    99Author URI: http://www.federalproductions.com
     
    2828*/
    2929
     30function fedprod_addScript() {
     31
     32$file = dirname(__FILE__) . '/fs-pax-pirep.php';
     33$file_url = plugin_dir_url($file);
     34
     35?>
     36<!-- Start FS-PAX added code -->
     37    <script type="text/javascript" src="<?php echo $file_url ?>js/jquery.dataTables.min.js"></script>
     38    <script type="text/javascript" charset="utf-8">
     39        $(document).ready(function() {
     40            $('#pireplist').dataTable( {
     41            "bSort": false,
     42            "sPaginationType": "full_numbers"
     43            } );
     44        } );
     45    </script>
     46<!-- End FS-PAX added code -->
     47<?php
     48}
     49
    3050function fedprod_showfspflights($content)
    3151    {
     
    3757        if ($tagcheck)
    3858        {
     59
     60        add_action('wp_footer','fedprod_addScript');
    3961
    4062        $vascriptpath = get_option( 'FSPassengers VA Script Path' );
     
    81103
    82104    // EDIT THE TABLE DESIGN HERE
    83     $ListStart  ="<table class=\"pireptable\">\n";
    84     $TDTitStyle     ='<td class="pireptitle">';
    85     $TDListOdd  ='<td class="pirepcell pirepodd">';
    86     $TDListEven ='<td class="pirepcell pirepeven">';
     105    $ListStart  ='<table id="pireplist" class="pireptable">';
     106    $TDTitStyle     ='<th class="pireptitle">';
     107    $TDListOdd  ='<td class="pirepcell pirepodd"><div class="pireptext">';
     108    $TDListEven ='<td class="pirepcell pirepeven"><div class="pireptext">';
    87109    $TRList     ="<tr>";
    88     $ListStop   ="</table>\n";
    89     $TDListSummary  ='<td class="pirepsum">';
     110    $ListStop   ="</tbody>\n</table>\n";
     111    $ListSummary    ='<div class="pirepsum">';
    90112    //
    91113
     
    96118    $vascriptpath = get_bloginfo('url')."/".get_option( 'FSPassengers VA Script Path' );
    97119
    98     $TableTitle     ="<tr>";
    99     if (get_option('FP_pirep_showcol1')) $TableTitle .="$TDTitStyle Id</td>";
    100     if (get_option('FP_pirep_showcol2')) $TableTitle .="$TDTitStyle Date</td>";
    101     if (get_option('FP_pirep_showcol3')) $TableTitle .="$TDTitStyle Airline</td>";
    102     if (get_option('FP_pirep_showcol4')) $TableTitle .="$TDTitStyle PIC</td>";
    103     if (get_option('FP_pirep_showcol5')) $TableTitle .="$TDTitStyle Dep</td>";
    104     if (get_option('FP_pirep_showcol6')) $TableTitle .="$TDTitStyle Arr</td>";
    105     if (get_option('FP_pirep_showcol7')) $TableTitle .="$TDTitStyle Pax</td>";
    106     if (get_option('FP_pirep_showcol8')) $TableTitle .="$TDTitStyle A/C</td>";
    107     if (get_option('FP_pirep_showcol9')) $TableTitle .="$TDTitStyle Block Time</td>";
    108     if (get_option('FP_pirep_showcol10')) $TableTitle .="$TDTitStyle Result</td>";
    109     $TableTitle .="</tr>\n";   
     120    $TableTitle     ="<thead><tr>";
     121    if (get_option('FP_pirep_showcol1')) $TableTitle .="$TDTitStyle Id</th>";
     122    if (get_option('FP_pirep_showcol2')) $TableTitle .="$TDTitStyle Date</th>";
     123    if (get_option('FP_pirep_showcol3')) $TableTitle .="$TDTitStyle Airline</th>";
     124    if (get_option('FP_pirep_showcol4')) $TableTitle .="$TDTitStyle PIC</th>";
     125    if (get_option('FP_pirep_showcol5')) $TableTitle .="$TDTitStyle Dep</th>";
     126    if (get_option('FP_pirep_showcol6')) $TableTitle .="$TDTitStyle Arr</th>";
     127    if (get_option('FP_pirep_showcol7')) $TableTitle .="$TDTitStyle Pax</th>";
     128    if (get_option('FP_pirep_showcol8')) $TableTitle .="$TDTitStyle A/C</th>";
     129    if (get_option('FP_pirep_showcol9')) $TableTitle .="$TDTitStyle Block Time</th>";
     130    if (get_option('FP_pirep_showcol10')) $TableTitle .="$TDTitStyle Result</th>";
     131    $TableTitle .="</tr></thead>\n<tbody>\n";   
    110132
    111133    $reporthtml = $ListStart.$TableTitle;
     
    123145    //Build table rows - to omit columns, comment out with double slash
    124146
    125     while (($row = mysql_fetch_assoc($result)) && ($boardlength != 10))
     147    while ($row = mysql_fetch_assoc($result)) //(($row = mysql_fetch_assoc($result)) && ($boardlength != 10))
    126148    {
    127149        $reporthtml .= $TRList;
     
    129151            {
    130152            if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven;
    131             $reporthtml .= '<a href="'.$vascriptpath.'/FsPlistflight.php?action=va&listflight='.$row[id].'" '.$linkattribs.'>'.$row["FlightId"].'</a>';
     153            $reporthtml .= '<a href="'.$vascriptpath.'/FsPlistflight.php?action=va&amp;listflight='.$row[id].'" '.$linkattribs.'>'.$row["FlightId"].'</a>'."</div></td>";
    132154            }
    133155        if (get_option('FP_pirep_showcol2'))
    134156            {
    135157            if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven;
    136             $reporthtml .= $row["FlightDate"];
     158            $reporthtml .= $row["FlightDate"]."</div></td>";
    137159            }
    138160        if (get_option('FP_pirep_showcol3'))
    139161            {
    140162        if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven;
    141         $reporthtml .= $row["CompanyName"];
     163        $reporthtml .= $row["CompanyName"]."</div></td>";
    142164            }
    143165        if (get_option('FP_pirep_showcol4'))
    144166            {
    145167        if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven;
    146         $reporthtml .= $row["PilotName"];
     168        $reporthtml .= $row["PilotName"]."</div></td>";
    147169            }
    148170        if (get_option('FP_pirep_showcol5'))
    149171            {
    150172        if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven;
    151         $reporthtml .= substr($row["DepartureIcaoName"],0,4);
     173        $reporthtml .= substr($row["DepartureIcaoName"],0,4)."</div></td>";
    152174            }
    153175        if (get_option('FP_pirep_showcol6'))
    154176            {
    155177        if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven;
    156         $reporthtml .= substr($row["ArrivalIcaoName"],0,4);
     178        $reporthtml .= substr($row["ArrivalIcaoName"],0,4)."</div></td>";
    157179            }
    158180        if (get_option('FP_pirep_showcol7'))
    159181            {
    160182        if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven;
    161         $reporthtml .= $row["NbrPassengers"];
     183        $reporthtml .= $row["NbrPassengers"]."</div></td>";
    162184            }
    163185        if (get_option('FP_pirep_showcol8'))
    164186            {
    165187        if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven;
    166         $reporthtml .= $row["AircraftType"];
     188        $reporthtml .= $row["AircraftType"]."</div></td>";
    167189            }
    168190        if (get_option('FP_pirep_showcol9'))
    169191            {
    170192        if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven;
    171         $reporthtml .= $row["TotalBlockTime"];
     193        $reporthtml .= $row["TotalBlockTime"]."</div></td>";
    172194            }
    173195        if (get_option('FP_pirep_showcol10'))
    174196            {
    175197        if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven;
    176         $reporthtml .= $row["FlightResult"];
    177             }
    178 
    179         $reporthtml .= "</td></tr>\n";
     198        $reporthtml .= $row["FlightResult"]."</div></td>";
     199            }
     200
     201        $reporthtml .= "</tr>\n";
    180202   
    181203        $Line=!$Line;
     
    190212$reporthtml .= $ListStop;
    191213
    192 $reporthtml .= "<br />".$ListStart.$TDListSummary."Total Flight made: $NrfFlights<br />total flight time: $CompanyFlightTime<br />Total passengers carried: $TotalPassengers<br />Total Cargo: $TotalCargo kg".$ListStop;
     214$reporthtml .= "<br />".$ListSummary."Total Flight made: $NrfFlights<br />total flight time: $CompanyFlightTime<br />Total passengers carried: $TotalPassengers<br />Total Cargo: $TotalCargo kg</div>";
    193215
    194216return $reporthtml;
     
    391413
    392414add_filter('the_content','fedprod_showfspflights');
     415
     416function fedprod_addToHead() {
     417    if (!is_admin()) {
     418        wp_enqueue_script('jquery');
     419        $file = dirname(__FILE__) . '/fs-pax-pirep.php';
     420        $file_url = plugin_dir_url($file);
     421        $style_sheet = $file_url . "css/fs-pax.css";
     422        WP_Enqueue_Style('fs-pax-pirep', $style_sheet, false, $plugin_version);
     423    }
     424}
     425add_action('init', 'fedprod_addToHead');
  • fs-pax-pirep/trunk/readme.txt

    r452271 r525682  
    44Tags: FSPassengers, Flight simulator
    55Requires at least: 3.0
    6 Tested up to: 3.2.1
    7 Stable tag: 1.0.3
     6Tested up to: 3.3.1
     7Stable tag: 2.0
    88
    99Adds scripted PIREP display as a plugin to WordPress.
     
    3737
    3838== Changelog ==
     39
     40= 2.0 =
     41
     42* Added pagination using jQuery and DataTables
    3943
    4044= 1.0.3 =
Note: See TracChangeset for help on using the changeset viewer.