本文整理汇总了PHP中map::get_map_list方法的典型用法代码示例。如果您正苦于以下问题:PHP map::get_map_list方法的具体用法?PHP map::get_map_list怎么用?PHP map::get_map_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类map
的用法示例。
在下文中一共展示了map::get_map_list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare
public function prepare()
{
global $SITE, $db;
$this->template = "maps";
$this->tab = 'map';
$this->title = 'Popular maps';
$f = $db->query_first("SELECT id, name, rank, score, plays, players FROM tf2_vars v INNER JOIN tf2_maps m on v.value = m.id");
$fa = array('image' => map_functions::image('x600.y360', $f), 'label' => map_functions::label('', $f), 'link' => map_functions::link('', $f), 'type' => map_functions::type('', $f));
$mlen = 18;
$f['display_name'] = strlen($f['name']) > $mlen ? substr($f['name'], 0, $mlen - 3) . '...' : $f['name'];
$this->params['feat'] = array_merge($f, $fa);
///////////////////////////////////////// New maps ////////////////////////////////////
$this->params['new_maps'] = map::get_map_list(array('funcs' => array('count' => array('func' => 'count', 'param' => '%02d'), 'link' => array('func' => 'link'), 'label' => array('func' => 'label', 'param' => 25)), 'query' => 'SELECT * FROM tf2_maps ORDER BY first_seen DESC LIMIT 10;'));
//////////////////////////////////////// popular maps ///////////////////////////////////
$this->params['popular_maps'] = map::get_map_list(array('funcs' => array('link' => array('func' => 'link'), 'label' => array('func' => 'label'), 'image' => array('func' => 'image', 'param' => 'xy165')), 'query' => sprintf('SELECT id,name, official FROM tf2_maps ORDER BY score DESC LIMIT 10', $time)));
}
示例2: prepare
public function prepare()
{
global $SITE, $db;
$this->template = "map_list";
$this->tab = 'map';
$this->title = 'Map list';
$page_size = 50;
$page = mysql_real_escape_string((int) $this->request[1]);
$method = $this->request[0];
$query = '';
switch ($method) {
case 'rank':
case 'score':
default:
$method = 'score';
$query = sprintf('SELECT id, name, official, score, rank, players, servers, plays FROM tf2_maps ORDER BY score DESC LIMIT ' . $page * $page_size . ', ' . $page_size);
}
$this->params['maps'] = map::get_map_list(array('funcs' => array('link' => array('func' => 'link'), 'label' => array('func' => 'label'), 'type' => array('func' => 'type'), 'icon' => array('func' => 'icon'), 'image' => array('func' => 'image', 'param' => 'x128.y96')), 'query' => $query));
$this->params['method'] = $method;
$this->params['page'] = $page;
}
示例3: prepare
public function prepare()
{
global $db;
$this->template = "map_search";
require_once 'classes/map.php';
$q = $this->request['search'];
//$db->debug=true;
$db->query("SELECT name FROM tf2_maps WHERE name LIKE %s", array(sprintf("%%%%%s%%%%", $q)));
//echo mysql_error();
if ($db->num_rows() == 1) {
$row = $db->fetch_array();
//die();
header('Location: /map/' . $row['name']);
exit;
}
if (!$db->num_rows()) {
page::error("We searched and searched", "But we just couldn't find the map you were looking for.\r\n\t\t\t\tRest assured Heavy is on the job. He won't rest until he knows who's been tampering with his gun.\r\n\t\t\t\t<br/><br/>That's what you were searching for, right?", array('image' => "heavy_yell"));
}
//$db->debug=true;
$this->params['list'] = map::get_map_list(array('funcs' => array('link' => array('func' => 'link'), 'label' => array('func' => 'label')), 'query' => sprintf('SELECT m.id, m.name, m.official, m.score, plays, servers, first_seen FROM tf2_maps m WHERE name LIKE \'%%%s%%\' ORDER BY score DESC LIMIT 50', $q)));
$this->title = sprintf("Search: %s", htmlspecialchars($this->request[0]));
}