/* Page for managing all of the comments in the apidb */ /* Without having go into each application version to do so */ include("path.php"); include(BASE."include/"."incl.php"); require(BASE."include/"."comments.php"); apidb_header("Comments"); function display_range($currentPage, $pageRange, $totalPages, $commentsPerPage) { /* display the links to each of these pages */ if($currentPage != 0) { $previousPage = $currentPage - 1; echo "Previous "; } else echo "Previous "; /* display the next 10 and previous 10 pages */ $pageRange = 10; if($currentPage > $pageRange) $startPage = $currentPage - $pageRange; else $startPage = 0; if($currentPage + $pageRange < $totalPages) $endPage = $currentPage + $pageRange; else $endPage = $totalPages; /* display the desired range */ for($x = $startPage; $x <= $endPage; $x++) { if($x != $currentPage) echo "$x "; else echo "$x "; } if($currentPage < $totalPages) { $nextPage = $currentPage + 1; echo "Next "; } else echo "Next "; } $commentsPerPage = 10; $currentPage = 0; if($_REQUEST['page']) $currentPage = $_REQUEST['page']; if($_REQUEST['commentsPerPage']) $commentsPerPage = $_REQUEST['commentsPerPage']; $totalPages = floor(getNumberOfComments()/$commentsPerPage); if($commentsPerPage > 100) $commentsPerPage = 100; /* display page selection links */ echo "