function generateNavibar($page) { $prev = getPrev($page); $next = getNext($page); $prev5 = getPrev($page, 5); $next5 = getNext($page, 5); $page = intval($page); $html = ''; $html .= '<form>'; $html .= createButton($prev5, !doesPageExist("{$prev5}"), '<<'); $html .= createButton($prev, !doesPageExist("{$prev}"), '<'); $html .= "</form>"; $html .= createDropDownMenu($page, getFileCountInDirectory('pages/')); $html .= '<form>'; $html .= createButton($next, !doesPageExist("{$next}"), '>'); $html .= createButton($next5, !doesPageExist("{$next5}"), '>>'); $html .= "</form>"; return $html; }
function showPagination($META, $url, $currentPage, $prevOn, $nextOn, $pageNav) { if ($prevOn) { $pageNav[] = "<a href='" . $url . ($currentPage - 1) . "'>" . getPrev() . "</a>"; } if ($nextOn) { $pageNav[] = "<a href='" . $url . ($currentPage + 1) . "'>" . getNext() . "</a>"; } if (count($pageNav)) { echo "<ul style=\"list-style: none;\">\n<li style=\"float: left;margin-right: 15px;\">" . implode("</li>\n<li style=\"float: left;margin-right: 15px;\">", $pageNav) . "</li>\n</ul><br/>\n"; } }
<div class="nextprevbar"> <div class="prev"><?php echo getPrev(); ?> </div> <div class="next"><?php echo getNext(); ?> </div> </div> <?php echo printAll(); ?> <div class="nextprevbar"> <div class="prev"><?php echo getPrev(); ?> </div> <div class="next"><?php echo getNext(); ?> </div> </div> <?php } else { require_once 'include/pages/_login.php'; } ?>