function node_mark

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

One of the MARK constants.

4 calls to node_mark()
CommentStorageController::attachLoad in drupal/core/modules/comment/lib/Drupal/comment/CommentStorageController.php
Overrides Drupal\Core\Entity\DatabaseStorageController::attachLoad().
node_admin_nodes in drupal/core/modules/node/
Returns the admin form object to node_admin_content().
theme_node_recent_content in drupal/core/modules/node/node.module
Returns HTML for a recent node to be displayed in the recent content block.
tracker_page in drupal/core/modules/tracker/
Page callback: Generates a page of tracked nodes for the site.


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


function node_mark($nid, $timestamp) {
  global $user;
  $cache =& drupal_static(__FUNCTION__, array());
  if (!$user->uid || !module_exists('history')) {
    return MARK_READ;
  if (!isset($cache[$nid])) {
    $cache[$nid] = history_read($nid);
  if ($cache[$nid] == 0 && $timestamp > HISTORY_READ_LIMIT) {
    return MARK_NEW;
  elseif ($timestamp > $cache[$nid] && $timestamp > HISTORY_READ_LIMIT) {
    return MARK_UPDATED;
  return MARK_READ;