本文整理汇总了PHP中Paginate::results方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginate::results方法的具体用法?PHP Paginate::results怎么用?PHP Paginate::results使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paginate
的用法示例。
在下文中一共展示了Paginate::results方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
} else {
$stat_page_vars['total_pk'] = $GLOBALS['CONFIG_STATS_TOTAL_PK_ENABLED'] ? Main::db_result(Main::db_query(sprintf($GLOBALS['DBQUERY_STAT_SUM'], $GLOBALS['DBSTRUCT_L2J_CHARS_PK'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE']), $GLOBALS['DB_GAME_SREVER']), 0) : $GLOBALS['LANG_DISABLED'];
}
if ($GLOBALS['CONFIG_STATS_TOTAL_PK_CACHE']) {
file_put_contents($cache_file, $stat_page_vars['total_pk']);
}
}
@(require_once sep_path(CMS_DIR . '/libraries/paginate.class.inc'));
if ($this->server_type == '1') {
$top_pk_query = sprintf($GLOBALS['DBQUERY_TOP_PK'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_NAME'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_PK'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_LEVEL'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_PK'], '1');
} else {
$top_pk_query = sprintf($GLOBALS['DBQUERY_TOP_PK'], $GLOBALS['DBSTRUCT_L2J_CHARS_NAME'], $GLOBALS['DBSTRUCT_L2J_CHARS_PK'], $GLOBALS['DBSTRUCT_L2J_CHARS_LEVEL'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_PK'], '1');
}
$paginate = new Paginate($top_pk_query, $this->server_type == '1' ? $GLOBALS['DBSTRUCT_L2OFF_USERDAT_PK'] : $GLOBALS['DBSTRUCT_L2J_CHARS_PK'], $GLOBALS['CONFIG_STATS_TOP_PK_ORDER'], $GLOBALS['DB_GAME_SERVER'], $GLOBALS['CONFIG_STATS_TOP_PK_RESULTS'], $GLOBALS['CONFIG_STATS_TOP_PK_RESULTS_PER_PAGE'], $GLOBALS['CONFIG_STATS_TOP_PK_CACHE'], 'top_pk');
$paginate->load();
$results = $paginate->results();
$i = $paginate->offset;
foreach ($results as $k) {
++$i;
$the_top_vars['the_rank'] = $i;
$the_top_vars['char_name'] = $k[0];
$the_top_vars['char_pk'] = $k[1];
$the_top_vars['char_level'] = $k[2] ? $k[2] : '1';
$stat_page_vars['the_top'] .= Template::load('styles/toppk_list.html', $the_top_vars, 0);
}
$prev_get = 'page=statistics&pk';
$stat_page_vars['first_page'] = $paginate->first_page ? sprintf($GLOBALS['LANG_FIRSTP'], $prev_get, $paginate->first_page) : '';
$stat_page_vars['prev_page'] = $paginate->prev_page ? sprintf($GLOBALS['LANG_PREVP'], $prev_get, $paginate->prev_page) : '';
$stat_page_vars['next_page'] = $paginate->next_page ? sprintf($GLOBALS['LANG_NEXTP'], $prev_get, $paginate->next_page) : '';
$stat_page_vars['last_page'] = $paginate->last_page ? sprintf($GLOBALS['LANG_LASTP'], $prev_get, $paginate->last_page) : '';
$stat_page_vars['current_page'] = $paginate->current_page;