| Versions | |
|---|---|
| 4.7 – 7 | _forum_user_last_visit($nid) |
modules/
<?php
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;
}
?>