There are a few pages where the pagination_bar() call produces an empty page
when the number of results is a multiple of the results per page. Looking at
getnbpages() I see the right way to do it. So I changed these few pages to
either use getnbpages() or calculate the number of pages the same way.
$template->param(
pagination_bar => pagination_bar(
- $base_url, int( $total / $resultsperpage ) + 1,
+ $base_url, getnbpages( $total, $resultsperpage ),
$startfrom, 'startfrom'
),
total => $total,
$template->param(
paginationbar => pagination_bar(
- $base_url, int( $count / $resultsperpage ) + 1,
+ $base_url, int( ($count - 1) / $resultsperpage ) + 1,
$startfrom, 'startfrom'
),
startfrom => $startfrom,
$template->param(
paginationbar => pagination_bar(
- $base_url, int( $count / $resultsperpage ) + 1,
+ $base_url, int( ($count - 1) / $resultsperpage ) + 1,
$startfrom, 'startfrom'
),
startfrom => $startfrom,