function privatemsg_unread_count in Privatemsg 6
Same name and namespace in other branches
- 6.2 privatemsg.module \privatemsg_unread_count()
- 7.2 privatemsg.module \privatemsg_unread_count()
- 7 privatemsg.module \privatemsg_unread_count()
Return number of unread messages for an account.
Parameters
$account: Specifiy the user for which the unread count should be loaded.
Related topics
3 calls to privatemsg_unread_count()
File
- ./
privatemsg.module, line 726 - Allows users to send private messages to other users.
Code
function privatemsg_unread_count($account = NULL) {
static $counts = array();
if (!$account || $account->uid == 0) {
global $user;
$account = $user;
}
if (!isset($counts[$account->uid])) {
$query = _privatemsg_assemble_query('unread_count', $account);
$counts[$account->uid] = db_result(db_query($query['query']));
}
return $counts[$account->uid];
}