Mercurial > hg > batmud > maputils
changeset 2015:135b2b595e2c
Trailing whitespace cleanup.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 22 Jun 2018 19:28:30 +0300 |
parents | e55d83a233fe |
children | 3b78cf4f82a9 |
files | www/common.inc.php www/index.php www/info.php www/latest.php www/level.php www/loc.php www/quests.php www/simple.php www/ss.php www/world.inc.php |
diffstat | 10 files changed, 52 insertions(+), 52 deletions(-) [+] |
line wrap: on
line diff
--- a/www/common.inc.php Fri Jun 22 19:26:26 2018 +0300 +++ b/www/common.inc.php Fri Jun 22 19:28:30 2018 +0300 @@ -220,7 +220,7 @@ $file = @fopen(basename($filename.".loc"), "r"); if (!$file) return FALSE; - + while (!feof($file)) { $inLine = mpChConv(trim(fgets($file))); @@ -233,13 +233,13 @@ { // Split fields of the record $addInfo = preg_split("/\s*;\s*/", $record[5]); - + // Split coder names if (strlen($addInfo[0]) > 0) mpAddLocNames($coders, preg_split("/\s*,\s*/", $addInfo[0])); else $coders = []; - + // Get timestamp if (strlen($addInfo[1]) > 0) { @@ -250,7 +250,7 @@ } else { - mpError("Location <b>".$record[4]."</b> has invalid timestamp '".$addInfo[1]."'"); + mpError("Location <b>".$record[4]."</b> has invalid timestamp '".$addInfo[1]."'"); $added = -1; } } @@ -259,7 +259,7 @@ $furl = $addInfo[2]; $ffreeform = $addInfo[3]; - + // Check flags, completely ignore records with "-" flag $rawflags = $record[3]; if (strstr($rawflags, "-") === FALSE) @@ -280,7 +280,7 @@ mpError("Location '<b>".$id."</b>' already defined (".$locations[$id]["continent"]." <=> ".$filename.")"); return FALSE; } - + // Create primary location name for ($s = "", $found = FALSE, $i = 0; $found === FALSE && $i < strlen($rawflags); $i++) { @@ -293,15 +293,15 @@ } } $s .= $names[0]["name"]; - + if (strstr($rawflags, "!") !== FALSE) { $s .= " (CLOSED)"; $ffreeform .= "This location is closed."; } - + mpGetGlobalCoords($filename, $record[1], $record[2], $glx, $gly); - + // Add location to array of locations $locations[$id] = [ "name" => $s, @@ -326,7 +326,7 @@ //return FALSE; } } - + fclose($file); return TRUE; } @@ -382,7 +382,7 @@ { if (($file = @fopen($filename, "r")) === false) return FALSE; - + $contMode = FALSE; while (!feof($file)) { @@ -390,7 +390,7 @@ if (strlen($line) == 0 || $line[0] == "#") continue; - + if ($contMode) { if (substr($line, -1, 1) == '$')
--- a/www/index.php Fri Jun 22 19:26:26 2018 +0300 +++ b/www/index.php Fri Jun 22 19:28:30 2018 +0300 @@ -11,7 +11,7 @@ { $fileStat = stat($filename); $q = $fileStat[7]; - + echo mpGetURLLink($filename, $mapName).", <b>"; if ($q < 1024) @@ -21,7 +21,7 @@ printf("%d</b>kB", $q / 1024); else printf("%1.2f</b>MB", $q / (1024.0*1024.0)); - + $mtime = filemtime($filename); } else @@ -46,7 +46,7 @@ $mtime = -1; if (file_exists($filename) && ($mtime = filemtime($filename)) > $lastMTime) $lastMTime = $mtime; - + return $mtime; } @@ -83,7 +83,7 @@ { mpPrintFileTD($filename.".png", "PNG"); mpPrintFileTD($filename.".ansi", "ANSI"); - + if (file_exists($filename.".loc")) { echo " <td>"; @@ -94,7 +94,7 @@ else echo " <td>-</td>\n"; } - + echo " </tr>\n"; } @@ -106,7 +106,7 @@ "<a href=\"http://tnsp.org/u/IqM\"><img src=\"img/skrolli.png\" alt=\"Skrolli magazine\" /></a>". "</div>\n". mpSpecialDate("index", 1); - + echo "<div id=\"intro\">\n". "Maps and information about <a href=\"http://www.bat.org/\">BatMUD realm</a>,\n".
--- a/www/info.php Fri Jun 22 19:26:26 2018 +0300 +++ b/www/info.php Fri Jun 22 19:28:30 2018 +0300 @@ -84,12 +84,12 @@ if (count($data) > 0) { usort($data, "wizardSort"); - + $letter = strtoupper($alpha); echo "<h3><a id=\"ch".$letter."\"></a>".$letter."</h3>\n"; echo "<div class=\"locTable\">\n"; $n = 0; - + foreach ($data as $wizard) { $totalWiz++;
--- a/www/latest.php Fri Jun 22 19:26:26 2018 +0300 +++ b/www/latest.php Fri Jun 22 19:28:30 2018 +0300 @@ -52,7 +52,7 @@ $sortedLocs[] = $location; } } - + usort($sortedLocs, "locCompare"); // Print the list @@ -66,7 +66,7 @@ " <th>Coder(s)</th>\n". " <th>Information</th>\n". " </tr>\n"; - + foreach ($sortedLocs as $ik => $iv) { $totalLoc++; @@ -76,7 +76,7 @@ { $fs[] = "<a href=\"loc.php?a=".chentities($name["name"])."\">".chentities($name["name"])."</a>"; } - + echo " <tr>\n". " <td>".(($iv["added"] <= 0) ? "?" : mpStrFTime($iv["added"]))."</td>\n".
--- a/www/level.php Fri Jun 22 19:26:26 2018 +0300 +++ b/www/level.php Fri Jun 22 19:28:30 2018 +0300 @@ -35,7 +35,7 @@ } } } - + ksort($areaTable, SORT_STRING); //======================================================================== @@ -54,7 +54,7 @@ " <th>Continent</th>\n". " <th>Info</th>\n". " </tr>\n"; - + foreach ($areaTable as $name => $data) { $loc = &$data["data"];
--- a/www/loc.php Fri Jun 22 19:26:26 2018 +0300 +++ b/www/loc.php Fri Jun 22 19:28:30 2018 +0300 @@ -32,7 +32,7 @@ if ($s !== "") $s .= "&"; $s .= "n=".$qname; } - + echo " <a class=\"control continent ".$qclass. "\" href=\"?".$s."\">".$desc."</a>\n"; @@ -259,7 +259,7 @@ { if ($s == "bat") $s = "http://wiz.bat.org/~".strtolower($coderName)."/"; - + echo " [<a href=\"".$s."\">Homepage</a>]<br />\n"; } @@ -280,10 +280,10 @@ echo "<div style=\"color: red;\">\n". " <ul>\n"; - + foreach ($errorMsgs as $msg) echo " <li>".$msg."</li>\n"; - + echo " </ul>\n". "</div>\n"; @@ -305,12 +305,12 @@ $letter = strtoupper($alpha); asort($alphaLocs); - + echo "<h3 class=\"alpha\"><a id=\"ch".$letter."\"></a>".$letter."</h3>\n". mpSpecialDate("loc", 2). "<div class=\"locTable\">\n"; - + $n = 0; foreach ($alphaLocs as $ik => $iv) { @@ -321,7 +321,7 @@ " <div class=\"locCell ".$iv["continent"]."\">". "<div class=\"locHeader\">". "<span class=\"locTitle\">".mpGetMapLink($iv, $continentList[$iv["continent"]][4])."</span>"; - + // If either freeform desc or URL field are set, we add those if (isset($iv["url"]) || isset($iv["freeform"])) { @@ -342,20 +342,20 @@ { $urlBegin = $urlEnd = ""; } - + echo " ".$urlBegin. "<span onmouseover=\"stt(".$totalLoc. ");\" onmouseout=\"htt();\">🍔</span>". $urlEnd; - + $locationTips[$totalLoc] = [ "title" => $iv["name"], "desc" => $desc ]; } - echo "</div>"; // locHeader + echo "</div>"; // locHeader // Alternative names if (($nnames = count($iv["names"])) > 1) @@ -372,7 +372,7 @@ } echo "<div class=\"locAltNames\">".implode(" | ", $fs)."</div>"; } - + // Coder / society names if (count($iv["coders"]) > 0 && $showCoders) { @@ -401,7 +401,7 @@ echo "<div class=\"locCoders\">".implode(", ", $fs)."</div>"; } } - + if (/* isset($coderName) && */ $iv["added"] > 0) { echo "<div class=\"locAdded\">".mpStrFTime($iv["added"])."</div>"; @@ -411,7 +411,7 @@ } echo "</div>\n"; } - + echo "<p><b>".$totalLoc."</b> locations.</p>\n". "</div>\n"; // end of contents div
--- a/www/quests.php Fri Jun 22 19:26:26 2018 +0300 +++ b/www/quests.php Fri Jun 22 19:28:30 2018 +0300 @@ -32,7 +32,7 @@ // Create quest data tables $lqTable = array(); $aqTable = array(); - + foreach ($locTable as $loc) if (isset($loc["freeform"])) { @@ -47,7 +47,7 @@ $aqTable[$val[1]] = $loc; } } - + ksort($lqTable, SORT_NUMERIC); ksort($aqTable, SORT_STRING); @@ -80,7 +80,7 @@ " <th>Location</th>\n". ($hcbat ? "" : " <th>Continent</th>\n"). " </tr>\n"; - + foreach ($lqTable as $level => $quests) { foreach ($quests as $name => $area) @@ -117,7 +117,7 @@ " <th>Location</th>\n". ($hcbat ? "" : " <th>Continent</th>\n"). " </tr>\n"; - + foreach ($aqTable as $name => $area) { $totalAQ++;
--- a/www/simple.php Fri Jun 22 19:26:26 2018 +0300 +++ b/www/simple.php Fri Jun 22 19:28:30 2018 +0300 @@ -45,11 +45,11 @@ $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) { @@ -78,7 +78,7 @@ $alt = implode(" | ", $fs); } echo " <td class=\"altnames\">".$alt."</td>\n"; - + // If either freeform desc or URL field are set, we add those $desc = ""; if (isset($iv["freeform"])) @@ -108,7 +108,7 @@ } $coders = implode(", ", $fs); } - + echo " <td class=\"coders\">".$coders."</td>\n". " </tr>\n"; @@ -116,7 +116,7 @@ echo "</table>\n"; } - + echo "<p><b>".$totalLoc."</b> locations.</p>\n"; }
--- a/www/ss.php Fri Jun 22 19:26:26 2018 +0300 +++ b/www/ss.php Fri Jun 22 19:28:30 2018 +0300 @@ -31,9 +31,9 @@ foreach ($locPTable as $key => $value) $sortTable[$value["name"]] = $value; - + ksort($sortTable); - + echo "<table class=\"locTable societies\">\n". " <tr>\n". @@ -41,7 +41,7 @@ " <th>Player city</th>\n". " <th>Continent</th>\n". " </tr>\n"; - + foreach ($sortTable as $name => $data) { $cont = $data["continent"];
--- a/www/world.inc.php Fri Jun 22 19:26:26 2018 +0300 +++ b/www/world.inc.php Fri Jun 22 19:28:30 2018 +0300 @@ -80,7 +80,7 @@ "desocrater1" => ["desolathya" , 421 , 207], "desocrater2" => ["desolathya" , 278 , 207], - + "laenor-desolathya" => ["desolathya" , 532 + 84 , 96], "desolathya-lucentium1" => ["desolathya" , 532 + 45 , 475], @@ -106,7 +106,7 @@ ["daerwon", "laenor1", "laenor2", "laenor3", "laenor4", "laenor5", "laenor6", "laenor7", "laenor8", "laenor9"], ["daerwon", "arelium1", "arelium2", "arelium3"], ["laenor9", "daerwon"], - + // Furnachia ["furnachia1", "furnachia2"],