| 5 forum.module | _forum_topics_unread($term, $uid) |
| 6 forum.module | _forum_topics_unread($term, $uid) |
| 7 forum.module | _forum_topics_unread($term, $uid) |
| 8 forum.module | _forum_topics_unread($term, $uid) |
Calculate the number of nodes the user has not yet read and are newer than NODE_NEW_LIMIT.
2 calls to _forum_topics_unread()
File
- modules/
forum/ forum.module, line 863 - Provides discussion forums.
Code
function _forum_topics_unread($term, $uid) {
$query = db_select('node', 'n');
$query->join('forum', 'f', 'n.vid = f.vid AND f.tid = :tid', array(':tid' => $term));
$query->leftJoin('history', 'h', 'n.nid = h.nid AND h.uid = :uid', array(':uid' => $uid));
$query->addExpression('COUNT(n.nid)', 'count');
return $query
->condition('status', 1)
->condition('n.created', NODE_NEW_LIMIT, '>')
->isNull('h.nid')
->addTag('node_access')
->execute()
->fetchField();
}
Login or register to post comments