本文整理汇总了PHP中map::get_servers方法的典型用法代码示例。如果您正苦于以下问题:PHP map::get_servers方法的具体用法?PHP map::get_servers怎么用?PHP map::get_servers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类map
的用法示例。
在下文中一共展示了map::get_servers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare
public function prepare()
{
$this->template = "map";
$this->tab = 'map';
global $SITE;
$SITE['head'] .= '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
require_once 'classes/map.php';
$map = new map($this->request[0]);
$i = $map->get_info();
$s = $map->get_stats();
$stats[] = array('key' => 'Players', 'now' => $i['players'], 'average' => $s['avg_players']);
$stats[] = array('key' => 'Servers', 'now' => $i['servers'], 'average' => $s['avg_servers']);
$stats[] = array('key' => 'Saturation', 'now' => $i['players'] > 0 ? $i['servers'] / $i['players'] : 0, 'average' => $s['saturation']);
$this->title = htmlspecialchars($this->request[0]);
$this->params['info'] = $i;
$this->params['servers'] = $map->get_servers(25);
$this->params['images'] = $map->get_images();
$this->params['extra'] = $map->get_extra();
$this->params['stats'] = $stats;
}