node_tag_new

Definition

node_tag_new($nid)
modules/node/node.module, line 156

Description

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

Code

<?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());
    }
  }
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.