diff --git a/index.php b/index.php index dc84a98..6607b26 100644 --- a/index.php +++ b/index.php @@ -198,7 +198,7 @@ if (isset($_GET["build_id"])) { chan_selector($chan); } -if ($res = $DB->query(kl_str_sql("select * from builds where chan=!s $where order by nr desc limit !i offset !i", $chan, $pageSize, $page * $pageSize))) { +if ($res = $DB->query(kl_str_sql("select * from builds where chan=!s $where order by nr desc limit !i offset !i", $chan, $pageSize + 1, $page * $pageSize))) { while ($row = $DB->fetchRow($res)) { $build = new stdClass; @@ -241,6 +241,8 @@ $paginator .= "  Page " . ($page + 1) . " of " . ceil($total / $pageSi $paginator .= 'Next>'; +if ($pageSize == 1) $paginator = ""; + print $paginator; if ($nrBuilds) {