There is no need to display options that would lead to empty pages.

This will display options for actual pages (if actual rows is less than config) or maximum rows / rowsPerPage from config whichever is less.

I did this for my site, thought I would share it if you want it. Please enter the commit message for your changes. Lines starting
This commit is contained in:
Triath 2015-08-15 18:36:22 +02:00
parent 8e4d44fe4c
commit 5c6fcb7673

View File

@ -64,7 +64,7 @@ if ($scores) {
</select>
<select name="page">
<?php
$pages = (int)($highscore['rows'] / $highscore['rowsPerPage']);
$pages = ceil(min(($highscore['rows'] / $highscore['rowsPerPage']), (count($scores[$type]) / $highscore['rowsPerPage'])));
for ($i = 0; $i < $pages; $i++) {
$x = $i + 1;
if ($x == $page) echo "<option value='".$x."' selected>Page: ".$x."</option>";
@ -100,4 +100,4 @@ if ($scores) {
</table>
<?php
}
include 'layout/overall/footer.php'; ?>
include 'layout/overall/footer.php'; ?>