Allow paginating package comments

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Johannes Löthberg 2018-08-06 02:02:58 +02:00 committed by Lukas Fleischer
parent 3578e77ad4
commit 257115943e
2 changed files with 6 additions and 4 deletions

View file

@ -291,9 +291,10 @@ function pkgbase_display_details($base_id, $row, $SID="") {
unset($pinned); unset($pinned);
$limit = isset($_GET['comments']) ? 0 : 10; $total_comment_count = pkgbase_comments_count($base_id, $include_deleted);
$comments = pkgbase_comments($base_id, $limit, $include_deleted); list($pagination_templs, $per_page, $offset) = calculate_pagination($total_comment_count);
$comments = pkgbase_comments($base_id, $per_page, $include_deleted, false, $offset);
if (!empty($comments)) { if (!empty($comments)) {
$comment_section = "package"; $comment_section = "package";
include('pkg_comments.php'); include('pkg_comments.php');

View file

@ -630,9 +630,10 @@ function pkg_display_details($id=0, $row, $SID="") {
unset($pinned); unset($pinned);
$limit = isset($_GET['comments']) ? 0 : 10; $total_comment_count = pkgbase_comments_count($base_id, $include_deleted);
$comments = pkgbase_comments($base_id, $limit, $include_deleted); list($pagination_templs, $per_page, $offset) = calculate_pagination($total_comment_count);
$comments = pkgbase_comments($base_id, $per_page, $include_deleted, false, $offset);
if (!empty($comments)) { if (!empty($comments)) {
$comment_section = "package"; $comment_section = "package";
include('pkg_comments.php'); include('pkg_comments.php');