Mercurial > hg > batmud > maputils
view www/index.php @ 2215:7e2c34c0fc0c
Adjust names.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 14 Oct 2019 15:36:16 +0300 |
parents | 3888fee8284b |
children | 2f2b8170785c |
line wrap: on
line source
<?php require "config.inc.php"; require "world.inc.php"; require "common.inc.php"; function mpPrintFileTD($filename, $mapName, $useTD = TRUE, $filename2 = FALSE) { if ($useTD) echo " <td>"; if (file_exists($filename)) { $fileStat = stat($filename); $q = $fileStat[7]; echo mpGetURLLink($filename, $mapName).", <b>"; if ($q < 1024) printf("%d</b> bytes", $q); else if ($q < (1024*1024)) printf("%d</b>kB", $q / 1024); else printf("%1.2f</b>MB", $q / (1024.0*1024.0)); $mtime = filemtime($filename); } else $mtime = -1; if ($useTD) echo "</td>\n"; return $mtime; } function mpPrintTR($n) { echo " <tr class=\"line".(($n & 1) + 1)."\">\n"; } function mpCheckMTime($filename) { global $lastMTime; $mtime = -1; if (file_exists($filename) && ($mtime = filemtime($filename)) > $lastMTime) $lastMTime = $mtime; return $mtime; } function mpPrintLine($n, $filename, $mapName, $noExtra = FALSE) { global $lastMTime; mpPrintTR($n); mpCheckMTime($filename.".loc"); echo " <td>"; $fname = $filename.".html"; if (file_exists($fname)) { mpCheckMTime($fname); echo mpGetURLLink($fname, $mapName); } else echo " <td>".$mapName."</td>\n"; if (file_exists($filename.".htm")) echo " ".mpGetURLLink($filename.".htm", "(*)"); echo "</td>\n"; if ($noExtra) { $mtime1 = mpPrintFileTD($filename.".map", "ASCII"); $mtime2 = mpCheckMTime($filename.".loc"); if ($mtime1 > 0 || $mtime2 > 0) echo " <td>".mpGetMTimeStr($mtime1 > $mtime2 ? $mtime1 : $mtime2)."</td>\n"; } else { mpPrintFileTD($filename.".png", "PNG"); mpPrintFileTD($filename.".ansi", "ANSI"); if (file_exists($filename.".loc")) { echo " <td>"; echo "[<a href=\"loc.php?n=".$filename."\">Locations</a>] "; echo "[<a href=\"loc.php?c&n=".$filename."\">PCities</a>] "; echo "</td>\n"; } else echo " <td>-</td>\n"; } echo " </tr>\n"; } mpPrintPageHeader($pageTitle); if (1) { echo "<h1>".$pageTitle."</h1>\n". "<div class=\"skrolli\">". "<a href=\"http://tnsp.org/u/IqM\"><img src=\"img/skrolli.png\" alt=\"Skrolli magazine\" /></a>". "</div>\n". mpSpecialDate("index", 1); } else { $zuri = "https://juliareda.eu/2019/02/eu-copyright-final-text/"; echo "<div class=\"filters\">". "<h1>Internet Wars</h1>". "<div style=\"margin: 2em; font-size: 1.5em;\">". "Episode V: Article 13 Strikes Back". "</div>". "<p><a href=\"".$zuri."\">Click here to read more</a></p>". "<a href=\"".$zuri."\"><img src=\"img/keyhole.jpg\" /></a>". "</div>\n"; } echo "<div id=\"intro\">\n". "Maps and information about <a href=\"http://www.bat.org/\">BatMUD realm</a>,\n". "including maps of the continents, some areas and cities. As an alternative\n". "for the continent maps, ".burl("Jeskko")." has an interesting\n". "<a href=\"".$pageGMapURL."\">Google Maps-style world map</a>.\n". "<p>\n". "The ANSI files are maps rendered as ASCII text with ANSI colour codes, UNIX users\n". "can apply the familiar less(1) utility to view them, assuming their less supports\n". "raw output - GNU less works: <b>less -S -R laenor.ansi</b>.\n". "</p>\n". "</div>\n"; echo "\n". "<h2>Continents of BatMUD: Age of Exiles</h2>\n". "<table class=\"area\">\n". " <tr>\n". " <th>Continent (HTML)</th>\n". " <th>Image files</th>\n". " <th>Raw ANSI</th>\n". " <th>Information</th>\n". " </tr>\n"; $n = 0; $lastMTime = 0; foreach ($continentList as $continent => $data) { if (!$data[3]) mpPrintLine($n++, $continent, $data[0]); } echo "</table>\n". "<p>(*) = Maps without JavaScript and with 'embedded' labels. Data last updated: <b>". mpGetMTimeStr($lastMTime)."</b>.</p>\n". "\n". mpSpecialDate("index", 2). "<h2>Miscellaneous maps</h2>\n". "<table class=\"area\">\n". " <tr>\n". " <th>Area (HTML)</th>\n". " <th>Other</th>\n". " <th>Updated</th>\n". " </tr>\n"; $n = 0; mpPrintLine($n++, "arelium", "City of Arelium", TRUE); mpPrintLine($n++, "calythien", "City of Calythien", TRUE); mpPrintLine($n++, "lorenchia", "City of Lorenchia", TRUE); mpPrintLine($n++, "rilynttar", "City of Rilynt'tar", TRUE); mpPrintLine($n++, "esiris", "E'siris, the Ethereal City (upper level)", TRUE); mpPrintLine($n++, "esiris2", "E'siris, the Ethereal City (lower level)", TRUE); mpPrintLine($n++, "votk", "Valley of the Kings", TRUE); mpPrintLine($n++, "lanzia", "The Isle of Lanzia", TRUE); mpPrintLine($n++, "faerieforest", "Faerie Forest", TRUE); mpPrintLine($n++, "renardy", "Renardy", TRUE); mpPrintLine($n++, "tyr_farwyn", "Tyr Farwyn", TRUE); mpPrintLine($n++, "dortlewall", "Village of Dortlewall", TRUE); //mpPrintLine($n++, "tormentas", "Islas de Tormentas", TRUE); mpPrintLine($n++, "batcity", "Old BatCity map", TRUE); mpPrintTR($n++); $filename = "hcbat"; echo " <td>". mpGetURLLink($filename.".html", "HCBat map"). " ". mpGetURLLink($filename.".htm", "(*)"). " [".mpGetURLLink($filename.".ansi", "ANSI")."]". "</td>\n". " <td>[<a href=\"loc.php?n=".$filename."\">Locations</a>] ". "[<a href=\"loc.php?n=".$filename."&c\">PCities</a>] ". "[<a href=\"quests.php?".$filename."\">Quests</a>] ". "</td>\n"; if (($mtime = mpCheckMTime($filename.".loc")) > 0) echo " <td>".mpGetMTimeStr($mtime)."</td>\n"; echo " </tr>\n". "</table>\n". "<div>\n". "<b>-- <a href=\"".mpFingerURL("ggr")."\">Ggr Pupunen</a>, master of carrots.</b>\n". "</div>\n". "</div>\n"; // end of <div id="contents"> echo "<div id=\"extraBox\">\n". " <h1>Ggr's links</h1>\n". " <a href=\"/kuvia/events/batmud/\">BatMUD con pictures (etc)</a>\n". " <a href=\"/~ccr/ggrtf/\">GgrTF</a>\n". " <a href=\"/~ccr/bat/\">Ggr's Bat page</a>\n". "</div>\n"; mpPrintPageFooter(FALSE); ?>