PDA

View Full Version : Online status glitch with friendlist


Hall of Famer
04-05-2012, 08:19 AM
Users on friendlist always appear as online, while they appear as offline when they actually are online
So you see the problem already, the online/offline checker is malfunctioning and does its job completely the opposite to what it is supposed to. To fix it, simply go to functions_users.php at around line 16-20(it is line 18 for me, but can differ for you guys/gals), change the code is_object($row) to !is_object($row). This will reverse the online/offline checker's action, and thus resolving this tiny glitch. Note it is fixed in Mys v1.3.1 already.

solskenn
04-05-2012, 10:59 AM
I couldn't find this in mine. I copied all the surrounding code around it and pasted it here.
The following is on lines 12-24

function usernametouid($name){
$stmt = $GLOBALS['adopts']->query("SELECT * FROM {$GLOBALS['prefix']}users WHERE username='{$name}'");
$row = $stmt->fetch(PDO::FETCH_ASSOC);
return $row['uid'];
}

function getonlinestatus($name) {
$stmt = $GLOBALS['adopts']->query("SELECT * FROM {$GLOBALS['prefix']}online WHERE username='{$name}'");
$row = $stmt->fetch(PDO::FETCH_ASSOC);

if(is_array($row)) $onlinestatus = "<img src='templates/icons/user_offline.gif'>";
else $onlinestatus = "<img src='templates/icons/user_online.gif'>";
return $onlinestatus;

Hall of Famer
04-06-2012, 08:29 AM
Oh my goodness, sorry about that I changed arrays to objects in my scripts. In your case, just change if(is_array($row)) to if(!is_array($row)) and it should work flawlessly.