$extraquery = "";
if (!$config['DISABLE_ONLINE_INVISIBLE'] && ($user['USER_MEMBERSHIP_LEVEL'] != "Administrator" && !preg_match("/Moderator/",$user['USER_MEMBERSHIP_LEVEL']))) {
$extraquery = "AND t2.USER_VISIBLE_ONLINE_STATUS = 'YES'";
}
$query = "
SELECT count( t1.USER_ID )
FROM ubbt_ONLINE AS t1, ubbt_USER_PROFILE AS t2
WHERE t1.USER_ID = t2.USER_ID
AND t1.USER_ID = ?
$extraquery
";
$sth = $dbh->do_placeholder_query($query,array($User),__LINE__,__FILE__);
list($isonline) = $dbh -> fetch_array($sth);
if (!$isonline) {
$mood = "offline.gif";
$mood_alt = $ubbt_LANG['OFFLINE'];
} else {
$mood_alt = "{$ubbt_LANG['ONLINE']} ".preg_replace("#.(gif|jpg|png)$#","",$mood);
}