Mercurial > hg > batmud > maputils
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 |
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 | 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 | 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 | 20 ?> |
21 <h1>Secret societies of BatMUD</h1> | |
22 <div class="attnbox"> | |
23 </div> | |
24 <hr /> | |
25 <?php | |
26 // Print list of societies | |
27 // Make the list array | |
28 foreach ($locTable as $key => $value) | |
29 foreach ($value["authors"] as $name) | |
30 $sortTable[$name["name"]] = $value; | |
31 | |
32 foreach ($locPTable as $key => $value) | |
33 $sortTable[$value["name"]] = $value; | |
34 | |
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 | 38 "<table class=\"locTable societies\">\n". |
39 " <tr>\n". | |
40 " <th>Society name</th>\n". | |
41 " <th>Player city/location</th>\n". | |
42 " <th>Continent</th>\n". | |
43 " </tr>\n"; | |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1272
diff
changeset
|
44 |
2819 | 45 foreach ($sortTable as $name => $data) |
1387
2b6b38e94bb2
Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1272
diff
changeset
|
46 { |
2819 | 47 $cont = $data["continent"]; |
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 | 50 " <tr>\n". |
2819 | 51 " <td>".mpGetMapURLLink($data, $link, $name, TRUE)."</td>\n". |
52 " <td class=\"".$cont."\">".mpGetMapLink($data, $link, TRUE, FALSE)."</td>\n". | |
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 | 56 echo |
57 "</table>\n". | |
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 ?> |