Pilots, Guests, Online in your site V2.0

1_Edit the  " frontpage_main.tpl" in /core/templates or /lib/Skins/.

2_ Place this code:

<h3>Users Online<br />
  <?php
$usersonline = StatsData::UsersOnline();
$guestsonline = StatsData::GuestsOnline();

?>
    </h3>
<h4 class="style6">Pilots Online </h4>
              <?php
      foreach($usersonline as $pilot)	

{

	echo "<p>";
	echo '<img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot->location).'" />';
	echo " {$pilot->firstname} {$pilot->lastname}<br />"; 
	echo "</p>";

}


?>
              <br />
              Have <?php echo count($usersonline);?> Pilots Online.
              <h4 class="style3">Guests Online </h4>
              <p class="txt-red10"> Have <?php echo count($guestsonline);?> Guests Online.</div>

4_ Have Good Flight´s…Be happy… ;D

Preview…

http://www.kafly.net

http://atc.kafly.net/

Thanks alot for this!

Excellent works straight off the page lol.

Thanks.

Great code it worked perfect but i added something more to it

Your code show this when there are no pilots on line

It looked extrange to me so i added this to your code under Pilots Online

<p class="txt-red10"> Have <?php echo count($usersonline);?> Pilots Online.

And now when there is no pilots online it shows this

and pilots online this

Happy coding and good landings…

Thank you,

any change is welcome ..

Have good flights …

;D

Nice, is it possible to add the Callsign of the Pilot instead of the name and lastname

Change this

echo " {$pilot->firstname} {$pilot->lastname}<br />";

For this one

echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid). ' ' .$pilot->firstname . ' ' . $pilot->lastname;

Result:

Thank you man

Sorry to be a pain, But is there anyway you can take the flag/country and name off so you would be left with basically the callsign?

eg:

PLS012, PLS001, PLS015, PLS040, etc…

Thomas.

Yup sure you can

just delete or comment this row

echo '<img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot->location).'" />';

and here

echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid). ' ' .$pilot->firstname . ' ' . $pilot->lastname;

erase this part

. ' ' .$pilot->firstname . ' ' . $pilot->lastname

Anyone know why this would be…When I sign in on my main computer to my site, it does not show me online; just says 0 pilots online and 1 guest.  But when I login on my other computer and sign in, it works correctly and show me online with my name and flag etc.  I am confused on that one?!??

Thankyou sooo much!

This will be added to our site on the next skin.

-Thomas.