Changeset 525682
- Timestamp:
- 03/31/2012 09:57:51 PM (14 years ago)
- Location:
- fs-pax-pirep/trunk
- Files:
-
- 4 added
- 2 edited
-
css (added)
-
css/fs-pax.css (added)
-
fs-pax-pirep.php (modified) (9 diffs)
-
js (added)
-
js/jquery.dataTables.min.js (added)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fs-pax-pirep/trunk/fs-pax-pirep.php
r452271 r525682 5 5 Plugin URI: http://www.federalproductions.com/studio/game-add-ons/fs-pax/ 6 6 Description: Adds scripted PIREP display as a plugin to WordPress 7 Version: 1.0.37 Version: 2.0 8 8 Author: Ted Thompson 9 9 Author URI: http://www.federalproductions.com … … 28 28 */ 29 29 30 function 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 30 50 function fedprod_showfspflights($content) 31 51 { … … 37 57 if ($tagcheck) 38 58 { 59 60 add_action('wp_footer','fedprod_addScript'); 39 61 40 62 $vascriptpath = get_option( 'FSPassengers VA Script Path' ); … … 81 103 82 104 // EDIT THE TABLE DESIGN HERE 83 $ListStart = "<table class=\"pireptable\">\n";84 $TDTitStyle ='<t dclass="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">'; 87 109 $TRList ="<tr>"; 88 $ListStop ="</t able>\n";89 $ TDListSummary ='<tdclass="pirepsum">';110 $ListStop ="</tbody>\n</table>\n"; 111 $ListSummary ='<div class="pirepsum">'; 90 112 // 91 113 … … 96 118 $vascriptpath = get_bloginfo('url')."/".get_option( 'FSPassengers VA Script Path' ); 97 119 98 $TableTitle ="<t r>";99 if (get_option('FP_pirep_showcol1')) $TableTitle .="$TDTitStyle Id</t d>";100 if (get_option('FP_pirep_showcol2')) $TableTitle .="$TDTitStyle Date</t d>";101 if (get_option('FP_pirep_showcol3')) $TableTitle .="$TDTitStyle Airline</t d>";102 if (get_option('FP_pirep_showcol4')) $TableTitle .="$TDTitStyle PIC</t d>";103 if (get_option('FP_pirep_showcol5')) $TableTitle .="$TDTitStyle Dep</t d>";104 if (get_option('FP_pirep_showcol6')) $TableTitle .="$TDTitStyle Arr</t d>";105 if (get_option('FP_pirep_showcol7')) $TableTitle .="$TDTitStyle Pax</t d>";106 if (get_option('FP_pirep_showcol8')) $TableTitle .="$TDTitStyle A/C</t d>";107 if (get_option('FP_pirep_showcol9')) $TableTitle .="$TDTitStyle Block Time</t d>";108 if (get_option('FP_pirep_showcol10')) $TableTitle .="$TDTitStyle Result</t d>";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"; 110 132 111 133 $reporthtml = $ListStart.$TableTitle; … … 123 145 //Build table rows - to omit columns, comment out with double slash 124 146 125 while ( ($row = mysql_fetch_assoc($result)) && ($boardlength != 10))147 while ($row = mysql_fetch_assoc($result)) //(($row = mysql_fetch_assoc($result)) && ($boardlength != 10)) 126 148 { 127 149 $reporthtml .= $TRList; … … 129 151 { 130 152 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&listflight='.$row[id].'" '.$linkattribs.'>'.$row["FlightId"].'</a>'."</div></td>"; 132 154 } 133 155 if (get_option('FP_pirep_showcol2')) 134 156 { 135 157 if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven; 136 $reporthtml .= $row["FlightDate"] ;158 $reporthtml .= $row["FlightDate"]."</div></td>"; 137 159 } 138 160 if (get_option('FP_pirep_showcol3')) 139 161 { 140 162 if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven; 141 $reporthtml .= $row["CompanyName"] ;163 $reporthtml .= $row["CompanyName"]."</div></td>"; 142 164 } 143 165 if (get_option('FP_pirep_showcol4')) 144 166 { 145 167 if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven; 146 $reporthtml .= $row["PilotName"] ;168 $reporthtml .= $row["PilotName"]."</div></td>"; 147 169 } 148 170 if (get_option('FP_pirep_showcol5')) 149 171 { 150 172 if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven; 151 $reporthtml .= substr($row["DepartureIcaoName"],0,4) ;173 $reporthtml .= substr($row["DepartureIcaoName"],0,4)."</div></td>"; 152 174 } 153 175 if (get_option('FP_pirep_showcol6')) 154 176 { 155 177 if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven; 156 $reporthtml .= substr($row["ArrivalIcaoName"],0,4) ;178 $reporthtml .= substr($row["ArrivalIcaoName"],0,4)."</div></td>"; 157 179 } 158 180 if (get_option('FP_pirep_showcol7')) 159 181 { 160 182 if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven; 161 $reporthtml .= $row["NbrPassengers"] ;183 $reporthtml .= $row["NbrPassengers"]."</div></td>"; 162 184 } 163 185 if (get_option('FP_pirep_showcol8')) 164 186 { 165 187 if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven; 166 $reporthtml .= $row["AircraftType"] ;188 $reporthtml .= $row["AircraftType"]."</div></td>"; 167 189 } 168 190 if (get_option('FP_pirep_showcol9')) 169 191 { 170 192 if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven; 171 $reporthtml .= $row["TotalBlockTime"] ;193 $reporthtml .= $row["TotalBlockTime"]."</div></td>"; 172 194 } 173 195 if (get_option('FP_pirep_showcol10')) 174 196 { 175 197 if($Line==0)$reporthtml .= $TDListOdd;else $reporthtml .= $TDListEven; 176 $reporthtml .= $row["FlightResult"] ;177 } 178 179 $reporthtml .= "</t d></tr>\n";198 $reporthtml .= $row["FlightResult"]."</div></td>"; 199 } 200 201 $reporthtml .= "</tr>\n"; 180 202 181 203 $Line=!$Line; … … 190 212 $reporthtml .= $ListStop; 191 213 192 $reporthtml .= "<br />".$ListS tart.$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>"; 193 215 194 216 return $reporthtml; … … 391 413 392 414 add_filter('the_content','fedprod_showfspflights'); 415 416 function 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 } 425 add_action('init', 'fedprod_addToHead'); -
fs-pax-pirep/trunk/readme.txt
r452271 r525682 4 4 Tags: FSPassengers, Flight simulator 5 5 Requires at least: 3.0 6 Tested up to: 3. 2.17 Stable tag: 1.0.36 Tested up to: 3.3.1 7 Stable tag: 2.0 8 8 9 9 Adds scripted PIREP display as a plugin to WordPress. … … 37 37 38 38 == Changelog == 39 40 = 2.0 = 41 42 * Added pagination using jQuery and DataTables 39 43 40 44 = 1.0.3 =
Note: See TracChangeset
for help on using the changeset viewer.