Jump to content

Styling the Pirep log


mark1million

Recommended Posts

  • Moderators

I have just been looking at how the pirep log is displayed,

     <?php
     # Simple, each line of the log ends with *
     # Just explode and loop.
     $log = explode('*', $pirep->log);
     foreach($log as $line)
     {
        echo $line .'<br />';
     }
     ?>

If it possible to style based on an event, for example

If the log contains Stall format that text in Red Bold for example, or if it contains a landing rate < -500 that is also formatted, im just trying to get some ideas on how to format the output based on different events and even if it is possible.

Thanks.

Link to comment
Share on other sites

  • Administrators

You could do some conditional statements, it would probably get a little lengthy in order to cover everything and every type of ACARS system but maybe something like this for the TOD event;

[22:54] - TOD reached

<?php      
# Simple, each line of the log ends with *      
# Just explode and loop.
     $log = explode('*', $pirep->log);
     foreach($log as $line)      
     {         
       $line_items = explode('-', $line);
       {
          if($line_items['1'] == 'TOD reached')
          {echo '<font color="#00FF00">'.$line.'</font><br />';}
          else
          { echo $line .'<br />';}
       }
     } 
?>

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

In kaCARS free dont work because in the kacars free log not have the - in the log

[14:45] TOD Reached

what is the code for the log kacars free? I tried this but does not work

<?php	
# Simple, each line of the log ends with *	   
# Just explode and loop.
	  $log = explode('*', $pirep->log);
	  foreach($log as $line)		 
	  {			 
		    $line_items = explode(' ', $line);
		    {
			   if($line_items['1'] == 'TOD reached')
			   {echo '<font color="#00FF00">'.$line.'</font><br />';}
			   else
			   { echo $line .'<br />';}
		    }
	  }
?>

Link to comment
Share on other sites

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