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


PHP Division::findDivisionLeaders方法代码示例

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


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

示例1: getDivisionLeaders

 /**
  * @param $division_structure
  * @return string
  */
 private function getDivisionLeaders($division_structure)
 {
     $division_leaders = Division::findDivisionLeaders($this->game_id);
     foreach ($division_leaders as $division_leader) {
         $aod_url = Member::createAODlink(['member_id' => $division_leader->member_id, 'rank' => Rank::convert($division_leader->rank_id)->abbr, 'forum_name' => $division_leader->forum_name]);
         $division_structure .= property_exists($division_leader, 'position_desc') ? "{$aod_url} - {$division_leader->position_desc}\r\n" : "{$aod_url}\r\n";
     }
     return $division_structure;
 }
开发者ID:higginsd,项目名称:Division-Tracker,代码行数:13,代码来源:WgDivisionStructure.php

示例2: _index

 public static function _index($div)
 {
     $user = User::find(intval($_SESSION['userid']));
     $member = Member::find(intval($_SESSION['memberid']));
     $tools = Tool::find_all($user->role);
     $divisions = Division::find_all();
     $division = Division::findByName(strtolower($div));
     $js = 'division';
     if (property_exists($division, 'id')) {
         $division_leaders = Division::findDivisionLeaders($division->id);
         Flight::render('division/main/index', compact('user', 'member', 'division', 'division_leaders'), 'content');
         Flight::render('layouts/application', compact('user', 'member', 'tools', 'divisions', 'js'));
     } else {
         Flight::redirect('/404', 404);
     }
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:16,代码来源:DivisionController.php

示例3: generate

 public function generate()
 {
     // header
     $division_structure = "[table='align:center,width: {$this->info_width}']";
     $division_structure .= "[tr][td]";
     // banner
     $division_structure .= "[center][img]http://puu.sh/kGjU9/4f331d1a99.jpg[/img][/center]\r\n";
     /**
      * ------division leaders-----
      */
     $division_structure .= "\r\n\r\n[center][size=5][color={$this->div_name_color}][b][i][u]Division Leaders[/u][/i][/b][/color][/size][/center]\r\n";
     $division_structure .= "[center][size=4]";
     $division_leaders = Division::findDivisionLeaders($this->game_id);
     foreach ($division_leaders as $player) {
         $player_name = Rank::convert($player->rank_id)->abbr . " " . $player->forum_name;
         $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => $player_name, 'color' => $this->division_leaders_color));
         $division_structure .= "{$aod_url} - {$player->position_desc}\r\n";
     }
     $division_structure .= "[/size][/center]\r\n\r\n";
     /**
      * -----general sergeants-----
      */
     $division_structure .= "[center][size=3][color={$this->platoon_pos_color}]General Sergeants[/color]\r\n";
     $general_sergeants = Division::findGeneralSergeants($this->game_id);
     foreach ($general_sergeants as $player) {
         $player_name = Rank::convert($player->rank_id)->abbr . " " . $player->forum_name;
         $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => $player_name));
         $division_structure .= "{$aod_url}\r\n";
     }
     $division_structure .= "[/size][/center]";
     $division_structure .= "[/td][/tr][/table]";
     /**
      * ---------platoons----------
      */
     $division_structure .= "\r\n\r\n[table='align:center,width: {$this->players_width}']";
     $platoons = $this->platoons;
     $i = 1;
     foreach ($platoons as $platoon) {
         $countMembers = Platoon::countPlatoon($platoon->id);
         if ($i == 1) {
             $division_structure .= "[tr]";
             $division_structure .= "[td]";
         } else {
             $division_structure .= "[td]";
         }
         $division_structure .= "[size=5]{$platoon->name}[/size]\r\n\r\n";
         // Legion Commander
         $player = Member::findByMemberId($platoon->leader_id);
         // is a Legion Commander assigned?
         if ($platoon->leader_id != 0) {
             $player_name = Rank::convert($player->rank_id)->abbr . " " . $player->forum_name;
             $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => $player_name, 'color' => $this->platoon_leaders_color));
             $division_structure .= "[size=3][color={$this->platoon_pos_color}]Legion Commander[/color]\r\n{$aod_url}[/size]\r\n\r\n";
         } else {
             $division_structure .= "[size=3][color={$this->platoon_pos_color}]Legion Commander[/color]\r\n[color={$this->platoon_leaders_color}]TBA[/color][/size]\r\n\r\n";
         }
         // Regimental Leaders
         $squads = Squad::findAll($this->game_id, $platoon->id);
         foreach ($squads as $squad) {
             if ($squad->leader_id != 0) {
                 $squad_leader = Member::findById($squad->leader_id);
                 $player_name = Rank::convert($squad_leader->rank_id)->abbr . " " . $squad_leader->forum_name;
                 $aod_url = Member::createAODlink(array('member_id' => $squad_leader->member_id, 'forum_name' => $player_name, 'color' => $this->squad_leaders_color));
                 $division_structure .= "[size=3][color={$this->platoon_pos_color}]Regimental Leader[/color]\r\n{$aod_url}[/size]\r\n\r\n";
                 $division_structure .= "[size=1]";
                 // direct recruits
                 $recruits = arrayToObject(Member::findRecruits($squad_leader->member_id, $squad_leader->platoon_id, $squad->id, true));
                 if (count((array) $recruits)) {
                     $division_structure .= "[list=1]";
                     foreach ($recruits as $player) {
                         $player_name = Rank::convert($player->rank_id)->abbr . " " . $player->forum_name;
                         $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => $player_name));
                         $division_structure .= "[*]{$aod_url}\r\n";
                     }
                     $division_structure .= "[/list]";
                 }
             } else {
                 $division_structure .= "[size=3][color={$this->platoon_pos_color}]Regimental Leader[/color]\r\n[color={$this->squad_leaders_color}]TBA[/color][/size]\r\n";
                 $division_structure .= "[size=1]";
             }
             $division_structure .= "\r\n";
             // squad members
             $squadMembers = arrayToObject(Squad::findSquadMembers($squad->id, true, $squad_leader->member_id));
             if (count((array) $squadMembers)) {
                 foreach ($squadMembers as $player) {
                     $player_name = Rank::convert($player->rank_id)->abbr . " " . $player->forum_name;
                     $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => $player_name));
                     $division_structure .= "{$aod_url}\r\n";
                 }
             }
             $division_structure .= "[/size]\r\n";
         }
         $division_structure .= "\r\n\r\n";
         if ($i % $this->num_columns == 0) {
             $division_structure .= "[/td][/tr][tr]";
         }
         $division_structure .= "[/td]";
         $i++;
     }
     // end last platoon
