本文整理匯總了PHP中map::get_info方法的典型用法代碼示例。如果您正苦於以下問題:PHP map::get_info方法的具體用法?PHP map::get_info怎麽用?PHP map::get_info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類map
的用法示例。
在下文中一共展示了map::get_info方法的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;
}