node_last_viewed
modules/node/node.module, строка 173
- Версии
- 5 – 6
node_last_viewed($nid)
Retrieves the timestamp at which the current user last viewed the specified node.
Код
<?php
function node_last_viewed($nid) {
global $user;
static $history;
if (!isset($history[$nid])) {
$history[$nid] = db_fetch_object(db_query("SELECT timestamp FROM {history} WHERE uid = %d AND nid = %d", $user->uid, $nid));
}
return (isset($history[$nid]->timestamp) ? $history[$nid]->timestamp : 0);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии