view www/ss.php @ 2620:164aa519640d

Use 'author' instead of 'creator' or 'coder'.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 16 Feb 2024 23:50:59 +0200
parents 0556b65f137b
children 7f90630781a7
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");

echo
  "<h1>Secret societies of BatMUD</h1>\n";

// Print list of societies
if (count($locTable) > 0)
{
  // 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";
}
else
{
  echo "<p><b>No societies known!</b></p>\n";
}

mpPrintPageFooter();
?>