本文整理汇总了PHP中pagination::get_start_row方法的典型用法代码示例。如果您正苦于以下问题:PHP pagination::get_start_row方法的具体用法?PHP pagination::get_start_row怎么用?PHP pagination::get_start_row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pagination
的用法示例。
在下文中一共展示了pagination::get_start_row方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: users
$query['WHERE'] = "name != '' AND group_id = " . $req_group;
}
#show users (all)
#show users (all)
case 'users':
$query['SELECT'] = 'COUNT(id) AS total_users';
$query['FROM'] = "{$dbprefix}users";
$query['ORDER BY'] = 'id ASC';
$result = $SQL->build($query);
$nums_rows = 0;
$n_fetch = $SQL->fetch($result);
$nums_rows = $n_fetch['total_users'];
//pagination
$currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1;
$Pager = new pagination($perpage, $nums_rows, $currentPage);
$start = $Pager->get_start_row();
$no_results = false;
$arr = array();
if ($nums_rows > 0) {
$query['SELECT'] = 'id, name, founder, group_id, last_visit';
$query['LIMIT'] = "{$start}, {$perpage}";
$result = $SQL->build($query);
while ($row = $SQL->fetch($result)) {
$userfile = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $row['id'] . '.html' : 'ucp.php?go=fileuser&id=' . $row['id']);
$arr[$row['id']] = array('id' => $row['id'], 'name' => $row['name'], 'userfile_link' => $userfile, 'delusrfile_link' => $row['founder'] && (int) $user->data['founder'] == 0 ? false : ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . '&deleteuserfile=' . $row['id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'delusr_link' => $user->data['id'] == $row['id'] || $row['founder'] && (int) $user->data['founder'] == 0 ? false : ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . '&del_user=' . $row['id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'editusr_link' => $row['founder'] && (int) $user->data['founder'] == 0 ? false : ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . '&smt=edit_user&uid=' . $row['id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'founder' => (int) $row['founder'], 'last_visit' => empty($row['last_visit']) ? $lang['NOT_YET'] : kleeja_date($row['last_visit']), 'group' => get_group_name($row['group_id']));
}
$SQL->free($result);
} else {
$no_results = true;
}
//pages
示例2: array
#if there is no username, then there is no user at all
if (!$data_user['name']) {
kleeja_error($lang['NOT_EXSIT_USER'], $lang['PLACE_NO_YOU']);
}
#this user closed his folder, and it's not the current user folder
if (!$data_user['show_my_filecp'] && $user->id() != $user_id && !user_can('enter_acp')) {
kleeja_info($lang['USERFILE_CLOSED'], $lang['CLOSED_FEATURE']);
}
$query = array('SELECT' => 'f.id, f.name, f.real_filename, f.folder, f.type, f.uploads, f.time, f.size', 'FROM' => "{$dbprefix}files f", 'WHERE' => 'f.user=' . $user_id, 'ORDER BY' => 'f.id DESC');
#set variables
$perpage = 16;
$result_p = $SQL->build($query);
$nums_rows = $SQL->num($result_p);
$current_page = g('page', 'int', 1);
$pagination = new pagination($perpage, $nums_rows, $current_page);
$start = $pagination->get_start_row();
$your_fileuser_link = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $user->data['id'] . '.html' : 'ucp.php?go=fileuser&id=' . $user->data['id']);
$total_pages = $pagination->get_total_pages();
$pagination_link = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $user_id . '-' : 'ucp.php?go=fileuser&id=' . $user_id);
$linkgoto = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $user_id . '-' . $current_page . '.html' : 'ucp.php?go=fileuser&id=' . $user_id . '&page=' . $current_page);
$page_nums = $pagination->print_nums($pagination_link);
$no_results = true;
if ((int) $config['user_system'] != 1 && $user->data['id'] != $user_id) {
$data_user['name'] = $user->usernamebyid($user_id);
}
$username = !$data_user['name'] ? false : $data_user['name'];
#set page title
$current_title = $lang['FILEUSER'] . ': ' . $username;
#there is result ? show them
if ($nums_rows) {
$no_results = false;