Same name and namespace in other branches
  1. 10 core/modules/node/node.module \node_mark()
  2. 4.7.x modules/node.module \node_mark()
  3. 5.x modules/node/node.module \node_mark()
  4. 6.x modules/node/node.module \node_mark()
  5. 7.x modules/node/node.module \node_mark()
  6. 8.9.x core/modules/node/node.module \node_mark()
  7. 9 core/modules/node/node.module \node_mark()

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

Parameters

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

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

Return value

One of the MARK constants.

3 calls to node_mark()
comment_admin_overview in modules/comment.module
Menu callback; present an administrative comment listing.
node_admin_nodes in modules/node.module
Generate the content administration overview.
tracker_page in modules/tracker.module
Menu callback. Prints a listing of active nodes on the site.

File

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

Code

function node_mark($nid, $timestamp) {
  global $user;
  static $cache;
  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;
}