Quote:
Originally posted by GamerForums
Since I installed this hack I have the private messages column appear to guests, with null stats. I'm assuming this was something to to with the modifications to index.php? Can anyone advise me on how to prevent this from happening?
|
No doubt someone will speak out with a better way of doing this, my way is probably a bit of a fudge, but. . .
I got around this problem by replacing step 2 with:
PHP Code:
// Buddy Messenger v1.1
if ($enablepms==1 and $permissions['canusepm'] and $bbuserinfo['receivepm']) {
$datecut = time() - $cookietimeout;
$buddyuserssql=str_replace(" ","' OR user.userid='",$bbuserinfo[buddylist]);
$sql="SELECT DISTINCT session.lastactivity, user.userid,username,NOT ISNULL(session.sessionhash) AS online,invisible
FROM user
LEFT JOIN session ON session.userid=user.userid
WHERE (user.userid='$buddyuserssql')
ORDER BY username";
//$sql="SELECT * FROM user WHERE (userid='$buddyuserssql') AND invisible=0 ORDER BY username";
$buddys=$DB_site->query($sql);
$onlinebuddy="";
$offlinebuddy="";
while ($buddy=$DB_site->fetch_array($buddys)) {
if ($userdone[$buddy[userid]]) {
continue;
} else {
$userdone[$buddy[userid]]=1;
}
if ($buddy[online] and !$buddy[invisible] and $buddy[lastactivity]>$datecut) {
$onoff="{buddyon}";
} else {
$onoff="{buddyoff}";
}
eval("\$var = \"".gettemplate("buddy_messenger")."\";");
if ($buddy[online] and !$buddy[invisible] and $buddy[lastactivity]>$datecut) {
$onlinebuddy.=$var;
} else {
$offlinebuddy.=$var;
}
}
eval("\$pminfo = \"".gettemplate('forumhome_pmloggedin')."\";");
}
// End Of Buddy Messenger v1.1