_forum_user_last_visit

Versions
4.6 – 7
_forum_user_last_visit($nid)

Code

modules/forum/forum.module, line 917

<?php
function _forum_user_last_visit($nid) {
  global $user;
  static $history = array();

  if (empty($history)) {
    $result = db_query('SELECT nid, timestamp FROM {history} WHERE uid = %d', $user->uid);
    while ($t = db_fetch_object($result)) {
      $history[$t->nid] = $t->timestamp > NODE_NEW_LIMIT ? $t->timestamp : NODE_NEW_LIMIT;
    }
  }
  return isset($history[$nid]) ? $history[$nid] : NODE_NEW_LIMIT;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.