Jump to content

Recommended Posts

Posted

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

user1.jpg

http://www.kafly.net

http://atc.kafly.net/

Posted

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

Your code show this when there are no pilots on line

user3.jpg

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

user2.jpg

and pilots online this

user1.jpg

Happy coding and good landings...

  • 2 weeks later...
Posted

Change this

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

For this one

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

Result:

user4.jpg

Posted

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.

Posted

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

Posted

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?!??

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