Example #1
0
 public static function profile($pid)
 {
     if ($pid < 0) {
         fatal('Sorry, star players to do have regular player profiles.');
     }
     global $lng, $coach, $settings;
     $p = new self($pid);
     $team = new Team($p->owned_by_team_id);
     /* Argument(s) passed to generating functions. */
     $ALLOW_EDIT = is_object($coach) && ($team->owned_by_coach_id == $coach->coach_id || $coach->isNodeCommish(T_NODE_LEAGUE, $team->f_lid)) && !$team->is_retired;
     /* Player pages consist of the output of these generating functions. */
     $p->_handleActions($ALLOW_EDIT);
     # Handles any actions/request sent.
     $p->_head($team);
     $p->_about($ALLOW_EDIT);
     $p->_achievements();
     $p->_matchBest();
     $p->_recentGames();
     $p->_injuryHistory();
     if (!$settings['hide_ES_extensions']) {
         $p->_ES();
     }
 }
Example #2
0
 public static function profile($tid)
 {
     global $coach, $settings, $rules;
     $t = new self($tid);
     setupGlobalVars(T_SETUP_GLOBAL_VARS__LOAD_LEAGUE_SETTINGS, array('lid' => $t->f_lid));
     // Load correct $rules for league.
     /* Argument(s) passed to generating functions. */
     $ALLOW_EDIT = is_object($coach) && ($t->owned_by_coach_id == $coach->coach_id || $coach->mayManageObj(T_OBJ_TEAM, $tid)) && !$t->is_retired;
     # Show team action boxes?
     $DETAILED = isset($_GET['detailed']) && $_GET['detailed'] == 1;
     # Detailed roster view?
     /* Team pages consist of the output of these generating functions. */
     $t->_handleActions($ALLOW_EDIT);
     # Handles any actions/request sent.
     list($players, $players_backup) = $t->_loadPlayers($DETAILED);
     # Should come after _handleActions().
     $t->_roster($ALLOW_EDIT, $DETAILED, $players);
     $players = $players_backup;
     # Restore the $players array (_roster() manipulates the passed $players array).
     $t->_menu($ALLOW_EDIT, $DETAILED);
     switch (isset($_GET['subsec']) ? $_GET['subsec'] : 'man') {
         case 'hhmerc':
             $t->_HHMerc($DETAILED);
             break;
         case 'hhstar':
             $t->_HHStar($DETAILED);
             break;
         case 'man':
             $t->_actionBoxes($ALLOW_EDIT, $players);
             break;
         case 'about':
             $t->_about($ALLOW_EDIT);
             break;
         case 'news':
             $t->_news($ALLOW_EDIT);
             break;
         case 'games':
             $t->_games();
             break;
     }
     if (isset($_GET['subsec'])) {
         ?>
     <script language="JavaScript" type="text/javascript">
     window.location = "#anc";
     </script>
     <?php 
     }
 }