view www/ss.php @ 2819:7f90630781a7

Cleanup.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 14 Apr 2024 20:19:46 +0300
parents 164aa519640d
children
line wrap: on
line source

<?php
require "config.inc.php";
require "world.inc.php";
require "common.inc.php";

$locTable = apcu_fetch("ss_locTable");
$locPTable = apcu_fetch("ss_locPTable");
if (empty($locTable) || empty($locPTable))
{
  $locTable = mpParseLocFiles(TRUE, FALSE, LOCF_M_PCITY);
  mpParseLocFile("limbo", $locTable, TRUE, FALSE, LOCF_M_PCITY);
  $locPTable = mpParseLocFiles(TRUE, FALSE, LOCF_T_SS);

  apcu_store("ss_locTable", $locTable, 3600);
  apcu_store("ss_locPTable", $locPTable, 3600);
}

// Page start
mpPrintPageHeader($pageTitle." - Secret societies");
?>
<h1>Secret societies of BatMUD</h1>
<div class="attnbox">
</div>
<hr />
<?php
// Print list of societies
// Make the list array
foreach ($locTable as $key => $value)
foreach ($value["authors"] as $name)
  $sortTable[$name["name"]] = $value;

foreach ($locPTable as $key => $value)
  $sortTable[$value["name"]] = $value;

ksort($sortTable);

echo
  "<table class=\"locTable societies\">\n".
  " <tr>\n".
  "  <th>Society name</th>\n".
  "  <th>Player city/location</th>\n".
  "  <th>Continent</th>\n".
  " </tr>\n";

foreach ($sortTable as $name => $data)
{
  $cont = $data["continent"];
  $link = $continentList[$cont][CTI_HAS_MAP];
  echo
    " <tr>\n".
    "  <td>".mpGetMapURLLink($data, $link, $name, TRUE)."</td>\n".
    "  <td class=\"".$cont."\">".mpGetMapLink($data, $link, TRUE, FALSE)."</td>\n".
    "  <td>".chentities($continentList[$cont][CTI_NAME])."</td>\n".
    " </tr>\n";
}
echo
  "</table>\n".
  "<p><b>".count($sortTable)."</b> societies.</p>\n";

mpPrintPageFooter();
?>