File
- modules/forum/forum.module, line 1223
- Provides discussion forums.
Code
function _forum_user_last_visit($nid) {
global $user;
$history = &drupal_static(__FUNCTION__, array());
if (empty($history)) {
$result = db_query('SELECT nid, timestamp FROM {history} WHERE uid = :uid', array(':uid' => $user->uid));
foreach ($result as $t) {
$history[$t->nid] = $t->timestamp > NODE_NEW_LIMIT ? $t->timestamp : NODE_NEW_LIMIT;
}
}
return isset($history[$nid]) ? $history[$nid] : NODE_NEW_LIMIT;
}
Login or
register to post comments