node_mark

  1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
Versions
5 – 8 node_mark($nid, $timestamp)

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.

▾ 4 functions call node_mark()

CommentController::attachLoad in modules/comment/comment.module
Attaches data to entities upon loading. This will attach fields, if the entity is fieldable. It calls hook_entity_load() for modules which need to add data to all entities. It also calls hook_TYPE_load() on the loaded entities. For…
node_admin_nodes in modules/node/node.admin.inc
Form builder: Builds the node administration overview.
theme_node_recent_content in modules/node/node.module
Returns HTML for a recent node to be displayed in the recent content block.
tracker_page in modules/tracker/tracker.pages.inc
Menu callback; prints a listing of active nodes on the site.

Code

modules/node/node.module, line 341

<?php
function node_mark($nid, $timestamp) {
  global $user;
  $cache = &drupal_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;
}
?>