PDA

View Full Version : Online status on profile


LOD-squa
01-22-2003, 01:01 AM
Hello everyone I'm currently trying to add the online status on the profile but I have this code

if ($post['lastactivity'] > $datecut and !$post['invisible'] and $post['lastvisit'] != $post['lastactivity']) {

eval("\$userinfo[onlinestatus] = \"".gettemplate("getinfo_online")."\";");

} else {

eval("\$userinfo[onlinestatus] = \"".gettemplate("getinfo_offline")."\";");

}


I add $userinfo[onlinestatus] on getinto but the icons always appear has offline >_<

Xenon
01-22-2003, 11:34 AM
obviously, because the variable $post would be empty...

use this:
if ($userinfo['lastactivity'] > $datecut and !$userinfo['invisible'] and $userinfo['lastvisit'] != $userinfo['lastactivity']) {

eval("\$userinfo[onlinestatus] = \"".gettemplate("getinfo_online")."\";");

} else {

eval("\$userinfo[onlinestatus] = \"".gettemplate("getinfo_offline")."\";");

}

LOD-squa
01-22-2003, 05:32 PM
Yes, it is working now. Thanks Xenon

LOD-squa
01-26-2003, 01:46 AM
Sorry to double post but can you help me again. Whenever users are offline it will show them has online know why?

Xenon
01-26-2003, 10:12 AM
i think this part in the condition:
$userinfo['lastactivity'] > $datecut

should be like this:
$userinfo['lastactivity'] > time() - $cookietimeout

LOD-squa
01-26-2003, 11:24 PM
Works like a charm thanks.

Xenon
01-27-2003, 01:36 PM
you'Re welcome :)