Mercurial > hg > batmud > maputils
annotate www/info.php @ 1391:7fcea2fce0be
More fixes.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 23 Dec 2013 17:08:10 +0200 |
parents | 2b6b38e94bb2 |
children | 6d620441af7f |
rev | line source |
---|---|
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 <? |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 require "config.inc.php"; |
1272 | 3 require "world.inc.php"; |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
4 require "common.inc.php"; |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
6 /* Page start |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 */ |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
8 printPageHeader($pageTitle." - Wizards of the Realm"); |
1140
3bb8253db932
New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
1115
diff
changeset
|
9 |
3bb8253db932
New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
1115
diff
changeset
|
10 require "menu.inc.php"; |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 ?> |
1140
3bb8253db932
New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
1115
diff
changeset
|
12 <div id="contents"> |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 <h1>Wizards of the Realm</h1> |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 |
886 | 15 <div class="attnbox"> |
516 | 16 <b>Notice #1</b>: The area counts are not really accurate, as the database only |
17 lists areas accessible from outworld. Thus areas only accessible via some | |
18 other fashion are not listed. Also, maintainerships of some areas are not | |
19 clear, and may be credited to wrong wizard(s). | |
20 <br /> | |
21 | |
22 <b>Notice #2</b>: Not everyone who has once been immortal is listed. | |
23 Some purged and/or remorted wizards without known contributions are unlisted. | |
24 <br /> | |
25 | |
26 <b>Notice #3</b>: It is certainly possible, that some of this information is | |
27 incorrect. Sorry for that. Please report to <? burl("Ggr") ?>, if you have Knowledge(tm). | |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 </div> |
1140
3bb8253db932
New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
1115
diff
changeset
|
29 <hr /> |
516 | 30 <div style="text-align: center;"> |
31 <table style="background: black;"> | |
32 <tr> | |
33 <td style="background: #474">Entry has information about the wizard.</td> | |
34 <td style="background: #744">No wizard information entry.</td> | |
35 </tr> | |
36 </table> | |
37 </div> | |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
38 <? |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
39 |
1150
02fe48a608d7
Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents:
1148
diff
changeset
|
40 $locTable = apc_fetch("info_locTable"); |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
41 if (empty($locTable)) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
42 { |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
43 $locTable = stReadLocationFiles(); |
1150
02fe48a608d7
Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents:
1148
diff
changeset
|
44 apc_store("info_locTable", $locTable, 3600); |
02fe48a608d7
Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents:
1148
diff
changeset
|
45 } |
02fe48a608d7
Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents:
1148
diff
changeset
|
46 $wizTable = apc_fetch("wizTable"); |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
47 if (empty($wizTable)) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
48 { |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
49 $wizTable = stReadWizInfoFiles(); |
1150
02fe48a608d7
Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents:
1148
diff
changeset
|
50 apc_store("wizTable", $wizTable, 3600); |
02fe48a608d7
Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents:
1148
diff
changeset
|
51 } |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
52 |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
53 |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
54 if (isset($_GET["a"])) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
55 { |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
56 $coderName = basename($_GET["a"]); |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
57 $coderName = strtoupper(substr($coderName, 0, 1)).strtolower(substr($coderName, 1)); |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
58 } |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
59 |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
60 |
1115 | 61 function wizardSort($a, $b) |
62 { | |
63 return strcmp($a["name"], $b["name"]); | |
64 } | |
65 | |
66 | |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
67 /* Print table of wizards |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
68 */ |
1334 | 69 foreach ($locTable as $location) |
70 { | |
71 foreach ($location["coders"] as $wiz) | |
72 { | |
975
af0fc3a965dc
Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
896
diff
changeset
|
73 $name = $wiz["name"]; |
af0fc3a965dc
Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
896
diff
changeset
|
74 if (!isset($wizTable[$name])) |
1334 | 75 $wizTable[$name] = array("name" => $name, "areas" => 0); |
76 $wizTable[$name]["areas"]++; | |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
77 } |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
78 } |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
79 |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
80 if (count($wizTable) > 0) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
81 { |
1007 | 82 /* Make alphabetically sorted table of wizards |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
83 */ |
1007 | 84 foreach ($wizTable as $alpha => $data) |
85 $alphaTable[$alpha[0]][] = $data; | |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
86 |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
87 ksort($alphaTable, SORT_STRING); |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
88 |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
89 |
1007 | 90 /* Print wizards alphabetically per first character of name |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
91 */ |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
92 $totalWiz = 0; |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
93 $maxRow = 6; |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
94 foreach ($alphaTable as $alpha => $data) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
95 if (count($data) > 0) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
96 { |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
97 usort($data, "wizardSort"); |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
98 |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
99 $letter = strtoupper($alpha); |
1391 | 100 echo "<h3><a id=\"ch".$letter."\"></a>".$letter."</h3>\n"; |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
101 echo "<table class=\"loc\">\n"; |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
102 $n = 0; |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
103 |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
104 foreach ($data as $wizard) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
105 { |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
106 if ($n == 0) echo " <tr>\n"; |
1115 | 107 |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
108 $totalWiz++; |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
109 |
1391 | 110 printf(" <td style=\"width: %d%%; background: %s;\">". |
111 "<a href=\"loc.php?a=%s\">%s</a> <span style=\"color: #f80;\">", | |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
112 (100 / $maxRow), (count($wizard) > 2 || isset($wizard["desc"])) ? "#474" : "#744", $wizard["name"], $wizard["name"]); |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
113 |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
114 if ($wizard["areas"] > 0) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
115 echo " (".$wizard["areas"].")"; |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
116 |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
117 echo "</span></td>\n"; |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
118 |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
119 $n++; |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
120 if ($n >= $maxRow) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
121 { |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
122 echo " </tr>\n"; |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
123 $n = 0; |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
124 } |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
125 } |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
126 |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
127 if ($n > 0) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
128 { |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
129 while ($n++ < $maxRow) |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
130 echo " <td></td>\n"; |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
131 echo " </tr>\n"; |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
132 } |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
133 echo "</table>\n"; |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
134 } |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
135 |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
136 echo "<p><b>".$totalWiz."</b> wizards.</p>\n"; |
1140
3bb8253db932
New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
1115
diff
changeset
|
137 |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
138 // Print out the alpha link index |
1391 | 139 stPrintExtraBoxAlphaList("ch", $alphaTable); |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
140 } |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
141 else |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
142 { |
337
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
143 echo "<p><b>No wizards known!</b></p>\n"; |
ca191c3a0ce1
Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
144 } |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
145 |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
146 cmPrintPageFooter(); |
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1334
diff
changeset
|
147 ?> |