Hi Laloeka, welcome to SMF!
Have you already included SSI.php in that PHP file?
If so, do this for every user:
loadMemberData(userid);
And don't forget to global $user_profile.
Then, you can use this:
$is_online[id] = $user_profile[id]['is_online'] === 0 ? false : true;Replacing id with the user ID.
Then you can use $is_online[id] to check if an user is online.