2018-11-28, 11:05 AM
Hello everyone,
I'm trying to create a pagination using the multipage function, but I have a bit of troubles.
I currently have the above and I have followed this tutorial: https://github.com/dragonexpert/tutorial...pment.html
The pagination shows up with all the correct numbers but it seems to display more than 10 per page and when you navigate, it won't seem to navigate to the other page but stays at the same page, even though the param is e.x ?page=2.
I'm trying to create a pagination using the multipage function, but I have a bit of troubles.
$query = $db->simple_select('logs', 'COUNT(lid) as total');
$total = $db->fetch_field($query, "total");
$perpage = 10;
$pages = ceil($total / $perpage);
if($mybb->input['page']) {
$page = (int)$mybb->get_input('page', 1);
}
else {
$page = 1;
}
if($page < 1) {
$page = 1;
}
if($page > $pages) {
$page = $pages;
}
$url = $mybb->settings['bburl'] . "/logs.php";
$pagination = multipage($total, $perpage, $page, $url);
I currently have the above and I have followed this tutorial: https://github.com/dragonexpert/tutorial...pment.html
The pagination shows up with all the correct numbers but it seems to display more than 10 per page and when you navigate, it won't seem to navigate to the other page but stays at the same page, even though the param is e.x ?page=2.