'node/markasread', 'title' => t('mark all content read'), 'callback' => '_markasread', 'access' => user_access('access content'), 'type' => MENU_CALLBACK); } return $toreturn; } function _markasread() { global $user; if ($user && $user->uid) { if (isset($_POST['edit']['tid'])) { $tid = $_POST['edit']['tid']; if (is_numeric($tid) && $tid) { db_query("REPLACE INTO {history} (uid,nid,timestamp) SELECT '%d',n.nid,UNIX_TIMESTAMP() FROM {node} n INNER JOIN {term_node} r ON n.nid=r.nid INNER JOIN {node_comment_statistics} l ON l.nid=n.nid WHERE (n.created > '%d' OR l.last_comment_timestamp > '%d') AND r.tid='%d'", $user->uid,NODE_NEW_LIMIT,NODE_NEW_LIMIT,$tid); drupal_goto("forum/$tid"); } else { db_query("REPLACE INTO {history} (uid,nid,timestamp) SELECT '%d',n.nid,UNIX_TIMESTAMP() FROM {node} n INNER JOIN {node_comment_statistics} l ON l.nid=n.nid WHERE (n.created > '%d' OR l.last_comment_timestamp > '%d')", $user->uid,NODE_NEW_LIMIT,NODE_NEW_LIMIT); drupal_goto("forum"); } print theme('page',"All content has been marked read"); } } drupal_goto('forum'); }