node_mark

5 node.module node_mark($nid, $timestamp)
6 node.module node_mark($nid, $timestamp)
7 node.module node_mark($nid, $timestamp)
8 node.module 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.

3 calls to node_mark()

File

modules/node/node.module, line 200
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

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

Comments

How to change so New and Update appear to current user

I've got a client that wants to be able to see the "new" and "updated" markers next to nodes listed on /admin/content/node. I've found that the default Drupal 6 functionality only shows those markers to other users with admin priviledges and not the current user that, say just created the node or just updated the node. How can this be changed to make them display to the current admin?

Any help would be appreciated. I'm not much of a programmer and still learning D6 2+ years later but just can't seem to wrap my head around how to accomplish this seemingly simple change.

Login or register to post comments