comparison www/ss.php @ 2819:7f90630781a7

Cleanup.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 14 Apr 2024 20:19:46 +0300
parents 164aa519640d
children
comparison
equal deleted inserted replaced
2818:783495d9fa7f 2819:7f90630781a7
15 apcu_store("ss_locPTable", $locPTable, 3600); 15 apcu_store("ss_locPTable", $locPTable, 3600);
16 } 16 }
17 17
18 // Page start 18 // Page start
19 mpPrintPageHeader($pageTitle." - Secret societies"); 19 mpPrintPageHeader($pageTitle." - Secret societies");
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);
20 36
21 echo 37 echo
22 "<h1>Secret societies of BatMUD</h1>\n"; 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";
23 44
24 // Print list of societies 45 foreach ($sortTable as $name => $data)
25 if (count($locTable) > 0)
26 { 46 {
27 // Make the list array 47 $cont = $data["continent"];
28 foreach ($locTable as $key => $value) 48 $link = $continentList[$cont][CTI_HAS_MAP];
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);
36
37 echo 49 echo
38 "<table class=\"locTable societies\">\n".
39 " <tr>\n". 50 " <tr>\n".
40 " <th>Society name</th>\n". 51 " <td>".mpGetMapURLLink($data, $link, $name, TRUE)."</td>\n".
41 " <th>Player city/location</th>\n". 52 " <td class=\"".$cont."\">".mpGetMapLink($data, $link, TRUE, FALSE)."</td>\n".
42 " <th>Continent</th>\n". 53 " <td>".chentities($continentList[$cont][CTI_NAME])."</td>\n".
43 " </tr>\n"; 54 " </tr>\n";
44
45 foreach ($sortTable as $name => $data)
46 {
47 $cont = $data["continent"];
48 $link = $continentList[$cont][CTI_HAS_MAP];
49 echo
50 " <tr>\n".
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".
54 " </tr>\n";
55 }
56 echo
57 "</table>\n".
58 "<p><b>".count($sortTable)."</b> societies.</p>\n";
59 } 55 }
60 else 56 echo
61 { 57 "</table>\n".
62 echo "<p><b>No societies known!</b></p>\n"; 58 "<p><b>".count($sortTable)."</b> societies.</p>\n";
63 }
64 59
65 mpPrintPageFooter(); 60 mpPrintPageFooter();
66 ?> 61 ?>