diff --git a/admin/adminCommentView.php b/admin/adminCommentView.php index 2831ac1..f08d71f 100644 --- a/admin/adminCommentView.php +++ b/admin/adminCommentView.php @@ -10,91 +10,54 @@ require(BASE."include/comment.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 a range of 10 pages */ +$pageRange = 10; - /* 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; +$ItemsPerPage = 10; +$currentPage = 1; +if($_REQUEST['ItemsPerPage']) + $ItemsPerPage = $_REQUEST['ItemsPerPage']; if($_REQUEST['page']) $currentPage = $_REQUEST['page']; -if($_REQUEST['commentsPerPage']) - $commentsPerPage = $_REQUEST['commentsPerPage']; +$totalPages = ceil(getNumberOfComments()/$ItemsPerPage); -$totalPages = floor(getNumberOfComments()/$commentsPerPage); +if($ItemsPerPage > 100) $ItemsPerPage = 100; -if($commentsPerPage > 100) $commentsPerPage = 100; /* display page selection links */ echo "