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(); } }
public static function profile($cid) { global $lng, $coach; $c = new self($cid); $ALLOW_EDIT = is_object($coach) && ($c->coach_id == $coach->coach_id || $coach->mayManageObj(T_OBJ_COACH, $c->coach_id)); # Coach (or admin) visting own profile? title($c->name); echo "<hr>"; $c->_menu($ALLOW_EDIT); switch (isset($_GET['subsec']) ? $_GET['subsec'] : 'teams') { case 'profile': $c->_CCprofile($ALLOW_EDIT); break; case 'stats': $c->_stats(); break; case 'newteam': $c->_newTeam($ALLOW_EDIT); break; case 'teams': $c->_teams($ALLOW_EDIT); break; case 'recentmatches': $c->_recentGames(); break; } }