node_tag_new

  1. drupal
    1. 4.7
    2. 5 node.module
    3. 6 node.module
    4. 7 node.module
Versions
4.7 – 6 node_tag_new($nid)
7 node_tag_new($node)

Update the 'last viewed' timestamp of the specified node for current user.

▾ 1 function calls node_tag_new()

node_show in modules/node.module
Generate a page displaying a single node, along with its comments.

Code

modules/node.module, line 91

<?php
function node_tag_new($nid) {
  global $user;

  if ($user->uid) {
    if (node_last_viewed($nid)) {
      db_query('UPDATE {history} SET timestamp = %d WHERE uid = %d AND nid = %d', time(), $user->uid, $nid);
    }
    else {
      @db_query('INSERT INTO {history} (uid, nid, timestamp) VALUES (%d, %d, %d)', $user->uid, $nid, time());
    }
  }
}
?>