Exemple #1
0
    $start = 0;
}
if (!is_numeric($limit) || $limit < 0) {
    $limit = 10;
}
$topten = array();
$totalmaps = $ps->get_total_maps();
$maps = $ps->get_map_list(array('sort' => 'kills', 'order' => 'desc', 'start' => 0, 'limit' => 50));
// a map name was given; look up the ID for it
if (!is_numeric($id) and !empty($id)) {
    list($id) = $ps->db->fetch_list("SELECT mapid FROM {$ps->t_map} WHERE uniqueid=" . $ps->db->escape($id, true));
}
$map = $ps->get_map(array('mapid' => $id));
$cms->theme->page_title(' for ' . $map['uniqueid'], true);
if ($map['mapid']) {
    $heat = new PS_Heatmap($ps);
    $map['total_heatmaps'] = $heat->total_heatmap_images($map['mapid']);
    $setup = array('mapid' => $id, 'order' => 'desc', 'limit' => $limit);
    $ps->reset_map_stats();
    // generic stats that will work for any game/mod
    $ps->add_map_player_list('kills', $setup + array('label' => $cms->trans("Most Kills")));
    $ps->add_map_player_list('ffkills', $setup + array('label' => $cms->trans("Most FF Kills")));
    $ps->add_map_player_list('ffdeaths', $setup + array('label' => $cms->trans("Most FF Deaths")));
    $ps->add_map_player_list('onlinetime', $setup + array('label' => $cms->trans("Most Online Time"), 'modifier' => 'compacttime'));
    // each mod will add their own stats to the output
    $ps->add_map_player_list_mod($map, $setup);
    // allow plugins to add their own stats to the map details
    $cms->action('add_map_player_list');
    // build all topten stats
    $topten = $ps->build_map_stats();
}
Exemple #2
0
    $start = 0;
}
if (!is_numeric($limit) || $limit < 0) {
    $limit = 10;
}
$totalmaps = $ps->get_total_maps();
$maps = $ps->get_map_list(array('sort' => 'kills', 'order' => 'desc', 'start' => 0, 'limit' => 50));
// a map name was given; look up the ID for it
if (!is_numeric($id) and !empty($id)) {
    list($id) = $ps->db->fetch_list("SELECT mapid FROM {$ps->t_map} WHERE uniqueid=" . $ps->db->escape($id, true));
}
$map = $ps->get_map(array('mapid' => $id));
$cms->theme->page_title(' for ' . $map['uniqueid'], true);
$heatmap_list = array();
if ($map['mapid']) {
    $heat = new PS_Heatmap($ps);
    $heatmap_list = $heat->get_map_heatmaps($id);
    uasort($heatmap_list, 'sort_heatmaps');
    if ($heatmap_list) {
        // default to the first heatmap type available
        if (!$heatid or !isset($heatmap_list[$heatid])) {
            reset($heatmap_list);
            $m = current($heatmap_list);
            $heatid = $m['heatid'];
        }
        //		print_r($heatmap_list[$heatid]);
        $map['overlay'] = $ps->overlayimg($map['uniqueid']);
        $map['heatmap_images'] = $heat->get_heatmap_images($map['mapid'], $heatmap_list[$heatid]);
    }
}
$cms->theme->assign(array('heatid' => $heatid, 'maps' => $maps, 'map' => $map, 'mapimg' => $ps->mapimg($map, array('noimg' => '')), 'totalmaps' => $totalmaps, 'heatmap_list' => $heatmap_list));
Exemple #3
0
/**
 *	This file is part of PsychoStats.
 *
 *	Written by Jason Morriss <*****@*****.**>
 *	Copyright 2008 Jason Morriss
 *
 *	PsychoStats is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *	PsychoStats is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with PsychoStats.  If not, see <http://www.gnu.org/licenses/>.
 *
 *	Version: $Id: heatimg.php 450 2008-05-20 11:34:52Z lifo $
 *
 *	Returns a single heatmap image keyed on the heatid
 */
define("PSYCHOSTATS_PAGE", true);
include dirname(__FILE__) . "/includes/common.php";
include_once PS_ROOTDIR . "/includes/PS/Heatmap.php";
$id = trim($_REQUEST['id']);
//$key = trim($_REQUEST['key']);
$heat = new PS_Heatmap($ps);
$heat->image_passthru($id);
// output image directly to client, and print proper Content-Type