//.........这里部分代码省略.........
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:101,代码来源:SWBDivisionStructure.php

示例4: generate

 public function generate()
 {
     // header
     $division_structure = "[table='width: {$this->info_width}']";
     $division_structure .= "[tr][td]";
     // banner
     $division_structure .= "[center][img]http://i.imgur.com/iWpjGZG.png[/img][/center]\r\n";
     /**
      * ------division leaders-----
      */
     $division_structure .= "\r\n\r\n[center][size=5][color={$this->div_name_color}][b][i][u]Division Leaders[/u][/i][/b][/color][/size][/center]\r\n";
     $division_structure .= "[center][size=4]";
     $division_leaders = Division::findDivisionLeaders($this->game_id);
     foreach ($division_leaders as $leader) {
         $leader_name = Rank::convert($leader->rank_id)->abbr . " " . $leader->forum_name;
         $memberHandle = MemberHandle::findHandle($leader->id, $this->division->primary_handle);
         $leader->handle = $memberHandle->handle_value;
         $aod_url = "[url=" . CLANAOD . $leader->member_id . "]";
         $bl_url = "[url=" . $memberHandle->url . $leader->handle . "][BL][/url]";
         $division_structure .= "{$aod_url}[color={$this->division_leaders_color}]{$leader_name}[/url] {$bl_url}[/color] - {$leader->position_desc}\r\n";
     }
     $division_structure .= "[/size][/center]\r\n\r\n";
     /**
      * -----general sergeants-----
      */
     $genSgts = Division::findGeneralSergeants($this->game_id);
     $division_structure .= "[center][size=3][color={$this->platoon_pos_color}]General Sergeants[/color]\r\n";
     foreach ($genSgts as $sgt) {
         $sgt_name = Rank::convert($sgt->rank_id)->abbr . " " . $sgt->forum_name;
         $memberHandle = MemberHandle::findHandle($sgt->id, $this->division->primary_handle);
         $sgt->handle = $memberHandle->handle_value;
         $aod_url = "[url=" . CLANAOD . $sgt->member_id . "]";
         $bl_url = "[url=" . $memberHandle->url . $sgt->handle . "][BL][/url]";
         $division_structure .= "{$aod_url}{$sgt_name}[/url] {$bl_url}\r\n";
     }
     $division_structure .= "[/size][/center]";
     $division_structure .= "[/td][/tr][/table]";
     /**
      * ---------platoons----------
      */
     $division_structure .= "\r\n\r\n[table='width: {$this->players_width}']";
     $platoons = $this->platoons;
     $i = 1;
     foreach ($platoons as $platoon) {
         $countMembers = Platoon::countPlatoon($platoon->id);
         if ($i == 1) {
             $division_structure .= "[tr]";
             $division_structure .= "[td]";
         } else {
             $division_structure .= "[td]";
         }
         $division_structure .= "[size=5][color={$this->platoon_num_color}]" . ordsuffix($i) . " Platoon[/color][/size] \r\n[i][size=3]{$platoon->name} [/size][/i]\r\n\r\n";
         // platoon leaders
         $leader = Member::findByMemberId($platoon->leader_id);
         if ($platoon->leader_id != 0) {
             $memberHandle = MemberHandle::findHandle($leader->id, $this->division->primary_handle);
             $leader->handle = $memberHandle->handle_value;
             $aod_url = "[url=" . CLANAOD . $leader->member_id . "]";
             $bl_url = "[url=" . $memberHandle->url . $leader->handle . "][BL][/url]";
             $leader_name = Rank::convert($leader->rank_id)->abbr . " " . ucwords($leader->forum_name);
             $division_structure .= "{$aod_url}[size=3][color={$this->platoon_pos_color}]Platoon Leader[/color]\r\n[color={$this->platoon_leaders_color}]{$leader_name}[/color][/url] {$bl_url}[/size]\r\n\r\n";
         } else {
             $division_structure .= "[size=3][color={$this->platoon_pos_color}]Platoon Leader[/color]\r\n[color={$this->platoon_leaders_color}]TBA[/color][/size]\r\n\r\n";
         }
         // squad leaders
         $squads = Squad::findAll($this->game_id, $platoon->id);
         foreach ($squads as $squad) {
             if ($squad->leader_id != 0) {
                 $leader = Member::findById($squad->leader_id);
                 $memberHandle = MemberHandle::findHandle($leader->id, $this->division->primary_handle);
                 $leader->handle = $memberHandle->handle_value;
                 $aod_url = "[url=" . CLANAOD . $leader->member_id . "]";
                 $bl_url = "[url=" . $memberHandle->url . $leader->handle . "][BL][/url]";
                 $division_structure .= "[size=3][color={$this->platoon_pos_color}]Squad Leader[/color]\r\n{$aod_url}[color={$this->squad_leaders_color}]" . Rank::convert($leader->rank_id)->abbr . " {$leader->forum_name}[/color][/url] {$bl_url}[/size]\r\n\r\n";
                 $division_structure .= "[size=1]";
                 // direct recruits
                 $recruits = arrayToObject(Member::findRecruits($leader->member_id, $leader->platoon_id, $squad->id, true));
                 if (count((array) $recruits)) {
                     $division_structure .= "[list=1]";
                     foreach ($recruits as $recruit) {
                         $memberHandle = MemberHandle::findHandle($recruit->id, $this->division->primary_handle);
                         // does member have a member handle?
                         if (count((array) $memberHandle)) {
                             $recruit->handle = $memberHandle->handle_value;
                             $bl_url = "[url=" . $memberHandle->url . $recruit->handle . "][BL][/url]";
                             $aod_url = "[url=" . CLANAOD . $recruit->member_id . "]";
                             $division_structure .= "[*]{$aod_url}" . Rank::convert($recruit->rank_id)->abbr . " {$recruit->forum_name}[/url]";
                             $division_structure .= "{$bl_url}\r\n";
                         } else {
                             $division_structure .= " [color=red]XX[/color]\r\n";
                         }
                     }
                     $division_structure .= "[/list]";
                 }
             } else {
                 $division_structure .= "[size=3][color={$this->platoon_pos_color}]Squad Leader[/color]\r\n[color={$this->squad_leaders_color}]TBA[/color][/size]\r\n";
                 $division_structure .= "[size=1]";
             }
             $division_structure .= "\r\n";
             // squad members
//.........这里部分代码省略.........
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:101,代码来源:WgDivisionStructure.php


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