Mercurial > hg > batmud > maputils
diff www/loc.php @ 621:537fae9ebf1d
Synced.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 26 Jun 2008 20:43:23 +0000 |
parents | ff42dbb61d1c |
children | 6d2c28904660 |
line wrap: on
line diff
--- a/www/loc.php Thu Jun 26 19:23:39 2008 +0000 +++ b/www/loc.php Thu Jun 26 20:43:23 2008 +0000 @@ -34,6 +34,19 @@ $onlyPCities = isset($_GET["c"]); +if ($onlyPCities) { + $filter = "C"; + $applyFilter = TRUE; +} else { + if (isset($_GET["f"])) { + $filter = $_GET["f"]; + $applyFilter = TRUE; + } else { + $filter = "C"; + $applyFilter = FALSE; + } +} + $showCoders = !isset($_GET["s"]); if (isset($_GET["a"])) { @@ -46,24 +59,30 @@ $locTable = array(); $setName = strtolower(basename($_GET["n"])); if (file_exists($setName.".loc")) { - parseLocFile($setName, $locTable, $onlyPCities); + parseLocFile($setName, $locTable, $applyFilter, $filter); } else { echo "<h1>No such continent ID!</h1>"; unset($setName); } } else { - $locTable = readLocationFiles($onlyPCities); + $locTable = readLocationFiles($applyFilter, $filter); } /* Start of the page */ echo "<h1>"; -if ($onlyPCities) - echo "Player cities"; -else +if ($applyFilter) { + if (array_key_exists($filter, $locationTypes)) { + echo $locationTypes[$filter][2]; + } else { + echo "lol?"; + } +} else echo "Locations"; + echo " of "; + if (isset($continentList[$setName])) echo $continentList[$setName]." continent in "; else