<?php
function next_node_link($type, $object, $teaser = FALSE) {
  $links = array();

  if ($type == 'node' && isset($object->nid)) {
    if (!$teaser) {
      if (user_access('access content')) { // do permission checks - this is fairly open
        $nid = db_result(db_query_range("SELECT nid from {node} WHERE status = 1 AND nid > %d ORDER BY nid", $object->nid, 0, 1));
        if($nid) { 
          $links['next'] = array(
            'title' => t('Next node'),
            'href' => 'node/'. $nid,
            'attributes' => array('title' => t('The next entered node.'))
          );
        }
      }
    }
  }
  return $links;
}