-
Notifications
You must be signed in to change notification settings - Fork 0
/
personinfo.php
133 lines (130 loc) · 5.64 KB
/
personinfo.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
// INCLUDES
require_once("includes/session.php");
require_once("includes/connect.php");
require_once("includes/functions.php");
// SETTINGS: page
$settingsQ = mysql_query("SELECT * FROM settings WHERE settingsID = '1'", $connection); $settingsR = mysql_fetch_array($settingsQ);
$pagetitle = $settingsR["pagetitle"];
$errorreporting = $settingsR["errorreporting"]; error_reporting($errorreporting);
// CHECK: variables AND auth
$pid = $_SESSION['pid'];
$member = sql_quote($_GET['pid']);
$action = sql_quote($_GET['action']);
// SITE PAGE CONTROL
if (isset($_GET['action'])) {$action = sql_quote($_GET['action']);} else {$action = 'teams';}
// SET: buttons
if (isset($pid) && ($member == $pid)) {
$editB = "<FORM><INPUT type='button' value='edit' onClick=\"window.location='index.php?site=personedit'\"></FORM>";
$guidB = "<FORM><INPUT type='button' value='add guid' onClick=\"window.location='index.php?site=guids'\"></FORM>";
$clanB = "<FORM><INPUT type='button' value='create team' onClick=\"window.location='index.php?site=createteam'\"></FORM>";
$messageB = "";
} else {
$editB = "";
$guidB = "";
$clanB = "";
$messageB = "<button type='button' onclick=\"window.location='index.php?site=messagenew&memberID=$member'\">send pm</button>";
}
// QUERY: menuBAN
$bansQ = mysql_query("SELECT * FROM bans WHERE memberID = '$member'", $connection);
if (mysql_num_rows($bansQ)) {$menuBAN = "<li><a href='index.php?site=personinfo&pid=$member&action=bans' title='New'>BANS</a></li>";} else {$menuBAN = "";}
// QUERY: users
$memberQ = mysql_query("SELECT * FROM users WHERE pid = '$member'", $connection);
if (mysql_num_rows($memberQ) == '0') {echo "<h4>• There is no player with that ID!</h4>"; return;}
$memberR = mysql_fetch_array($memberQ);
$nickname = $memberR["nickname"];
$country = $memberR["country"];
$countryCODE = strtolower($country);
$countryNAME = countryname($country);
$gender = $memberR["gender"];
$country = $memberR["flags"];
$membersince = date("d.m.Y", $memberR[joined]);
$avatarURL = $memberR["pic"];
$lastactive = $memberR["lastactive"];
// QUERY: status
$userSTATUS = getstatus($lastactive);
// OUTPUT: personinfo
eval ("\$personinfo = \"".gettemplate("personinfo")."\";");
echo $personinfo;
// ACTION: guids
if ($action == "guids") {
// OUTPUT: subGUIDS
eval ("\$subGUIDS = \"".gettemplate("subGUIDS")."\";");
echo $subGUIDS;
// QUERY: player guids
$playerguidQ = mysql_query("SELECT * FROM playerguids WHERE pid = '$member' AND active = '1' ORDER BY guidID DESC", $connection);
if (mysql_num_rows($playerguidQ) == '0') {$guidLIST = "<h4> There is no guids to display.</h4>";}
while ($playerguidR = mysql_fetch_array($playerguidQ)) {
$guidVALUE = $playerguidR["value"];
$guidDATE = date("d.m.Y H:i", $playerguidR[date]);
$guidID = $playerguidR["guidID"];
// QUERY: guid
$guidQ = mysql_query("SELECT * FROM guids WHERE guidID = '$guidID'", $connection); $guidR = mysql_fetch_array($guidQ); $guidTITLE = $guidR["title"];
// LIST: matches
eval ("\$subGUIDS = \"".getlist("subGUIDS")."\";"); echo $subGUIDS;
}
}
// ACTION: teams
if ($action == "teams") {
// OUTPUT: subTEAMS
eval ("\$subTEAMS = \"".gettemplate("subTEAMS")."\";");
echo $subTEAMS;
// QUERY: player teams
$playerteamsQ = mysql_query("SELECT * FROM teammembers WHERE pid = '$member' AND accepted = '1' ORDER BY id DESC", $connection);
if (mysql_num_rows($playerteamsQ) == '0') {$teamLIST = "<h4> There is no teams to display.</h4>";}
while ($playerteamsR = mysql_fetch_array($playerteamsQ)) {
$teamID = $playerteamsR["teamID"];
$joined = date("d.m.Y - H:i", $playerteamsR[joined]);
$rights = $playerteamsR["rights"];
// QUERY: team
$teamQ = mysql_query("SELECT * FROM teams WHERE teamID = '$teamID'", $connection);
$teamR = mysql_fetch_array($teamQ); $teamNAME = $teamR["name"];
$teamTAG = $teamR["tag"];
// LIST: matches
if (mysql_num_rows($teamQ) != '0') {
eval ("\$subTEAMS = \"".getlist("subTEAMS")."\";"); echo $subTEAMS;
}
}
}
// ACTION: guid history
if ($action == "guidslog") {
$guidID = sql_quote($_GET['guidID']);
// QUERY: guid
$guidQ = mysql_query("SELECT * FROM guids WHERE guidID = '$guidID'", $connection); $guidR = mysql_fetch_array($guidQ); $guidTITLE = $guidR["title"];
// OUTPUT: subTEAMS
eval ("\$subGUIDSLOG = \"".gettemplate("subGUIDSLOG")."\";");
echo $subGUIDSLOG;
// QUERY: player teams
$playerguidQ = mysql_query("SELECT * FROM playerguids WHERE pid = '$member' AND guidID = '$guidID' ORDER BY date DESC", $connection);
while ($playerguidR = mysql_fetch_array($playerguidQ)) {
$guidVALUE = $playerguidR["value"];
$guidDATE = date("d.m.Y H:i", $playerguidR[date]);
$guidID = $playerguidR["guidID"];
$active = $playerguidR["active"];
if ($active == '1') {$guidVALUE = "<h4 class='green'>".$guidVALUE."</h4>";}
// LIST: matches
eval ("\$subGUIDSLOG = \"".getlist("subGUIDSLOG")."\";"); echo $subGUIDSLOG;
}
}
// ACTION: ban history
if ($action == "bans") {
// OUTPUT: subTEAMS
eval ("\$subBANS = \"".gettemplate("subBANS")."\";");
echo $subBANS;
// QUERY: bans
$banQ = mysql_query("SELECT * FROM bans WHERE memberID = '$member'", $connection);
while ($banR = mysql_fetch_array($banQ)) {
$adminID = $banR["adminID"];
$reason = $banR["reason"];
$bandate = date("d.m.Y H:i", $banR[date]);
$expire = date("d.m.Y H:i", $banR[expire]);
$expireSTAMP = $banR["expire"];
$date = time();
if ($expireSTAMP < $date) {$class = "class='green'";} else {$class = "class='red'";}
// QUERY: admin
$adminQ = mysql_query("SELECT * FROM users WHERE pid = '$adminID'", $connection); $adminR = mysql_fetch_array($adminQ); $adminNAME = $adminR["nickname"];
// LIST: matches
eval ("\$subBANS = \"".getlist("subBANS")."\";"); echo $subBANS;
}
}
?>