Jump to content

Recommended Posts

<?php 
$allusers = StatsData::UsersOnline(); 
foreach ( $allusers as $user) {

echo $user->firstname.'<br>;

}

?>

This is just a simple code, I guess this should help.

Share this post


Link to post
Share on other sites
31 minutes ago, LeonardIGO4036 said:

<?php 
$allusers = StatsData::UsersOnline(); 
foreach ( $allusers as $user) {

echo $user->firstname.'<br>;

}

?>

This is just a simple code, I guess this should help.

Thank you very much @LeonardIGO4036, but I would like to know one specific pilot.

So, I'm customizing Airmail for ElaSkin, and it will tell me if the user of the message is online. So from what I'm thinking I would have to get the ID of this pilot and continue, but I have no idea how.

Share this post


Link to post
Share on other sites
23 hours ago, CarlosEduardo2409 said:

Thank you very much @LeonardIGO4036, but I would like to know one specific pilot.

So, I'm customizing Airmail for ElaSkin, and it will tell me if the user of the message is online. So from what I'm thinking I would have to get the ID of this pilot and continue, but I have no idea how.

Okay, now i understood. You just need to amend this code with an extra conditional statement. 

 

<?php 
$allusers = StatsData::UsersOnline(); 

$pilotid = (assign it here);
foreach ( $allusers as $user) {

if($user->pilotid == $pilotid) {

echo 'Online';

} else {

echo 'Offline'; 

}

}

?>

That should be it! 

  • Like 1

Share this post


Link to post
Share on other sites
6 minutes ago, LeonardIGO4036 said:

Okay, now i understood. You just need to amend this code with an extra conditional statement

 

<?php 
$allusers = StatsData::UsersOnline(); 

$pilotid = (assign it here);
foreach ( $allusers as $user) {

if($user->pilotid == $pilotid) {

echo 'Online';

} else {

echo 'Offline'; 

}

}

?>

That should be it! 

Amazing! Thank you so much!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×