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