Problem with creating multipage
#1
Hello everyone,

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.
Reply


Messages In This Thread
Problem with creating multipage - by Synx - 11-28-2018, 11:05 AM
RE: Problem with creating multipage - by Synx - 01-11-2019, 01:54 PM
RE: Problem with creating multipage - by Synx - 01-14-2019, 08:20 AM
RE: Problem with creating multipage - by Mipher - 01-14-2019, 09:58 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)