Mercurial > hg > batmud > maputils
diff www/loc.php @ 1140:3bb8253db932
New website layout and some minor improvements.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 08 Jul 2011 02:17:22 +0300 |
parents | 3dc58d67b7b4 |
children | 52550f58cee5 |
line wrap: on
line diff
--- a/www/loc.php Fri Jul 08 02:17:00 2011 +0300 +++ b/www/loc.php Fri Jul 08 02:17:22 2011 +0300 @@ -40,12 +40,6 @@ /* Initialization */ -printPageHeader($pageTitle." - Locations", - "<script type=\"text/javascript\" src=\"tooltip.js\"></script>\n". - "<meta name=\"robots\" content=\"nofollow\" />\n"); -//echo "<div><b>DEVELOPMENT VERSION</b></div>"; - - if (isset($_GET["c"])) { $filter = "C"; $applyFilter = TRUE; @@ -53,7 +47,7 @@ if (isset($_GET["f"]) && $_GET["f"] != "") { $filter = $_GET["f"]; if (!preg_match("/^[\^A-Za-z]+\$/", $filter)) { - echo "<h1>Invalid filter rule '".chentities($filter)."'</h1>\n"; + $errorStr = "Invalid filter rule '".chentities($filter)."'"; $filter = "C"; $applyFilter = FALSE; } else { @@ -82,7 +76,7 @@ if (file_exists($setName.".loc")) { parseLocFile($setName, $locTable, $applyFilter, $filter); } else { - echo "<h1>No such continent ID!</h1>\n"; + $errorStr = "No such continent ID!"; unset($setName); } } else { @@ -92,7 +86,16 @@ /* Start of the page */ -echo "<h1>"; +printPageHeader($pageTitle." - Locations", + "<script type=\"text/javascript\" src=\"tooltip.js\"></script>\n". + "<meta name=\"robots\" content=\"nofollow\" />\n"); + +require "menu.inc.php"; + +echo +"<div id=\"contents\">\n". +"<h1>"; + if ($applyFilter) { if (array_key_exists($filter, $locationTypes)) echo $locationTypes[$filter][2]; @@ -112,6 +115,9 @@ echo " by ".chentities($coderName); echo "</h1>\n"; +if (isset($errorStr)) + echo "<p style=\"color: red;\"><b>Error: ".$errorStr."</b>.</p>\n"; + ?> <div class="selbar"> <form action="<? echo $_SERVER["PHP_SELF"]; ?>" method="get"> @@ -122,7 +128,7 @@ <table> <tr> <td> - <select name="f"> + <select class="dropdown" name="f"> <? foreach ($locationTypes as $id => $type) { echo " <option value=\"".$id."\""; @@ -134,7 +140,7 @@ </select> </td> <td> - <input type="submit" value=" Update " class="isubmit" /> + <input type="submit" value=" Update " class="submit" /> </td> <td></td> <? @@ -145,7 +151,6 @@ } printTitleLink($applyFilter, $filter, $showCoders, "Special", "special", "special"); ?> - <td><a href="<? echo $pageIndex ?>">Main page</a></td> </tr> </table> </form> @@ -230,7 +235,7 @@ asort($alphaLocs); - echo "<h3><a name=\"".strtolower($alpha)."\"></a>".$alpha."</h3>\n". + echo "<h3><a name=\"".$alpha."\"></a>".$alpha."</h3>\n". "<table class=\"loc\" width=\"95%\">\n"; $n = 0; @@ -298,11 +303,12 @@ $fs = ""; foreach ($iv["coders"] as $name) { if ($fs != "") $fs .= ", "; + // Tags/flags of this coder in relation to the area switch ($name["flags"]) { - case NAME_ORIG: $qs = "title=\"Original creator\""; break; - case NAME_RECODER: $qs = "title=\"Converter, recoder\""; break; - case NAME_MAINTAINER: $qs = "title=\"Maintainer\""; break; - case NAME_EXPANDER: $qs = "title=\"Implemented new content, expansion(s)\""; break; + case NAME_ORIG: $qs = "title=\"Original creator\" class=\"wizorig\""; break; + case NAME_RECODER: $qs = "title=\"Converter, recoder\" class=\"wizrecoder\""; break; + case NAME_MAINTAINER: $qs = "title=\"Maintainer\" class=\"wizmaintainer\""; break; + case NAME_EXPANDER: $qs = "title=\"Implemented new content, expansion(s)\" class=\"wizexpander\""; break; default: $qs = ""; } if ($filter != "C" || !$applyFilter) @@ -332,6 +338,8 @@ echo "<p><b>".$totalLoc."</b> locations.</p>\n"; + echo "</div>\n"; + /* Print out location tooltip HTML code */ foreach ($locationTips as $tipID => $tip) { @@ -339,8 +347,19 @@ "\"><div class=\"holder\"><b>".chentities($tip["title"]). "</b><br />".$tip["desc"]."</div></div>\n"; } + + /* Print out the alpha link index + */ + echo "<div id=\"extrabox\">\n". + " <div style=\"font-size: 12pt; padding: 5pt;\">\n"; + foreach ($alphaTable as $alpha => $alphaLocs) { + echo " <a href=\"#".$alpha."\">".$alpha."</a> \n"; + } + echo "\n </div>\n". + "</div>\n"; } else { echo "<p><b>No locations known!</b></p>\n"; + echo "</div>\n"; } ?> </body>