當前位置: 首頁>>代碼示例>>PHP>>正文


PHP map::get_map_list方法代碼示例

本文整理匯總了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)));
 }
開發者ID:mwilchez,項目名稱:master,代碼行數:16,代碼來源:maps.view.php

示例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;
 }
開發者ID:mwilchez,項目名稱:master,代碼行數:21,代碼來源:map_list.view.php

示例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]));
 }
開發者ID:mwilchez,項目名稱:master,代碼行數:22,代碼來源:map_search.view.php


注:本文中的map::get_map_list方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。