function node_mark
Same name in other branches
- 7.x modules/node/node.module \node_mark()
- 9 core/modules/node/node.module \node_mark()
- 8.9.x core/modules/node/node.module \node_mark()
- 10 core/modules/node/node.module \node_mark()
Determines the type of marker to be displayed for a given node.
Parameters
int $nid: Node ID whose history supplies the "last viewed" timestamp.
int $timestamp: Time which is compared against node's "last viewed" timestamp.
Return value
int One of the MARK constants.
Deprecated
in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement.
See also
https://www.drupal.org/node/3514189
File
-
core/
modules/ node/ node.module, line 70
Code
function node_mark($nid, $timestamp) {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3514189', E_USER_DEPRECATED);
if (\Drupal::currentUser()->isAnonymous() || !\Drupal::moduleHandler()->moduleExists('history')) {
return MARK_READ;
}
$read_timestamp = history_read($nid);
if ($read_timestamp === 0 && $timestamp > HISTORY_READ_LIMIT) {
return MARK_NEW;
}
elseif ($timestamp > $read_timestamp && $timestamp > HISTORY_READ_LIMIT) {
return MARK_UPDATED;
}
return MARK_READ;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.