1 node.module node_mark($nid, $timestamp)

Decides on the type of marker to be displayed for a given node.


$nid: Node ID whose history supplies the "last viewed" timestamp.

$timestamp: Time which is compared against node's "last viewed" timestamp.

Return value

int: One of the MARK constants.


core/modules/node/node.module, line 353
The core module that allows content to be submitted to the site.


function node_mark($nid, $timestamp) {
  global $user;
  $cache = &backdrop_static(__FUNCTION__, array());

  if (!$user->uid) {
    return MARK_READ;
  if (!isset($cache[$nid])) {
    $cache[$nid] = node_last_viewed($nid);
  if ($cache[$nid] == 0 && $timestamp > NODE_NEW_LIMIT) {
    return MARK_NEW;
  elseif ($timestamp > $cache[$nid] && $timestamp > NODE_NEW_LIMIT) {
    return MARK_UPDATED;
  return MARK_READ;