当前位置: 首页>>代码示例>>PHP>>正文


PHP Functions_Lib::build_planet_list方法代码示例

本文整理汇总了PHP中Functions_Lib::build_planet_list方法的典型用法代码示例。如果您正苦于以下问题:PHP Functions_Lib::build_planet_list方法的具体用法?PHP Functions_Lib::build_planet_list怎么用?PHP Functions_Lib::build_planet_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Functions_Lib的用法示例。


在下文中一共展示了Functions_Lib::build_planet_list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: build_page


//.........这里部分代码省略.........
     $parse['options'] = '';
     foreach ($speed_values as $value => $porcentage) {
         $speed_porcentage['value'] = $value;
         $speed_porcentage['selected'] = '';
         $speed_porcentage['title'] = $porcentage;
         $parse['options'] .= parent::$page->parse_template($options_template, $speed_porcentage);
     }
     #####################################################################################################
     // PARSE THE REST OF THE OPTIONS
     #####################################################################################################
     $parse['fleetblock'] = $FleetHiddenBlock;
     $parse['speedallsmin'] = $speedallsmin;
     $parse['fleetarray'] = str_rot13(base64_encode(serialize($fleet['fleetarray'])));
     $parse['galaxy'] = $this->_current_planet['planet_galaxy'];
     $parse['system'] = $this->_current_planet['planet_system'];
     $parse['planet'] = $this->_current_planet['planet_planet'];
     $parse['galaxy_post'] = (int) $_POST['galaxy'];
     $parse['system_post'] = (int) $_POST['system'];
     $parse['planet_post'] = (int) $_POST['planet'];
     $parse['speedfactor'] = Functions_Lib::fleet_speed_factor();
     $parse['planet_type'] = $this->_current_planet['planet_type'];
     $parse['metal'] = floor($this->_current_planet['planet_metal']);
     $parse['crystal'] = floor($this->_current_planet['planet_crystal']);
     $parse['deuterium'] = floor($this->_current_planet['planet_deuterium']);
     $parse['g'] = $g;
     $parse['s'] = $s;
     $parse['p'] = $p;
     #####################################################################################################
     // LOAD FLEET SHORTCUTS
     #####################################################################################################
     if (Officiers_Lib::is_officier_active($this->_current_user['premium_officier_commander'])) {
         if ($this->_current_user['user_fleet_shortcuts']) {
             $scarray = explode(";", $this->_current_user['user_fleet_shortcuts']);
             foreach ($scarray as $a => $b) {
                 if ($b != "") {
                     $c = explode(',', $b);
                     $shortcut['description'] = $c[0] . " " . $c[1] . ":" . $c[2] . ":" . $c[3] . " ";
                     switch ($c[4]) {
                         case 1:
                             $shortcut['description'] .= $this->_lang['fl_planet_shortcut'];
                             break;
                         case 2:
                             $shortcut['description'] .= $this->_lang['fl_debris_shortcut'];
                             break;
                         case 3:
                             $shortcut['description'] .= $this->_lang['fl_moon_shortcut'];
                             break;
                         default:
                             $shortcut['description'] .= '';
                             break;
                     }
                     $shortcut['select'] = 'shortcuts';
                     $shortcut['selected'] = '';
                     $shortcut['value'] = $c['1'] . ';' . $c['2'] . ';' . $c['3'] . ';' . $c['4'];
                     $shortcut['title'] = $shortcut['description'];
                     $shortcut['shortcut_options'] .= parent::$page->parse_template($options_template, $shortcut);
                 }
             }
             $parse['shortcuts_rows'] = parent::$page->parse_template($shortcut_row_template, $shortcut);
             $parse['shortcut'] = parent::$page->parse_template($shortcut_template, $parse);
         } else {
             $parse['fl_shorcut_message'] = $this->_lang['fl_no_shortcuts'];
             $parse['shortcuts_rows'] = parent::$page->parse_template($shortcut_noshortcuts, $parse);
             $parse['shortcut'] = parent::$page->parse_template($shortcut_template, $parse);
         }
     }
     #####################################################################################################
     // LOAD COLONY SHORTCUTS
     #####################################################################################################
     $colony['select'] = 'colonies';
     $colony['shortcut_options'] = Functions_Lib::build_planet_list($this->_current_user, $this->_current_planet['planet_id']);
     $parse['colonylist'] = parent::$page->parse_template($shortcut_row_template, $colony);
     if ($colony['shortcut_options'] === FALSE) {
         $parse['fl_shorcut_message'] = $this->_lang['fl_no_colony'];
         $parse['colonylist'] = parent::$page->parse_template($shortcut_noshortcuts, $parse);
     }
     #####################################################################################################
     // LOAD SAC SHORTCUTS
     #####################################################################################################
     $acs_fleets = '';
     while ($row = parent::$db->fetch_array($getCurrentAcs)) {
         $members = explode(",", $row['acs_fleet_invited']);
         foreach ($members as $a => $b) {
             if ($b == $this->_current_user['user_id']) {
                 $acs['galaxy'] = $row['acs_fleet_galaxy'];
                 $acs['system'] = $row['acs_fleet_system'];
                 $acs['planet'] = $row['acs_fleet_planet'];
                 $acs['planet_type'] = $row['acs_fleet_planet_type'];
                 $acs['id'] = $row['acs_fleet_id'];
                 $acs['name'] = $row['acs_fleet_name'];
                 $acs_fleets .= parent::$page->parse_template($shortcut_acs_row, $acs);
             }
         }
     }
     $parse['asc'] = $acs_fleets;
     $parse['maxepedition'] = $_POST['maxepedition'];
     $parse['curepedition'] = $_POST['curepedition'];
     $parse['target_mission'] = $_POST['target_mission'];
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('fleet/fleet2_table'), $parse));
 }
