bass Posted March 26, 2016 Report Share Posted March 26, 2016 If you want to see the flight evaluation scale from 0 to 100. What can I install the code in pirep_viewreport.tpl <?php $log = explode('*', $pirep->log); $sover = $fstall = $pritir = $perfl = $normall = $bad = $vbad = $crash = 0; foreach($log as $line) { if(preg_match('/Overspeed!/i', $line)) $sover = 2; if(preg_match('/Stall!/i', $line)) $fstall = 15; if(preg_match('/landed at/i', $line)) { $rate = explode('at -', $line); $rate2 = explode('fpm ', $rate[1]); if($rate2[0] <= 49) $pritir = 0; elseif($rate2[0] <= 250 && $rate2[0] >= 49) $perfl = 0; elseif($rate2[0] <= 500 && $rate2[0] >= 250) $normall = 0; elseif($rate2[0] <= 700 && $rate2[0] >= 500) $bad = 5; elseif($rate2[0] <= 1600 && $rate2[0] >= 700) $vbad = 20; elseif($rate2[0] >= 1600) $crash = 99; } } $full = 100; $report = 100 - $sover - $fstall - $pritir - $perfl - $normall - $bad - $vbad - $crash; $report = $report <= 0 ? 0 : $report; if($report < 100) { ?> <font color="red"> <?php echo $report ?></font> <?php } else { ?> <?php echo $report ?> <?php } ?> 1 Quote Link to comment Share on other sites More sharing options...
CedGauche Posted March 27, 2016 Report Share Posted March 27, 2016 Nice snippet, thx! Is there a way to add variables, if these were not in the log? Like: if(!preg_match('/Overspeed!/i', $line)) $sover = -2; Don't work in my case Quote Link to comment Share on other sites More sharing options...
bass Posted March 27, 2016 Author Report Share Posted March 27, 2016 Nice snippet, thx! Is there a way to add variables, if these were not in the log? Like: if(!preg_match('/Overspeed!/i', $line)) $sover = -2; Don't work in my case I can not say I found this code on the Internet. With my agent is working. Quote Link to comment Share on other sites More sharing options...
MichaelKattirtzis Posted March 29, 2016 Report Share Posted March 29, 2016 In what pirep_view report.tpl do we add this ? 1 in the core template or 2 in the skin folder pirep_viewreport.tpl ? And thanks for the snippet i was looking all over the internet for this Quote Link to comment Share on other sites More sharing options...
bass Posted March 29, 2016 Author Report Share Posted March 29, 2016 In what pirep_view report.tpl do we add this ? 1 in the core template or 2 in the skin folder pirep_viewreport.tpl ? And thanks for the snippet i was looking all over the internet for this IN skins Quote Link to comment Share on other sites More sharing options...
Iraklis Posted April 10, 2016 Report Share Posted April 10, 2016 witch tracker are you using??? Quote Link to comment Share on other sites More sharing options...
bass Posted April 10, 2016 Author Report Share Posted April 10, 2016 witch tracker are you using??? The paid version kAcars Quote Link to comment Share on other sites More sharing options...
bass Posted April 10, 2016 Author Report Share Posted April 10, 2016 That's how we derive estimates for their flight in the file pireps_viewall 1 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.