Compare commits

...

2 Commits

Author SHA1 Message Date
3587f38bac Hide older / newer entries button for the RSS feed 2018-04-30 09:43:25 +02:00
e8827ce7d4 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.
2018-04-30 09:42:53 +02:00

View File

@ -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,21 +277,29 @@
echo '<hr class="postSeparator">';
}
if (($i % POSTS_PAGE_SIZE) == 0) {
$morePosts = true;
break;
$morePosts = 1;
} else {
if ($morePosts == 1) {
$morePosts = 2;
break;
} else {
$morePosts = 0;
}
}
}
}
}
}
if ($morePosts || $postsSkip > 0)
echo "<p><table class=\"blognav\"><tr>";
if ($morePosts)
echo '<td><a href="' . "?p=blog$tagSearchUrl&s=" . ($postsPage+1) . '">&lt;&lt; Older posts</a></td>';
if ($postsSkip > 0)
echo '<td style="text-align:right;"><a href="' . "?p=blog$tagSearchUrl&s=" . ($postsPage-1) . '">Newer posts &gt;&gt;</a></td>';
if ($morePosts || $postsSkip > 0)
echo "</tr></table></p>";
if (!isset($CMS_RSS)) {
if ($morePosts == 2 || $postsSkip > 0)
echo "<p><table class=\"blognav\"><tr>";
if ($morePosts == 2)
echo '<td><a href="' . "?p=blog$tagSearchUrl&s=" . ($postsPage+1) . '">&lt;&lt; Older posts</a></td>';
if ($postsSkip > 0)
echo '<td style="text-align:right;"><a href="' . "?p=blog$tagSearchUrl&s=" . ($postsPage-1) . '">Newer posts &gt;&gt;</a></td>';
if ($morePosts == 2|| $postsSkip > 0)
echo "</tr></table></p>";
}
}
if (!isset($CMS_RSS))
echo "</blog>";