summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2018-08-06 02:02:58 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2018-08-06 06:03:58 +0200
commit257115943e2a3350bf29ad3ab72fc50a6ae60e7d (patch)
tree192d0a9c23fb6d54b405885fa99b6551ef4b8924 /web/lib
parent3578e77ad4e9258495eed7e786b7dc3aebcf1b63 (diff)
downloadaur-257115943e2a3350bf29ad3ab72fc50a6ae60e7d.tar.gz
aur-257115943e2a3350bf29ad3ab72fc50a6ae60e7d.tar.xz
Allow paginating package comments
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/pkgbasefuncs.inc.php5
-rw-r--r--web/lib/pkgfuncs.inc.php5
2 files changed, 6 insertions, 4 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index 953a5817..b39bca5b 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -291,9 +291,10 @@ function pkgbase_display_details($base_id, $row, $SID="") {
unset($pinned);
- $limit = isset($_GET['comments']) ? 0 : 10;
- $comments = pkgbase_comments($base_id, $limit, $include_deleted);
+ $total_comment_count = pkgbase_comments_count($base_id, $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)) {
$comment_section = "package";
include('pkg_comments.php');
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 140b8fc2..ced1f8e2 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -630,9 +630,10 @@ function pkg_display_details($id=0, $row, $SID="") {
unset($pinned);
- $limit = isset($_GET['comments']) ? 0 : 10;
- $comments = pkgbase_comments($base_id, $limit, $include_deleted);
+ $total_comment_count = pkgbase_comments_count($base_id, $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)) {
$comment_section = "package";
include('pkg_comments.php');