also correctly handle post/list without a page ID given
This commit is contained in:
parent
069b7ee9ea
commit
c55c984cfc
1 changed files with 9 additions and 1 deletions
|
@ -54,8 +54,16 @@ class arrowkey_navigation extends Extension {
|
||||||
// get the amount of images per page
|
// get the amount of images per page
|
||||||
$images_per_page = $config->get_int('index_images');
|
$images_per_page = $config->get_int('index_images');
|
||||||
|
|
||||||
|
// this occurs when viewing post/list without page number
|
||||||
|
if ($event->get_arg(0) == null) {// no page listed
|
||||||
|
$prefix = "";
|
||||||
|
$page_number = 1;
|
||||||
|
$total_pages = ceil($database->get_one(
|
||||||
|
"SELECT COUNT(*) FROM images") / $images_per_page);
|
||||||
|
}
|
||||||
|
|
||||||
// if there are no tags, use default
|
// if there are no tags, use default
|
||||||
if ($event->get_arg(1) == null){
|
else if ($event->get_arg(1) == null){
|
||||||
$prefix = "";
|
$prefix = "";
|
||||||
$page_number = (int)$event->get_arg(0);
|
$page_number = (int)$event->get_arg(0);
|
||||||
$total_pages = ceil($database->get_one(
|
$total_pages = ceil($database->get_one(
|
||||||
|
|
Reference in a new issue