Jump to first unread comment in post

  1. <?php
  2. // Fetch the next node id from the readpath
  3. $next_id = readpath_get_next_nid();
  4.  
  5. // Get the page # and comment id if any
  6. $link_info = readpath_get_link_info($next_nid);
  7.  
  8. // Make a link straight to the first unread comment on the node
  9. $link_to_next_unread = l("View first unread post", "node/$next_id", NULL, $link_info['query'], $link_info['fragment']);
  10.  
  11. print $link_to_next_unread;
  12. ?>