annotate www/ss.php @ 2819:7f90630781a7

Cleanup.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 14 Apr 2024 20:19:46 +0300
parents 164aa519640d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1646
2cbce82aa3c3 Use full <?php ?> tag, misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1620
diff changeset
1 <?php
515
5878c5a65bae Added separate SS information page.
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";
515
5878c5a65bae Added separate SS information page.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 require "common.inc.php";
5878c5a65bae Added separate SS information page.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
2033
57ecb49d7b4a Update the apc functions to use apcu_ prefix.
Matti Hamalainen <ccr@tnsp.org>
parents: 2032
diff changeset
6 $locTable = apcu_fetch("ss_locTable");
57ecb49d7b4a Update the apc functions to use apcu_ prefix.
Matti Hamalainen <ccr@tnsp.org>
parents: 2032
diff changeset
7 $locPTable = apcu_fetch("ss_locPTable");
1648
05380d6fa45d Implement showing of 'special' SS locations in the SS list.
Matti Hamalainen <ccr@tnsp.org>
parents: 1646
diff changeset
8 if (empty($locTable) || empty($locPTable))
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
9 {
2037
e82ba6f55708 Refactor how the location filtering works internally to use proper LOC flags.
Matti Hamalainen <ccr@tnsp.org>
parents: 2033
diff changeset
10 $locTable = mpParseLocFiles(TRUE, FALSE, LOCF_M_PCITY);
e82ba6f55708 Refactor how the location filtering works internally to use proper LOC flags.
Matti Hamalainen <ccr@tnsp.org>
parents: 2033
diff changeset
11 mpParseLocFile("limbo", $locTable, TRUE, FALSE, LOCF_M_PCITY);
e82ba6f55708 Refactor how the location filtering works internally to use proper LOC flags.
Matti Hamalainen <ccr@tnsp.org>
parents: 2033
diff changeset
12 $locPTable = mpParseLocFiles(TRUE, FALSE, LOCF_T_SS);
1648
05380d6fa45d Implement showing of 'special' SS locations in the SS list.
Matti Hamalainen <ccr@tnsp.org>
parents: 1646
diff changeset
13
2033
57ecb49d7b4a Update the apc functions to use apcu_ prefix.
Matti Hamalainen <ccr@tnsp.org>
parents: 2032
diff changeset
14 apcu_store("ss_locTable", $locTable, 3600);
57ecb49d7b4a Update the apc functions to use apcu_ prefix.
Matti Hamalainen <ccr@tnsp.org>
parents: 2032
diff changeset
15 apcu_store("ss_locPTable", $locPTable, 3600);
1150
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1140
diff changeset
16 }
1092
Matti Hamalainen <ccr@tnsp.org>
parents: 1060
diff changeset
17
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
18 // Page start
1620
6d620441af7f Rename various functions, and other cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1451
diff changeset
19 mpPrintPageHeader($pageTitle." - Secret societies");
2819
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
20 ?>
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
21 <h1>Secret societies of BatMUD</h1>
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
22 <div class="attnbox">
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
23 </div>
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
24 <hr />
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
25 <?php
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
26 // Print list of societies
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
27 // Make the list array
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
28 foreach ($locTable as $key => $value)
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
29 foreach ($value["authors"] as $name)
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
30 $sortTable[$name["name"]] = $value;
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
31
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
32 foreach ($locPTable as $key => $value)
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
33 $sortTable[$value["name"]] = $value;
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
34
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
35 ksort($sortTable);
515
5878c5a65bae Added separate SS information page.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
37 echo
2819
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
38 "<table class=\"locTable societies\">\n".
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
39 " <tr>\n".
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
40 " <th>Society name</th>\n".
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
41 " <th>Player city/location</th>\n".
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
42 " <th>Continent</th>\n".
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
43 " </tr>\n";
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
44
2819
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
45 foreach ($sortTable as $name => $data)
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
46 {
2819
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
47 $cont = $data["continent"];
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
48 $link = $continentList[$cont][CTI_HAS_MAP];
515
5878c5a65bae Added separate SS information page.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 echo
1092
Matti Hamalainen <ccr@tnsp.org>
parents: 1060
diff changeset
50 " <tr>\n".
2819
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
51 " <td>".mpGetMapURLLink($data, $link, $name, TRUE)."</td>\n".
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
52 " <td class=\"".$cont."\">".mpGetMapLink($data, $link, TRUE, FALSE)."</td>\n".
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
53 " <td>".chentities($continentList[$cont][CTI_NAME])."</td>\n".
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
54 " </tr>\n";
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
55 }
2819
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
56 echo
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
57 "</table>\n".
7f90630781a7 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
58 "<p><b>".count($sortTable)."</b> societies.</p>\n";
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
59
1891
68b784c7eae2 Get rid of mgeneric.inc.php here.
Matti Hamalainen <ccr@tnsp.org>
parents: 1687
diff changeset
60 mpPrintPageFooter();
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
61 ?>