开发者ID:Gritch69,项目名称:XG-Project,代码行数:101,代码来源:fleet2.php

示例2: game_navbar

 /**
  * method topnav_bar
  * param
  * return get the top navigation bar data and parses it
  */
 private function game_navbar()
 {
     $parse = $this->_lang;
     $parse['dpath'] = DPATH;
     $parse['image'] = $this->_current_planet['planet_image'];
     $parse['planetlist'] = Functions_Lib::build_planet_list($this->_current_user);
     // VACATION MODE & DELETE MODE MESSAGES
     if ($this->_current_user['setting_vacations_status'] && $this->_current_user['setting_delete_account']) {
         $parse['show_umod_notice'] .= $this->_current_user['setting_delete_account'] ? '<table width="100%" style="border: 2px solid red; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $this->_lang['tn_delete_mode'] . date(Functions_Lib::read_config('date_format_extended'), $this->_current_user['setting_delete_account'] + 60 * 60 * 24 * 7) . '</td></tr></table>' : '';
     } else {
         if ($this->_current_user['setting_vacations_status'] < time()) {
             $parse['show_umod_notice'] = $this->_current_user['setting_vacations_status'] ? '<table width="100%" style="border: 2px solid #1DF0F0; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $this->_lang['tn_vacation_mode'] . date(Functions_Lib::read_config('date_format_extended'), $this->_current_user['setting_vacations_until']) . '</td></tr></table><br>' : '';
         }
         $parse['show_umod_notice'] .= $this->_current_user['setting_delete_account'] ? '<table width="100%" style="border: 2px solid red; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $this->_lang['tn_delete_mode'] . date(Functions_Lib::read_config('date_format_extended'), $this->_current_user['setting_delete_account'] + 60 * 60 * 24 * 7) . '</td></tr></table>' : '';
     }
     // RESOURCES FORMAT
     $metal = Format_Lib::pretty_number($this->_current_planet['planet_metal']);
     $crystal = Format_Lib::pretty_number($this->_current_planet['planet_crystal']);
     $deuterium = Format_Lib::pretty_number($this->_current_planet['planet_deuterium']);
     $darkmatter = Format_Lib::pretty_number($this->_current_user['premium_dark_matter']);
     $energy = Format_Lib::pretty_number($this->_current_planet['planet_energy_max'] + $this->_current_planet['planet_energy_used']) . "/" . Format_Lib::pretty_number($this->_current_planet['planet_energy_max']);
     // OFFICERS AVAILABILITY
     $commander = Officiers_Lib::is_officier_active($this->_current_user['premium_officier_commander']) ? '' : '_un';
     $admiral = Officiers_Lib::is_officier_active($this->_current_user['premium_officier_admiral']) ? '' : '_un';
     $engineer = Officiers_Lib::is_officier_active($this->_current_user['premium_officier_engineer']) ? '' : '_un';
     $geologist = Officiers_Lib::is_officier_active($this->_current_user['premium_officier_geologist']) ? '' : '_un';
     $technocrat = Officiers_Lib::is_officier_active($this->_current_user['premium_officier_technocrat']) ? '' : '_un';
     // METAL
     if ($this->_current_planet['planet_metal'] >= $this->_current_planet['planet_metal_max']) {
         $metal = Format_Lib::color_red($metal);
     }
     // CRYSTAL
     if ($this->_current_planet['planet_crystal'] >= $this->_current_planet['planet_crystal_max']) {
         $crystal = Format_Lib::color_red($crystal);
     }
     // DEUTERIUM
     if ($this->_current_planet['planet_deuterium'] >= $this->_current_planet['planet_deuterium_max']) {
         $deuterium = Format_Lib::color_red($deuterium);
     }
     // ENERGY
     if ($this->_current_planet['planet_energy_max'] + $this->_current_planet['planet_energy_used'] < 0) {
         $energy = Format_Lib::color_red($energy);
     }
     $parse['metal'] = $metal;
     $parse['crystal'] = $crystal;
     $parse['deuterium'] = $deuterium;
     $parse['darkmatter'] = $darkmatter;
     $parse['energy'] = $energy;
     $parse['img_commander'] = $commander;
     $parse['img_admiral'] = $admiral;
     $parse['img_engineer'] = $engineer;
     $parse['img_geologist'] = $geologist;
     $parse['img_technocrat'] = $technocrat;
     return $this->parse_template($this->get_template('general/topnav'), $parse);
 }
开发者ID:rampmaster,项目名称:XG-Proyect-v3.x.x,代码行数:60,代码来源:Template_Lib.php


注:本文中的Functions_Lib::build_planet_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。