Problem with creating multipage
#4
That's a basic pagination that I fetch from memberlist, worked for me.
Create an adminlogs.php file and check it out.

<?php
define("IN_MYBB", 1);
require_once "./global.php";

$url = "{$mybb->settings['bburl']}/adminlogs.php";
$per_page = 10;

$query = $db->simple_select('adminlog', 'COUNT(*) AS adminlogs');
$num_adminlogs = $db->fetch_field($query, "adminlogs");

$page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page && $page > 0)
{
	$start = ($page - 1) * $per_page;
	$pages = ceil($num_adminlogs / $per_page);
	if($page > $pages)
	{
		$start = 0;
		$page = 1;
	}
}
else
{
	$start = 0;
	$page = 1;
}

$multipage = multipage($num_adminlogs, $per_page, $page, $url);

echo $multipage;

$query = $db->simple_select('adminlog', 'uid, module, action', '', array('limit' => "{$start}, {$per_page}"));
while($result = $db->fetch_array($query))
{
	echo "{$result['uid']}, {$result['module']}, {$result['action']}<br />";
}
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)