-
Notifications
You must be signed in to change notification settings - Fork 4
/
guild_standings.php
134 lines (131 loc) · 2.98 KB
/
guild_standings.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
134
<?php
require 'memory.php';
require 'header.inc';
check_auth($_SERVER['PHP_SELF']); // checks for required access
if ($GET_guild != "") {
ShowGuildInfo($GET_guild);
}
// Displays Guild Ladder
$query = SHOW_GUILD_LADDER;
$result = execute_query($query, "guild_standings.php", $CONFIG_display_guild_limit, 0);
EchoHead(80);
echo "
<tr class=mytitle>
<td colspan=7>$CONFIG_server_name Guild Ladder</td>
</tr>
<tr class=myheader>
<td>Emblem</td>
<td>Guild</td>
<td>Master</td>
<td>Guild Level</td>
<td>Members</td>
<td>Average Level</td>
<td>Total EXP</td>
</tr>
";
if ($result->RowCount() == 0) {
echo "<tr class=mycell><td colspan=7>No guilds exist yet!</td></tr>";
}
else {
while ($line = $result->FetchRow()) {
$display_emblem_id = md5($line[0] . $CONFIG_passphrase);
echo "
<tr class=mycell>
";
if ($CONFIG_load_guild_emblem) {
$emblem_location = "emblem/emblem.php?id=$display_emblem_id";
}
else {
$emblem_location = "emblem/$display_emblem_id.bmp";
if (!file_exists($emblem_location)) {
$emblem_location = "emblem/none.gif";
}
}
echo "
<td>
<img src=\"$emblem_location\">
</td>
";
foreach ($line as $display_index => $col_value) {
if ($display_index == 0) {
continue;
}
elseif ($display_index == 1) {
$display_emblem_id = md5($line[0] . $CONFIG_passphrase);
$col_value = "<a href=\"guild_standings.php?guild=$display_emblem_id\">$col_value</a>";
}
elseif ($display_index == 4) {
$col_value = "{$line[4]}/{$line[5]}";
}
elseif ($display_index == 5) {
continue;
}
echo "
<td>$col_value</td>";
}
echo "
</tr>";
}
}
echo "
</table>
<p>";
// Display Castle Status
$query = SHOW_GUILD_CASTLES;
$result = execute_query($query, "guild_standings.php");
EchoHead(80);
echo "
<tr class=mytitle>
<td colspan=3>$CONFIG_server_name Guild Castle Standings</td>
</tr>
<tr class=myheader>
<td>Castle</td>
<td>Guild</td>
<td>Emblem</td>
</tr>
";
if ($result->RowCount() == 0) {
echo "
<tr class=mycell>
<td colspan=3>No castles have been taken yet!</td>
</tr>
</table>";
}
else {
while ($line = $result->FetchRow()) {
$display_emblem_id = md5($line[1] . $CONFIG_passphrase);
echo "<tr class=mycell>\n";
foreach ($line as $display_index => $col_value) {
if ($display_index == 0) {
if ($CONFIG_server_type != 0) {
$col_value = determine_castle($col_value);
}
}
elseif ($display_index == 1) {
if ($col_value == 0) {
$col_value = "None";
}
else {
$col_value = $line[2];
}
}
elseif ($display_index == 2) {
continue;
}
echo "<td>$col_value</td>\n";
}
$emblem_location = "emblem/$display_emblem_id.bmp";
if (!file_exists($emblem_location)) {
$emblem_location = "emblem/none.bmp";
}
echo "
<td>
<img src=\"$emblem_location\">
</td>
";
echo "</tr>\n";
}
echo "</table>\n";
}
require 'footer.inc';
?>