Zeile 508 | Zeile 508 |
---|
{ global $db, $mybb; static $pm_lastvisit_cache;
|
{ global $db, $mybb; static $pm_lastvisit_cache;
|
| $uid = intval($uid);
|
// If no user id, assume that we mean the current logged in user.
|
// If no user id, assume that we mean the current logged in user.
|
if(intval($uid) == 0)
| if($uid == 0)
|
{ $uid = $mybb->user['uid']; }
| { $uid = $mybb->user['uid']; }
|
Zeile 525 | Zeile 527 |
---|
{ if(!$pm_lastvisit_cache[$uid]) {
|
{ if(!$pm_lastvisit_cache[$uid]) {
|
$query = $db->query("SELECT lastvisit FROM ".TABLE_PREFIX."users WHERE uid='".intval($uid)."'");
| $query = $db->query("SELECT lastvisit FROM ".TABLE_PREFIX."users WHERE uid='".$uid."'");
|
$user = $db->fetch_array($query); $pm_lastvisit_cache[$uid] = $user['lastvisit']; }
| $user = $db->fetch_array($query); $pm_lastvisit_cache[$uid] = $user['lastvisit']; }
|
Zeile 533 | Zeile 535 |
---|
} // Update total number of messages. if($count_to_update & 1)
|
} // Update total number of messages. if($count_to_update & 1)
|
{
| {
|
$query = $db->query("SELECT COUNT(pmid) AS pms_total FROM ".TABLE_PREFIX."privatemessages WHERE uid='".$uid."'"); $total = $db->fetch_array($query); $pmcount['totalpms'] = $total['pms_total'];
| $query = $db->query("SELECT COUNT(pmid) AS pms_total FROM ".TABLE_PREFIX."privatemessages WHERE uid='".$uid."'"); $total = $db->fetch_array($query); $pmcount['totalpms'] = $total['pms_total'];
|
Zeile 544 | Zeile 546 |
---|
$query = $db->query("SELECT COUNT(pmid) AS pms_new FROM ".TABLE_PREFIX."privatemessages WHERE uid='".$uid."' AND dateline>'".$lastvisit."' AND folder=1"); $new = $db->fetch_array($query); $pmcount['newpms'] = $new['pms_new'];
|
$query = $db->query("SELECT COUNT(pmid) AS pms_new FROM ".TABLE_PREFIX."privatemessages WHERE uid='".$uid."' AND dateline>'".$lastvisit."' AND folder=1"); $new = $db->fetch_array($query); $pmcount['newpms'] = $new['pms_new'];
|
}
| }
|
// Update number of unread messages. if($count_to_update & 4) {
| // Update number of unread messages. if($count_to_update & 4) {
|
Zeile 554 | Zeile 556 |
---|
} if(is_array($pmcount)) {
|
} if(is_array($pmcount)) {
|
$db->update_query(TABLE_PREFIX."users", $pmcount, "uid='".intval($uid)."'");
| $db->update_query(TABLE_PREFIX."users", $pmcount, "uid='".$uid."'");
|
} return $pmcount;
|
} return $pmcount;
|
}
/** * Return a list of banned usernames. * * @return array The array of banned usernames. */ function get_banned_usernames() { $bannedusernames = explode(",", $mybb->settings['bannedusernames']); return $bannedusernames;
| |
}
/**
| }
/**
|