annotate www/info.php @ 1334:73dd95d63e7a

Upstream sync.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 09 Sep 2012 01:15:52 +0300
parents ab28c4ddf8b0
children 2b6b38e94bb2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
Matti Hamalainen <ccr@tnsp.org>
parents: 1150
diff changeset
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
Matti Hamalainen <ccr@tnsp.org>
parents: 678
diff changeset
15 <div class="attnbox">
516
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
16 <b>Notice #1</b>: The area counts are not really accurate, as the database only
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
17 lists areas accessible from outworld. Thus areas only accessible via some
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
18 other fashion are not listed. Also, maintainerships of some areas are not
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
19 clear, and may be credited to wrong wizard(s).
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
20 <br />
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
21
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
22 <b>Notice #2</b>: Not everyone who has once been immortal is listed.
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
23 Some purged and/or remorted wizards without known contributions are unlisted.
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
24 <br />
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
25
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
26 <b>Notice #3</b>: It is certainly possible, that some of this information is
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
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
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
30 <div style="text-align: center;">
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
31 <table style="background: black;">
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
32 <tr>
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
33 <td style="background: #474">Entry has information about the wizard.</td>
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
34 <td style="background: #744">No wizard information entry.</td>
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
35 </tr>
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
36 </table>
0fba99438f1b Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 504
diff changeset
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");
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
41 if (empty($locTable)) {
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
42 $locTable = readLocationFiles();
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
43 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
44 }
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
45 $wizTable = apc_fetch("wizTable");
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
46 if (empty($wizTable)) {
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
47 $wizTable = readWizInfoFiles();
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
48 apc_store("wizTable", $wizTable, 3600);
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
49 }
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 if (isset($_GET["a"])) {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 $coderName = basename($_GET["a"]);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 $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
55 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57
1115
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
58 function wizardSort($a, $b)
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
59 {
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
60 return strcmp($a["name"], $b["name"]);
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
61 }
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
62
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
63
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 /* Print table of wizards
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 */
1334
73dd95d63e7a Upstream sync.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
66 foreach ($locTable as $location)
73dd95d63e7a Upstream sync.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
67 {
73dd95d63e7a Upstream sync.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
68 foreach ($location["coders"] as $wiz)
73dd95d63e7a Upstream sync.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
69 {
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
70 $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
71 if (!isset($wizTable[$name]))
1334
73dd95d63e7a Upstream sync.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
72 $wizTable[$name] = array("name" => $name, "areas" => 0);
73dd95d63e7a Upstream sync.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
73 $wizTable[$name]["areas"]++;
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 if (count($wizTable) > 0) {
1007
Matti Hamalainen <ccr@tnsp.org>
parents: 975
diff changeset
78 /* Make alphabetically sorted table of wizards
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 */
1007
Matti Hamalainen <ccr@tnsp.org>
parents: 975
diff changeset
80 foreach ($wizTable as $alpha => $data)
Matti Hamalainen <ccr@tnsp.org>
parents: 975
diff changeset
81 $alphaTable[$alpha[0]][] = $data;
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 ksort($alphaTable, SORT_STRING);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85
1007
Matti Hamalainen <ccr@tnsp.org>
parents: 975
diff changeset
86 /* 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
87 */
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 $totalWiz = 0;
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 $maxRow = 6;
1007
Matti Hamalainen <ccr@tnsp.org>
parents: 975
diff changeset
90 foreach ($alphaTable as $alpha => $data) {
Matti Hamalainen <ccr@tnsp.org>
parents: 975
diff changeset
91 if (count($data) > 0) {
1115
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
92 usort($data, "wizardSort");
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
93
1148
52550f58cee5 Move alphabetic table printing code to a function in common routines.
Matti Hamalainen <ccr@tnsp.org>
parents: 1140
diff changeset
94 $letter = strtoupper($alpha);
52550f58cee5 Move alphabetic table printing code to a function in common routines.
Matti Hamalainen <ccr@tnsp.org>
parents: 1140
diff changeset
95 echo "<h3><a name=\"".$letter."\"></a>".$letter."</h3>\n";
1140
3bb8253db932 New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 1115
diff changeset
96 echo "<table class=\"loc\">\n";
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 $n = 0;
1007
Matti Hamalainen <ccr@tnsp.org>
parents: 975
diff changeset
98
Matti Hamalainen <ccr@tnsp.org>
parents: 975
diff changeset
99 foreach ($data as $wizard) {
896
7cc73b376945 Cleanups, sync.
Matti Hamalainen <ccr@tnsp.org>
parents: 886
diff changeset
100 if ($n == 0) echo " <tr>\n";
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 $totalWiz++;
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 printf(" <td width=\"%d%%\" style=\"background: %s;\"><a href=\"loc.php?a=%s\">%s</a> <span style=\"color: #f80;\">",
1007
Matti Hamalainen <ccr@tnsp.org>
parents: 975
diff changeset
105 (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
106
1334
73dd95d63e7a Upstream sync.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
107 if ($wizard["areas"] > 0)
1007
Matti Hamalainen <ccr@tnsp.org>
parents: 975
diff changeset
108 echo " (".$wizard["areas"].")";
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110 echo "</span></td>\n";
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 $n++;
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 if ($n >= $maxRow) {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 echo " </tr>\n";
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 $n = 0;
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118 if ($n > 0) {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 while ($n++ < $maxRow)
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 echo " <td></td>\n";
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 echo " </tr>\n";
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 echo "</table>\n";
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 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
129
3bb8253db932 New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 1115
diff changeset
130 /* Print out the alpha link index
3bb8253db932 New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 1115
diff changeset
131 */
1148
52550f58cee5 Move alphabetic table printing code to a function in common routines.
Matti Hamalainen <ccr@tnsp.org>
parents: 1140
diff changeset
132 printExtraBoxAlphaList($alphaTable);
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133 } else {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 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
135 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 ?>
1140
3bb8253db932 New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 1115
diff changeset
137 </div>
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 </body>
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139 </html>