function _forum_user_last_visit in Drupal 6
Same name and namespace in other branches
- 4 modules/forum.module \_forum_user_last_visit()
- 5 modules/forum/forum.module \_forum_user_last_visit()
- 7 modules/forum/forum.module \_forum_user_last_visit()
1 call to _forum_user_last_visit()
- forum_get_topics in modules/
forum/ forum.module
File
- modules/
forum/ forum.module, line 937 - Enable threaded discussions about general topics.
Code
function _forum_user_last_visit($nid) {
global $user;
static $history = array();
if (empty($history)) {
$result = db_query('SELECT nid, timestamp FROM {history} WHERE uid = %d', $user->uid);
while ($t = db_fetch_object($result)) {
$history[$t->nid] = $t->timestamp > NODE_NEW_LIMIT ? $t->timestamp : NODE_NEW_LIMIT;
}
}
return isset($history[$nid]) ? $history[$nid] : NODE_NEW_LIMIT;
}