Versions
5 – 7
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()

domain_content_form in contrib-6/domain/domain_content/domain_content.admin.inc
Rewrites node_admin_nodes() to use db_rewrite_sql().
node_admin_nodes in drupal-6/modules/node/node.admin.inc
Form builder: Builds the node administration overview.
theme_comment_view in drupal-6/modules/comment/comment.module
Themes a single comment and related items.
tracker_page in drupal-6/modules/tracker/tracker.pages.inc
Menu callback. Prints a listing of active nodes on the site.

Code

drupal-6/modules/node/node.module, line 200

<?php
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;
}
?>

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options