PDA

View Full Version : [Fixed] Offline in User List, but still Online in Buddy List



Mystics
Mon 6th May '02, 3:50pm
Hi,

if a user is clicking on the logout-Link, he is (of course) no longer online in "Who's online", but he still is shown as online in the Buddy List (until the Cookie Timeout), because the Buddy-List-Function only checks the lastactivity row in the user-Table, and not the session Table.

To fix this, you have just to use a few lines of code out of vBulletin 2.0.3.
In 2.0.3 this function was correct and I really don't understand, why this has been cutting out of 2.2.x ;)

In usercp.php, search:
$sql="SELECT userid,username,invisible,lastactivity
FROM user
WHERE (user.userid='$buddyuserssql')
ORDER BY username";Replace it with:
$sql="SELECT DISTINCT session.lastactivity, user.userid,username,session.userid AS online,invisible
FROM user
LEFT JOIN session ON session.userid=user.userid
WHERE (user.userid='$buddyuserssql')
ORDER BY username";Still in usercp.php, search:
if ((!$buddy[invisible] or $bbuserinfo['usergroupid']==6) and $buddy[lastactivity]>$datecut) {Replace it with:
if ($buddy['online'] and $buddy['lastactivity']>$datecut and (!$buddy['invisible'] or $bbuserinfo['usergroupid']==6)) {Mystics

PS: Greetz fly out to SaschaW and tkeil69575

eva2000
Tue 7th May '02, 9:17am
moved for verification

Freddie Bingham
Tue 7th May '02, 4:07pm
Your fix will work but it is the less optimized way of doing it from v2.0.x

I have fixed this for v2.2.6