royceair Posted March 5, 2011 Report Share Posted March 5, 2011 Hello, I have a small Problem with kACARS: If a Pilot is logged in phpvms AND started a flight with the client, then he's shown twice. Any ideas to fix that? phpvms:Version 2.1.934 kACARS: kACARS_Free Application v1.0.0.8 Chris <div id="Info"> <h3>Users Online</h3> <?php $usersonline = StatsData::UsersOnline(); $guestsonline = StatsData::GuestsOnline(); foreach($usersonline as $pilot) { echo '<p><img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot->location).'" />'; echo " {$pilot->firstname} {$pilot->lastname}</p>"; }?> <p>Pilots Online: <?php echo count($usersonline);?> / Guests Online: <?php echo count($guestsonline);?></p><br /> </div> Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted March 5, 2011 Report Share Posted March 5, 2011 This has been gone over before. <?php $shown = array(); foreach($usersonline as $pilot) { if(in_array($pilot->pilotid, $shown)) continue; else $shown[] = $pilot->pilotid; echo '<img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot->location).'" />'; echo " {$pilot->firstname} {$pilot->lastname}<br />"; } ?> Quote Link to comment Share on other sites More sharing options...
flyalaska Posted March 5, 2011 Report Share Posted March 5, 2011 Thanks for the fix. I have been having this problem for several months now and never knew their was a fix for it. Quote Link to comment Share on other sites More sharing options...
royceair Posted March 6, 2011 Author Report Share Posted March 6, 2011 Thanks for the fast reply - it works! chris Quote Link to comment Share on other sites More sharing options...
flyalaska Posted March 6, 2011 Report Share Posted March 6, 2011 Of course it does, lol! Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted April 4, 2011 Report Share Posted April 4, 2011 I got this to work. Thanks for the fix. Now it shows me only logged in one time as it should. But in the pilot's online/Guests online it shows 2 pilots online and I am the only one logged in at this time. Issue on my end maybe? Quote Link to comment Share on other sites More sharing options...
Txmmy83 Posted April 5, 2011 Report Share Posted April 5, 2011 Jeffrey, thanks for that! but where does that fix need to put in? kacars module php? Best Regards Thomas Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted April 5, 2011 Report Share Posted April 5, 2011 Where ever you have the list of online pilots. Depending on your skin it could be multiple places. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted April 5, 2011 Report Share Posted April 5, 2011 Where ever you have the list of online pilots. Depending on your skin it could be multiple places. Your first choice would be to look on the layout tpl file or front page main. BUT I suggest looking at layout.tpl file first. Quote Link to comment Share on other sites More sharing options...
HighFlyerPL185 Posted December 17, 2011 Report Share Posted December 17, 2011 Sorry for bumping this quite old topic but I don't feel like this needs a new topic. I'm not great at PHP, how would I add a Pilot Code before the pilot name and a link to their profile? Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted December 20, 2011 Report Share Posted December 20, 2011 Sorry for bumping this quite old topic but I don't feel like this needs a new topic. I'm not great at PHP, how would I add a Pilot Code before the pilot name and a link to their profile? This is not a kACARS question. Please ask in the general support forum. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.