public function lobbyData() { $data = array('blu' => grabLobbyPlayers($this->id, $this->type, 1), 'red' => grabLobbyPlayers($this->id, $this->type, 2), 'spec' => grabLobbyPlayers($this->id, $this->type, 0), 'size' => teamplayers($this->type)); return $data; }
function displayLobbyPlayers($lobbyID, $lobbytype, $team, $ready = false, $rate = false) { global $user; $uid = $user->id; global $lobby; $lobbyPlayers = grabLobbyPlayers($lobbyID, $lobbytype, $team); $display = ''; if ($team != 0) { foreach ($lobbyPlayers as $data) { if (!$ready && !$rate) { $display .= '<li><a href="profile.php?id=' . $data['id'] . '" target="_blank"> <img src="theme/images/class/' . $data['class'] . '.png" height="18">' . $data["nickname"] . ' <img class="avatar" src=' . $data['avatar'] . '></a></li>'; } if ($ready) { $id = getLPid($data['id'], $lobbyID); $readystatus = readystatus($id, true); if ($readystatus == 1 && $lobby->leader != $data['id']) { $class = '<li class="ready">'; } if ($readystatus == 0 && $lobby->leader != $data['id']) { $class = '<li class="not_ready">'; } if ($lobby->leader == $data['id']) { $class = '<li class="lobby_leader">'; } if ($data['id']) { $link = '<a href="profile.php?id=' . $data['id'] . '" target="_blank">'; $linkend = '</a>'; } else { $link = '<div onclick="joinGame(' . $lobby->ID . ')">'; $linkend = '</div>'; } $display .= $class . $link . ' <img src="theme/images/class/' . $data['class'] . '.png" height="18">' . $data["nickname"] . ' <img class="avatar" src=' . $data['avatar'] . '>' . $linkend . '</li>'; } if ($rate) { $display .= '<li><a href="profile.php?id=' . $data['id'] . '" target="_blank"> <img src="theme/images/class/' . $data['class'] . '.png" height="18">' . $data["nickname"] . ' <img class="avatar" src=' . $data['avatar'] . '></a>' . ($uid != $data['id'] ? '<span class="rate_switch"><a href="#rate_up:userid" class="rate_up" data-id="' . $data['id'] . '">+</a><a "#rate_down:userid" class="rate_down" data-id="' . $data['id'] . '">-</a></span>' : '') . '</li>'; } $n++; } for ($n; $n < teamplayers($lobbytype); $n++) { $display .= '<li class="empty"><img src="theme/images/class/noclass.png" height="18">empty</li>'; } } else { foreach ($lobbyPlayers as $data) { if ($display == "") { $display .= $data['nickname']; } else { $display .= ', ' . $data['nickname']; } } } return $display; }