Mercurial > hg > batmud > maputils
view www/index.php @ 2834:f08e17b1e003 default tip
New pcity 'Zhuque' in Lucentium.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 11 Jun 2024 12:56:47 +0300 |
parents | 995471355353 |
children |
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 mpGetURLLink($url, $name, $extra = FALSE) { return "<a ".($extra !== FALSE ? $extra." " : ""). "href=\"".$url."\">".chentities($name)."</a>"; } function mpPrintLineBase($n, $filename, $mapName, $urlExtra) { global $lastMTime; mpPrintTR($n); mpCheckMTime($filename.".loc"); echo " <td>"; $fname = $filename.".html"; if (file_exists($fname)) { mpCheckMTime($fname); echo mpGetURLLink($fname.$urlExtra, $mapName); } else echo $mapName; if (file_exists($filename.".htm")) echo " ".mpGetURLLink($filename.".htm".$urlExtra, "(*)"); echo "</td>\n"; } function mpPrintLine($n, $filename, $mapName) { mpPrintLineBase($n, $filename, $mapName, ""); $mtime1 = mpPrintFileTD($filename.".map", "ASCII"); $mtime2 = mpCheckMTime($filename.".loc"); if ($mtime1 > 0 || $mtime2 > 0) echo " <td>".mpGetMTimeStr($mtime1 > $mtime2 ? $mtime1 : $mtime2)."</td>\n"; echo " </tr>\n"; } mpPrintPageHeader($pageTitle); if (1) { echo "<h1>".$pageTitle."</h1>\n". "<div class=\"skrolli\">". "<a href=\"https://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=\"https://www.bat.org/\">BatMUD realm</a>,\n". "including maps of the continents, some areas and cities. ". (isset($pageGMapURL) ? "As an alternative 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 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[CTI_SPECIAL]) { mpPrintLineBase($n++, $continent, $data[CTI_NAME], is_array($data[CTI_INIT_LOC]) ? "#loc".$data[CTI_INIT_LOC][0]."_".$data[CTI_INIT_LOC][1] : ""); mpPrintFileTD($continent.".png", "PNG"); mpPrintFileTD($continent.".ansi", "ANSI"); echo " <td>"; if (file_exists($continent.".loc")) { echo "[<a href=\"loc.php?n=".$continent."\">Locations</a>] ". "[<a href=\"loc.php?c&n=".$continent."\">PCities</a>]"; } else { echo "-"; } echo "</td>\n". " </tr>\n"; } } echo "</table>\n". "<p>(*) = Maps without JavaScript and with 'embedded' labels. Continent data last updated: <b>". mpGetMTimeStr($lastMTime)."</b>. [<a href=\"changelog.txt\">View PupuMaps project changelog</a>]</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++, "dortlewall", "Village of Dortlewall"); mpPrintLine($n++, "arelium", "City of Arelium"); mpPrintLine($n++, "calythien", "City of Calythien"); mpPrintLine($n++, "lorenchia", "City of Lorenchia"); mpPrintLine($n++, "rilynttar", "City of Rilynt'tar"); mpPrintLine($n++, "shadowkeep", "City of Shadowkeep"); mpPrintLine($n++, "esiris", "E'siris, the Ethereal City (upper level)"); mpPrintLine($n++, "esiris2", "E'siris, the Ethereal City (lower level)"); mpPrintLine($n++, "votk", "Valley of the Kings"); mpPrintLine($n++, "lanzia", "The Isle of Lanzia"); mpPrintLine($n++, "faerieforest", "Faerie Forest"); mpPrintLine($n++, "renardy", "Renardy"); mpPrintLine($n++, "tyr_farwyn", "Tyr Farwyn"); mpPrintLine($n++, "vendace_shore", "Vendace Shore"); mpPrintLine($n++, "lost_vale", "Lost Vale"); //mpPrintLine($n++, "tormentas", "Islas de Tormentas"); mpPrintLine($n++, "batcity", "Old BatCity map"); 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"; // end of <div id="contents"> echo "<div id=\"extraBox\">\n". // " <h1>Ggr's links</h1>\n". // " <a href=\"/kuvia/events/batmud/\">BatMUD con pictures</a>\n". " <a href=\"/~ccr/ggrtf/\">GgrTF</a>\n". " <a href=\"/mat/\">Material info</a>\n". " <a href=\"/~ccr/bat/\">Ggr's Bat page</a>\n". "</div>\n"; mpPrintPageFooter(FALSE); ?>