From e8827ce7d486ed977d8311ca390f9a95ab2887dc Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 30 Apr 2018 09:42:53 +0200 Subject: [PATCH] Fix post pagebreak Before, the older entries button showed if the amount of posts was equal to the pagesize, even though there were no more entries to be shown after clicking the button. --- blog.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/blog.php b/blog.php index df810aa..94acba4 100644 --- a/blog.php +++ b/blog.php @@ -249,7 +249,7 @@ $CMS_SINGLE_POST = true; } $i = 0; - $morePosts = false; + $morePosts = 0; foreach($posts as $k=>$v) { if ($v->isPublic) { if (!isset($tagSearch) || in_array($tagSearch, $v->tags)) { @@ -277,8 +277,14 @@ echo '
'; } if (($i % POSTS_PAGE_SIZE) == 0) { - $morePosts = true; - break; + $morePosts = 1; + } else { + if ($morePosts == 1) { + $morePosts = 2; + break; + } else { + $morePosts = 0; + } } } }