Jump to content

User Online


Recommended Posts

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.

Link to comment
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
Link to comment
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!!

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