W3cubDocs

/Drupal 8

function history_read

history_read($nid)

Retrieves the timestamp for the current user's last view of a specified node.

Parameters

int $nid: A node ID.

Return value

int If a node has been previously viewed by the user, the timestamp in seconds of when the last view occurred; otherwise, zero.

File

core/modules/history/history.module, line 46
Records which users have read which content.

Code

function history_read($nid) {
  $history = history_read_multiple(array($nid));
  return $history[$nid];
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!history!history.module/function/history_read/8.1.x