Jump to content

[solved] A code for the number of pilots currently flying?


Recommended Posts

Guest lorathon
Posted

Use this


there are <?php echo count(ACARSData::GetACARSData());?> xacars flights - click <a href="<?php echo SITE_URL?>/index.php/acars">here</a> to view

Posted

Use this


there are <?php echo count(ACARSData::GetACARSData());?> xacars flights - click <a href="<?php echo SITE_URL?>/index.php/acars">here</a> to view

Thats great! thank you so much!

Posted

Use this


there are <?php echo count(ACARSData::GetACARSData());?> xacars flights - click <a href="<?php echo SITE_URL?>/index.php/acars">here</a> to view

I was also just thinking, is there anyway to make the text to not show up when there are no xacar flights?

  • Administrators
Posted

You can assign the count to a variable like

$pilotsflying = count(ACARSData::GetACARSData());

then use an if command to check to see if the count is greater than 0

if($pilotsflying > 0)
  {
     Do Stuff
  }

Posted

You can assign the count to a variable like

$pilotsflying = count(ACARSData::GetACARSData());

then use an if command to check to see if the count is greater than 0

if($pilotsflying > 0)
  {
     Do Stuff
  }

I'm not so great with php coding, but where do i put the

if($pilotsflying > 0)
  {
     Do Stuff
  }

? I have tried putting the code all over the place but it doesnt work? one way i did it was this way:

<marquee align="left" direction="left" onmouseover="this.stop();" onmouseout="this.start();" behavior="scroll" width="600"></i>There are <?php echo count(ACARSData::GetACARSData());?> if($pilotsflying > 0)
  {
	<i>currently no</i>   }
xacars flights - </i><b>click here to view </b></marquee></

which is wrong as it does not come out There are if($pilotsflying > 0)

{

<i>currently no</i> }

xacars flights - </i><b>click here to view. sorry if this seems like a stupid question:S,

James

  • Administrators
Posted

try something like this


<?php
   $pilotsflying = count(ACARSData::GetACARSData()); 
       echo '<marquee align="left" direction="left" onmouseover="this.stop();" onmouseout="this.start();" behavior="scroll" width="600">';
       if($pilotsflying > 0)
           { echo 'There are '.$pilotsflying.' xacars flights - click <a href="'.SITE_URL.'/index.php/acars">here</a> to view'; }
           else
           { echo 'Welcome to our site'; }
       echo '</marquee>';
?>

Posted

try something like this


<?php
   $pilotsflying = count(ACARSData::GetACARSData()); 
       echo '<marquee align="left" direction="left" onmouseover="this.stop();" onmouseout="this.start();" behavior="scroll" width="600">';
       if($pilotsflying > 0)
           { echo 'There are '.$pilotsflying.' xacars flights - click <a href="'.SITE_URL.'/index.php/acars">here</a> to view'; }
           else
           { echo 'Welcome to our site'; }
       echo '</marquee>';
?>

That is brilliant, thank you so much!!

James

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