/** * Show a link to go to the previous article and to the next article * * According to a module's option "showprevnextlink" ("Show Previous and Next link ?") * you can display, at the bottom of each article, two links used to navigate thru stories. * This feature uses the module's option "restrictindex" so that we can, or can't see * restricted stories */ if (nw_getmoduleoption('showprevnextlink', NW_MODULE_DIR_NAME)) { $xoopsTpl->assign('nav_links', true); $tmparticle = new nw_NewsStory(); $nextId = $previousId = -1; $next = $previous = array(); $previousTitle = $nextTitle = ''; $next = $tmparticle->getNextArticle($storyid, $xoopsModuleConfig['restrictindex']); if(count($next) > 0) { $nextId = $next['storyid']; $nextTitle = $next['title']; } $previous = $tmparticle->getPreviousArticle($storyid, $xoopsModuleConfig['restrictindex']); if(count($previous) > 0) { $previousId = $previous['storyid']; $previousTitle = $previous['title']; } $xoopsTpl->assign('previous_story_id',$previousId); $xoopsTpl->assign('next_story_id',$nextId); if($previousId > 0) { $xoopsTpl->assign('previous_story_title',$previousTitle);