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/
Excellent works straight off the page lol.
Thanks.
g3r84
January 15, 2010, 7:06pm
4
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…
pouzo
January 30, 2010, 9:45am
6
Nice, is it possible to add the Callsign of the Pilot instead of the name and lastname
g3r84
January 31, 2010, 4:21am
7
Change this
echo " {$pilot->firstname} {$pilot->lastname}<br />";
For this one
echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid). ' ' .$pilot->firstname . ' ' . $pilot->lastname;
Result:
Thomas
February 1, 2010, 5:21pm
9
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.
g3r84
February 2, 2010, 12:43am
10
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
CPC900
February 2, 2010, 2:28pm
11
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?!??
Thomas
February 2, 2010, 4:25pm
12
Thankyou sooo much!
This will be added to our site on the next skin.
-Thomas.