view www/simple.php @ 2833:d0e186348cb2 default tip

Add mention of soft level limitation to 'Eightleg woods'.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 26 May 2024 20:33:53 +0300
parents 63d100185adf
children
line wrap: on
line source

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

$locTable = apcu_fetch("loc_locTable");
if (empty($locTable))
{
  $locTable = mpParseLocFiles(TRUE);
  apcu_store("loc_locTable", $locTable, 3600);
}


// Make alphabetically sorted table of locations
$alphaTable = [];
foreach ($locTable as $id => $data)
if (isset($data["name"]))
{
  $idx = $data["name"][0];
  $alphaTable[$idx][] = $data;
}

ksort($alphaTable, SORT_STRING);


//
// Start of the page
//
$pageCSS = "simple.css";
mpPrintPageHeader($pageTitle." - Simple locations list",
  "  <meta name=\"robots\" content=\"nofollow\" />\n",
  "", FALSE);

//
// Print list of locations
//
if (count($alphaTable) > 0)
{
  $locationTips = [];
  $totalLoc = 0;
  $maxRow = 6;
  foreach ($alphaTable as $alpha => $alphaLocs)
  {
    if (count($alphaLocs) <= 0) continue;
    $letter = strtoupper($alpha);

    asort($alphaLocs);

    echo
      "<h3 class=\"alpha\"><a id=\"ch".$letter."\"></a>".$letter."</h3>\n".
      "<table class=\"loc\">\n";

    $n = 0;
    foreach ($alphaLocs as $ik => $iv)
    {
      $totalLoc++;

      // Print location entry
      echo
        " <tr>\n".
        "  <td class=\"type\">".mpGetLocationTypeStr($iv["flags"])."</td>\n".
        "  <td class=\"name\">".mpGetMapLink($iv, $continentList[$iv["continent"]][CTI_HAS_MAP], FALSE, FALSE)."</td>\n";

      // Alternative names
      $alt = "";
      if (($nnames = count($iv["names"])) > 1)
      {
        $fs = [];
        for ($nname = 1; $nname < $nnames; $nname++)
        {
          $norig = $iv["names"][$nname]["flags"] & NAME_ORIG;
          $fs[] =
            ($norig ? "<b>" : "").
            chentities($iv["names"][$nname]["name"]).
            ($norig ? "</b>" : "");
        }
        $alt = implode(" | ", $fs);
      }
      echo
        "  <td class=\"altnames\">".$alt."</td>\n".
        "  <td class=\"continent ".$iv["continent"]."\">".$iv["continent"]."</td>\n".
        "  <td class=\"coords\">".$iv["x"].", ".$iv["y"]."</td>\n".
        "  <td class=\"coords\">".$iv["globalx"].", ".$iv["globaly"]."</td>\n";

      // If either freeform desc or URL field are set, we add those
      $desc = "";
      if (isset($iv["freeform"]))
      {
        // Free form description
        $desc = isset($iv["freeform"]) ? chentities($iv["freeform"]) : "";
      }
      echo "  <td class=\"desc\">".$desc."</td>\n";

/*
      // Author / society names
      $authors = "";
      if (count($iv["authors"]) > 0)
      {
        $fs = [];
        foreach ($iv["authors"] as $name)
        {
          // Tags/flags of this author in relation to the area
          switch ($name["flags"])
          {
            case AUTHOR_ORIG:       $qs = "title=\"Original creator\" class=\"wizorig\""; break;
            case AUTHOR_RECODER:    $qs = "title=\"Converter, recoder\" class=\"wizrecoder\""; break;
            case AUTHOR_MAINTAINER: $qs = "title=\"Maintainer\" class=\"wizmaintainer\""; break;
            case AUTHOR_EXPANDER:   $qs = "title=\"Implemented new content, expansion(s)\" class=\"wizexpander\""; break;
            default: $qs = "";
          }
          $fs[] = $name["name"];
        }
        $authors = implode(", ", $fs);
      }

      echo
        "  <td class=\"authors\">".$authors."</td>\n";
*/

      echo
        " </tr>\n";
    }

    echo "</table>\n";
  }

  echo
    "<p><b>".$totalLoc."</b> locations.</p>\n";
}
else
{
  echo
    "<p><b>No locations known!</b></p>\n";
}

mpPrintPageFooter(TRUE);
?>