} 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;