Sign in to follow this  
Followers 0
Iraklis

a question

2 posts in this topic

is there a chance the tracker to work with this code?

<?php
$log = explode('*', $pirep->log);
$sover = $fstall = $pritir = $perfl = $normall = $bad = $vbad = $crash = ;
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[] <= 49)
$pritir = ;
elseif($rate2[] <= 250 && $rate2[] >= 49)
$perfl = ;
elseif($rate2[] <= 500 && $rate2[] >= 250)
$normall = ;
elseif($rate2[] <= 700 && $rate2[] >= 500)
$bad = 5;
elseif($rate2[] <= 1600 && $rate2[] >= 700)
$vbad = 20;
elseif($rate2[] >= 1600)
$crash = 99;
}
}
$full = 100;
$report = 100 - $sover - $fstall - $pritir - $perfl - $normall - $bad - $vbad - $crash;
$report = $report <=  ?  : $report;
if($report < 100)
{
?>
                                                        <font color="red"> <?php echo $report ?></font>
                                                        <?php
}
else
{
?>
                                                        <?php echo $report ?>
                                                        <?php }
?>

it shows the rating of the flight....

0

Share this post


Link to post
Share on other sites

That isnt really related to the client but a custom function that seems to run when a PIREP is filed and searches the log for specific words.

Not really sure why you would go the complicated way to extract the landingrate from the log when it is already sent as a seperate value.

 

You would need to adjust the code to query the log for the text sent by CCFTracker.

Instead of such specific searches like getting the landingrate i would just query the log for words like stall, overspeed and the likes and get the landingrate from its own database column $pirep->landingrate.

That way it would work with any Client.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0