Jump to content

Pilots, Guests, Online in your site V2.0


Ivan André

Recommended Posts

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/

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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

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