| <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <!-- iso-8859-1 -->
Ну а вот сама страничка в коде пхп (чтобы понятнее было и воопросов не возникло) =))))
<?php
define("VALID_PAGE", 1);
require(dirname(__FILE__) . "/includes/common.php");
$validfields = array('sort','order','start','limit','andor','search','themefile');
globalize($validfields);
if ($sort == '') $sort = 'skill';
if ($order == '') $order = 'desc';
if (!is_numeric($start) || $start < 0) $start = 0;
if (!is_numeric($limit) || $limit < 0) $limit = 100;
if (!in_array(strtolower($andor), array('and','or','exact'))) $andor = 'or';
if ($search == '') $search = '';
foreach ($validfields as $var) {
$data[$var] = $$var;
}
if (empty($themefile) or !$conf['allowthemechange']) $themefile = 'index';
$data['search_urlencoded'] = urlencode($search);
$data['totalplayers'] = $ps->get_total_players(array('allowall' => 1), $smarty);
$data['rankedplayers'] = $ps->get_total_players(array('allowall' => 0), $smarty);
if ($search != '') {
$data['totalplayersearch'] = $ps->get_total_players(array('allowall' => 0, 'search' => "$andor:$search"), $smarty);
} else {
$data['totalplayersearch'] = $data['rankedplayers'];
}
# This query is optimized to fetch only the fields specified in the 'fields' option since the index doesn't need EVERYTHING
$data['players'] = $ps->get_player_list(array(
'sort' => $sort,
'order' => $order,
'start' => $start,
'limit' => $limit,
'search' => "$andor:$search",
'joinclaninfo' => 1,
'fields' => 'plr.plrid,plr.rank,pp.plricon,plr.name,cp.clanicon,kills,deaths,killsperdeath,killsperminute,onlinetime,skill,prevskill'
), $smarty);
// If we found an exact match from a player search we jump directly to their stats page
//if ($search && $limit > 1 && count($data['players']) == 1 && $data['players'][0]['plrid']) {
if ($search && count($data['players']) == 1 && $data['players'][0]['plrid']) {
gotopage($URLROOT . "player.php?id=" . $data['players'][0]['plrid']);
}
$data['pagerstr'] = pagination(array(
'baseurl' => "$PHP_SELF?search={$data['search_urlencoded']}&andor=$andor&sort=$sort&order=$order&limit=$limit",
'total' => $data['totalplayersearch'],
'start' => $start,
'perpage' => $limit,
'pergroup' => 5,
'prefix' => $lang->trans("Goto:") . ' ',
'next' => $lang->trans("Next"),
'prev' => $lang->trans("Previous"),
));
$smarty->assign($data);
$smarty->parse($themefile);
$smarty->showpage();
include(DOCROOT . "includes/footer.php");
?> | |