-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.php
32 lines (21 loc) · 1.29 KB
/
player.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require_once("common.php");
$ladderID = get("ladder");
$userID = get("player");
checkLadderPlayer($ladderID, $userID);
$ladderName = db()->stdGet("ladders", array("ladderID"=>$ladderID), "name");
$playerName = db()->stdGet("users", array("userID"=>$userID), "name");
$playerNameHtml = htmlentities($playerName);
$ladderNameHtml = htmlentities($ladderName);
$html = "";
$playerRank = db()->stdGet("ladderPlayers", array("ladderID"=>$ladderID, "userID"=>$userID), "rank");
$html .= renderRanking($ladderID, "$playerNameHtml's rank", "There don't seem to be any players on this ladder.", $userID, max($playerRank - 6, 0), 10);
$html .= renderGames($userID, $ladderID, "$playerNameHtml's recent games", "$playerNameHtml has not played any games on this ladder yet.", 0, 10);
if(isMod($ladderID)) {
$html .= operationForm("modladder.php?ladder=$ladderID", "", "Ban player from ladder", "ban", array(
array("type"=>"hidden", "name"=>"action", "value"=>"ban-player"),
array("type"=>"hidden", "name"=>"userID", "value"=>$userID),
), null);
}
$titleHtml = "$playerNameHtml's activity on <a href=\"ladder.php?ladder=$ladderID\">$ladderNameHtml</a>";
page($html, "player", "$playerNameHtml's activity", "<a href=\"ladder.php?ladder=$ladderID\">$ladderNameHtml</a>", null, "$playerName's activity - $ladderName");