function _forum_user_last_visit in Drupal 4
Same name and namespace in other branches
- 5 modules/forum/forum.module \_forum_user_last_visit()
- 6 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.module
File
- modules/
forum.module, line 1094 - 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 $history[$nid] ? $history[$nid] : NODE_NEW_LIMIT;
}