$array = $total->GetRateByUserTor($id['user_id'], $start, $per_page, array("date_rate" => "DESC"));
        $count_all = $total->GetCount(array("user_id" => $id['user_id']), "rates_by_user_tor");
    } else {
        $array = $total->GetRate(array("user_id" => $id['user_id']), $start, $per_page, array("date_rate" => "DESC"));
        $count_all = $total->GetCount(array("user_id" => $id['user_id']), "rates");
    }
    $name = "user";
    $uvalue = $user;
} elseif ($matche) {
    $array = $total->GetRate(array("matche_id" => $matche), $start, $per_page, array("date_rate" => "DESC"));
    $name = "matche";
    $uvalue = $matche;
    $count_all = $total->GetCount(array("matche_id" => $matche), "rates");
} elseif ($komanda) {
    $komanda = $total->db->safesql(urldecode($komanda));
    $array = $total->GetMatcheUsers("(komanda1='{$komanda}' OR komanda2='{$komanda}')", $start, $per_page, array("calculate" => "ASC", "date_matche" => "DESC"), $user_id);
    $name = "komanda";
    $uvalue = $komanda;
    $count_all = $total->GetCount("(komanda1='{$komanda}' OR komanda2='{$komanda}')", "matches");
} elseif ($stats) {
    $name = "stats";
    $uvalue = 1;
    if (!$total_conf['allow_cache'] || !($array = @unserialize(dle_cache('totalizator_stats_' . $start)))) {
        $total->db->query("SELECT *, name AS username FROM " . PREFIX . "_users WHERE points!=0 ORDER BY points DESC LIMIT {$start}, {$per_page}");
        while ($row = $total->db->get_row()) {
            $array[$row['user_id']] = $row;
        }
        if ($total_conf['allow_cache']) {
            create_cache("totalizator_stats_" . $start, @serialize($array));
        }
    }