Ah, its because I commented out the following queries in index.php
PHP Code:
$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
$newpm=$DB_site->query_ffirst("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");
$newpm['messages']=$allpm['newpm'];
$unreadpm['messages']=$allpm['unreadpm'];
and replaced by
PHP Code:
$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages,
SUM(IF(dateline>$bbuserinfo[lastvisit] AND folderid=0,1,0)) AS newpm,
SUM(IF(messageread=0 AND folderid=0,1,0)) AS unreadpm
FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
$newpm['messages']=$allpm['newpm'];
$unreadpm['messages']=$allpm['unreadpm'];
I'll changed the end part to
PHP Code:
if ($allpm['newpm'] == "") {
$newpm['messages']="0";
} else {
$newpm['messages']=$allpm['newpm'];
}
if ($allpm['unreadpm'] == "") {
$unreadpm['messages']="0";
} else {
$unreadpm['messages']=$allpm['unreadpm'];
}
But it hasnt worked yet. I'll keep playing.