mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-30 11:19:22 +02:00
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:
parent
8e4d44fe4c
commit
5c6fcb7673
@ -64,7 +64,7 @@ if ($scores) {
|
|||||||
</select>
|
</select>
|
||||||
<select name="page">
|
<select name="page">
|
||||||
<?php
|
<?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++) {
|
for ($i = 0; $i < $pages; $i++) {
|
||||||
$x = $i + 1;
|
$x = $i + 1;
|
||||||
if ($x == $page) echo "<option value='".$x."' selected>Page: ".$x."</option>";
|
if ($x == $page) echo "<option value='".$x."' selected>Page: ".$x."</option>";
|
||||||
@ -100,4 +100,4 @@ if ($scores) {
|
|||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
include 'layout/overall/footer.php'; ?>
|
include 'layout/overall/footer.php'; ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user