annotate www/loc.php @ 975:af0fc3a965dc

Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 13 Jun 2010 23:39:52 +0000
parents dd5b00e9c263
children 047fa29bc07e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 <?
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 require "config.inc.php";
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
3 require "common.inc.php";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
5
801
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
6 function makeURL($afilter, $filter, $coders, $desc, $qname, $qclass)
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 $s = "";
622
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
9 if ($afilter) $s = "f=".$filter;
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 if (!$coders) {
801
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
12 if ($s !== "") $s .= "&amp;";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 $s .= "s";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15
801
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
16 if ($qname !== "") {
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
17 if ($s !== "") $s .= "&amp;";
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
18 $s .= "n=".$qname;
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20
623
a8832a6e5dd9 Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 622
diff changeset
21 echo " <td><a ";
801
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
22 if ($qclass !== "")
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
23 echo "class=\"".$qclass."\" ";
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
24 echo "href=\"".$_SERVER["PHP_SELF"];
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
25 if (strlen($s) > 0) echo "?".$s;
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
26 echo "\">".$desc."</a></td>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
29
441
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
30 /* Initialization
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
31 */
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
32 printPageHeader($pageTitle." - Locations",
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
33 "<script type=\"text/javascript\" src=\"tooltip.js\"></script>");
623
a8832a6e5dd9 Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 622
diff changeset
34 //echo "<div><b>DEVELOPMENT VERSION</b></div>";
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
35
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
36
678
Matti Hamalainen <ccr@tnsp.org>
parents: 623
diff changeset
37 if (isset($_GET["c"])) {
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
38 $filter = "C";
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
39 $applyFilter = TRUE;
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
40 } else {
622
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
41 if (isset($_GET["f"]) && $_GET["f"] != "") {
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
42 $filter = $_GET["f"];
870
51054f3f5d2e Allow inversion of regexp group operator via "^" in the location type filter parameter.
Matti Hamalainen <ccr@tnsp.org>
parents: 822
diff changeset
43 if (!preg_match("/^[\^A-Za-z]+\$/", $filter)) {
926
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
44 echo "<h1>Invalid filter rule '".chentities($filter)."'</h1>\n";
813
Matti Hamalainen <ccr@tnsp.org>
parents: 801
diff changeset
45 $filter = "C";
Matti Hamalainen <ccr@tnsp.org>
parents: 801
diff changeset
46 $applyFilter = FALSE;
Matti Hamalainen <ccr@tnsp.org>
parents: 801
diff changeset
47 } else {
Matti Hamalainen <ccr@tnsp.org>
parents: 801
diff changeset
48 $applyFilter = TRUE;
Matti Hamalainen <ccr@tnsp.org>
parents: 801
diff changeset
49 }
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
50 } else {
801
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
51 $filter = "CF";
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
52 $applyFilter = FALSE;
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
53 }
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
54 }
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
55
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
56 $showCoders = !isset($_GET["s"]);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
57
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
58 if (isset($_GET["a"])) {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
59 $coderName = basename($_GET["a"]);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
60 $coderName = strtoupper(substr($coderName, 0, 1)).strtolower(substr($coderName, 1));
609
ff42dbb61d1c Updated.
Matti Hamalainen <ccr@tnsp.org>
parents: 602
diff changeset
61 $wizTable = readWizInfoFiles();
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
62 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
63
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
64 if (isset($_GET["n"])) {
609
ff42dbb61d1c Updated.
Matti Hamalainen <ccr@tnsp.org>
parents: 602
diff changeset
65 $locTable = array();
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
66 $setName = strtolower(basename($_GET["n"]));
509
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
67 if (file_exists($setName.".loc")) {
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
68 parseLocFile($setName, $locTable, $applyFilter, $filter);
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
69 } else {
813
Matti Hamalainen <ccr@tnsp.org>
parents: 801
diff changeset
70 echo "<h1>No such continent ID!</h1>\n";
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
71 unset($setName);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
72 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
73 } else {
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
74 $locTable = readLocationFiles($applyFilter, $filter);
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
75 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
76
441
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
77
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
78 /* Start of the page
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 */
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 echo "<h1>";
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
81 if ($applyFilter) {
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
82 if (array_key_exists($filter, $locationTypes)) {
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
83 echo $locationTypes[$filter][2];
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
84 } else {
870
51054f3f5d2e Allow inversion of regexp group operator via "^" in the location type filter parameter.
Matti Hamalainen <ccr@tnsp.org>
parents: 822
diff changeset
85 echo "Filter '$filter'";
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
86 }
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
87 } else
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 echo "Locations";
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
89
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 echo " of ";
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
91
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 if (isset($continentList[$setName]))
735
b066148013cd Added OpenSearch support, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 679
diff changeset
93 echo $continentList[$setName][0]." continent in ";
509
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
94 else
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
95 if (isset($specialList[$setName]))
601
95fc7a0a88dc Show special list locations too.
Matti Hamalainen <ccr@tnsp.org>
parents: 545
diff changeset
96 echo $specialList[$setName][0]." in ";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 echo "BatMUD";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 if (isset($coderName))
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 echo " by ".$coderName;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100 echo "</h1>\n";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101
622
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
102 ?>
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
103 <div class="selbar">
801
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
104 <form action="<? echo $_SERVER["PHP_SELF"]; ?>" method="get">
622
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
105 <?
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
106 if (isset($setName))
926
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
107 echo "<input type=\"hidden\" name=\"n\" value=\"".chentities($setName)."\" />\n";
622
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
108 ?>
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
109 <table>
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
110 <tr>
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
111 <td>
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
112 <select name="f">
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
113 <?
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
114 foreach ($locationTypes as $id => $type) {
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
115 echo " <option value=\"".$id."\"";
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
116 if ($applyFilter && $filter == $id)
622
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
117 echo " selected=\"selected\"";
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
118 echo ">".$type[3]."</option>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 }
622
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
120 ?>
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
121 </select>
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
122 </td>
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
123 <td>
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
124 <input type="submit" value=" Update " class="isubmit" />
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
125 </td>
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
126 <td></td>
622
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
127 <?
801
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
128 makeURL($applyFilter, $filter, $showCoders, "All continents", "", "");
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
129 foreach ($continentList as $continent => $data) {
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
130 makeURL($applyFilter, $filter, $showCoders, $data[0], $continent, $continent);
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 ?>
441
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
133 <td><a href="<? echo $pageIndex ?>">Back to main page</a></td>
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
134 </tr>
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
135 </table>
622
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
136 </form>
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
137 </div>
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
138
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139 <?
441
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
140 /* Coder/creator information box
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
141 */
393
Matti Hamalainen <ccr@tnsp.org>
parents: 368
diff changeset
142 if (isset($coderName) && isset($wizTable[$coderName]) && count($wizTable[$coderName]) > 1) {
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
143 echo "<div class=\"wizinfo\">\n <table>\n <tr>\n";
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
144
501
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
145 $s = $wizTable[$coderName]["imageURL"];
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
146 if (isset($s)) {
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
147 if (substr($s, 0, 6) == "bat://")
501
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
148 $s = "img/unknown.png";
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
149 // $s = "http://www.bat.org/albums/".substr($s, 6);
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
150 } else
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
151 $s = "img/unknown.png";
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
152
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
153 echo " <td class=\"img\"><img src=\"".$s."\" alt=\"".$coderName."\" /></td>\n";
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
154
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
155
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
156 echo " <td class=\"info\">\n".
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
157 " <h2>".$coderName."</h2>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
159 $s = $wizTable[$coderName]["desc"];
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
160 if (isset($s)) {
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
161 echo " <p>".$s."</p>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 }
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
163
501
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
164 echo " [<a href=\"".fingerURL($coderName)."\">Finger</a>]\n";
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
165
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
166 $s = $wizTable[$coderName]["homeURL"];
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
167 if (isset($s)) {
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
168 if ($s == "bat")
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
169 $s = "http://wiz.bat.org/~".strtolower($coderName)."/";
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
170
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
171 echo " [<a href=\"".$s."\">Homepage</a>]<br />\n";
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
172 }
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
173
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
174 echo " </td>\n </tr>\n </table>\n</div>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175 }
488
Matti Hamalainen <ccr@tnsp.org>
parents: 441
diff changeset
176
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178 /* Print list of locations
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179 */
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
180 if (count($locTable) > 0) {
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
181 /* Make alphabetically sorted table of locations
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182 */
813
Matti Hamalainen <ccr@tnsp.org>
parents: 801
diff changeset
183 $alphaTable = array();
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
184 foreach ($locTable as $id => $data)
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
185 if (isset($data["name"])) {
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
186 $idx = $data["name"][0];
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
187 if (isset($_GET["nocoders"])) {
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
188 if (count($data["coders"]) == 0 && !preg_match("/[SPG]/", $data["flags"]))
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
189 $alphaTable[$idx][] = $data;
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190 } else {
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
191 if (isset($coderName)) {
975
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
192 foreach ($data["coders"] as $coder) {
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
193 if ($coderName == $coder["name"])
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
194 $alphaTable[$idx][] = $data;
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
195 }
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
196 } else
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
197 $alphaTable[$idx][] = $data;
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
198 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
199 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
200
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
201 ksort($alphaTable, SORT_STRING);
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
202
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
203 /* Print locations per first character
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
204 */
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
205 $locationTips = array();
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
206 $totalLoc = 0;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
207 $maxRow = 6;
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
208 foreach ($alphaTable as $alpha => $alphaLocs) {
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
209 if (count($alphaLocs) <= 0) continue;
817
eaba088b5424 Show alternative location names on location page.
Matti Hamalainen <ccr@tnsp.org>
parents: 816
diff changeset
210
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
211 asort($alphaLocs);
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
212
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
213 echo "<h3><a name=\"".strtolower($alpha)."\"></a>".$alpha."</h3>\n".
817
eaba088b5424 Show alternative location names on location page.
Matti Hamalainen <ccr@tnsp.org>
parents: 816
diff changeset
214 "<table class=\"loc\" width=\"95%\">\n";
eaba088b5424 Show alternative location names on location page.
Matti Hamalainen <ccr@tnsp.org>
parents: 816
diff changeset
215
eaba088b5424 Show alternative location names on location page.
Matti Hamalainen <ccr@tnsp.org>
parents: 816
diff changeset
216 $n = 0;
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
217 foreach ($alphaLocs as $ik => $iv) {
817
eaba088b5424 Show alternative location names on location page.
Matti Hamalainen <ccr@tnsp.org>
parents: 816
diff changeset
218 if ($n == 0)
eaba088b5424 Show alternative location names on location page.
Matti Hamalainen <ccr@tnsp.org>
parents: 816
diff changeset
219 echo " <tr>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
220
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
221 $totalLoc++;
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
223 // Print location entry
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
224 printf(" <td width=\"%d%%\" class=\"%s\">",
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
225 (100 / $maxRow), $iv["continent"]);
311
134dded5369b Changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 300
diff changeset
226
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
227 if (isset($specialList[$iv["continent"]]) && !$specialList[$iv["continent"]][1]) {
926
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
228 echo "<b>".chentities($iv["name"])."</b>";
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
229 } else {
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
230 printURL($iv["continent"].".html#loc".$iv["x"]."_".$iv["y"]);
926
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
231 echo chentities($iv["name"])."</a>";
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
232 }
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
233
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
234 // If either freeform desc or URL field are set, we add those
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
235 if (isset($iv["url"]) || isset($iv["freeform"])) {
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
236 // Free form description
926
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
237 $desc = isset($iv["freeform"]) ? chentities($iv["freeform"]) : "";
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
238
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
239 // Add URL information, chopped, if any
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
240 if (isset($iv["url"])) {
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
241 $urlEnt = $iv["url"];
926
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
242 $urlBegin = "<a href=\"".chentities($urlEnt)."\" target=\"_blank\">";
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
243 $urlEnd = "</a>";
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
244 if (strlen($iv["url"]) > 40)
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
245 $urlEnt = substr($urlEnt, 0, 40)."...";
926
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
246 $desc .= "<br /><br /><b>".chentities($urlEnt)."</b>";
509
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
247 } else {
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
248 $urlBegin = $urlEnd = "";
509
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
249 }
602
e46ee0632810 Add link via URL field too.
Matti Hamalainen <ccr@tnsp.org>
parents: 601
diff changeset
250
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
251 echo " ".$urlBegin."<img class=\"noborder\" src=\"question.png\" onmouseover=\"stt(".$totalLoc.
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
252 ");\" onmouseout=\"htt();\" alt=\"(?)\" />".$urlEnd."\n";
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
253
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
254 $locationTips[$totalLoc] = array(
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
255 "title" => $iv["name"],
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
256 "desc" => $desc
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
257 );
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
258 }
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
259
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
260 // Alternative names
975
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
261 $nnames = count($iv["names"]);
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
262 if ($nnames > 1) {
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
263 echo "<br />";
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
264 for ($nname = 1; $nname < $nnames; $nname++) {
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
265 if ($iv["names"][$nname]["flags"] & NAME_ORIG)
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
266 echo "<b>";
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
267 echo chentities($iv["names"][$nname]["name"]);
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
268 if ($iv["names"][$nname]["flags"] & NAME_ORIG)
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
269 echo "</b>";
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
270 if ($nname < $nnames - 1) echo " | ";
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
271 }
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
272 }
817
eaba088b5424 Show alternative location names on location page.
Matti Hamalainen <ccr@tnsp.org>
parents: 816
diff changeset
273
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
274 // Coder / society names
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
275 if (count($iv["coders"]) > 0 && $showCoders) {
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
276 $isSG = preg_match("/[SG]/", $iv["flags"]);
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
277 if ((!isset($coderName) && !$isSG) || isset($coderName)) {
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
278 $fs = "";
975
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
279 foreach ($iv["coders"] as $name) {
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
280 if ($fs != "") $fs .= ", ";
975
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
281 switch ($name["flags"]) {
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
282 case NAME_ORIG: $qs = "title=\"Original creator\""; break;
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
283 case NAME_RECODER: $qs = "title=\"Converter, recoder\""; break;
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
284 case NAME_MAINTAINER: $qs = "title=\"Maintainer\""; break;
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
285 case NAME_EXPANDER: $qs = "title=\"Implemented new content, expansion(s)\""; break;
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
286 default: $qs = "";
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
287 }
679
9382e44a8c42 Import fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 678
diff changeset
288 if ($filter != "C" || !$applyFilter)
975
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
289 $fs .= "<a ".$qs." href=\"".$_SERVER["PHP_SELF"]."?a=".$name["name"]."\">".$name["name"]."</a>";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
290 else
975
af0fc3a965dc Fix all the web-interface PHP crap to work with the new LOC file format. Urgh. This shit could really use some refactoring cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 926
diff changeset
291 $fs .= $name["name"];
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
292 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
293 echo "<br />[".$fs."]";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
294 }
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
295 }
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
296
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
297 echo "</td>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
298
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
299 if (++$n >= $maxRow) {
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
300 echo " </tr>\n";
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
301 $n = 0;
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
302 }
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
303 }
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
304
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
305 if ($n > 0) {
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
306 while ($n++ < $maxRow)
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
307 echo " <td></td>\n";
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
308 echo " </tr>\n";
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
309 }
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
310 echo "</table>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
311 }
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
312
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
313 echo "<p><b>".$totalLoc."</b> locations.</p>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
314
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
315 /* Print out location tooltip HTML code
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
316 */
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
317 foreach ($locationTips as $tipID => $tip) {
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
318 echo "<div class=\"tooltip\" id=\"tt".$tipID.
926
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
319 "\"><div class=\"holder\"><b>".chentities($tip["title"]).
816
6341de08bd52 Handle alternative location names better;Add unique location ID generation to handle locations with exactly same primary name.
Matti Hamalainen <ccr@tnsp.org>
parents: 813
diff changeset
320 "</b><br />".$tip["desc"]."</div></div>\n";
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
321 }
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
322 } else {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
323 echo "<p><b>No locations known!</b></p>\n";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
324 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
325
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
326 // Google Analytics
532
Matti Hamalainen <ccr@tnsp.org>
parents: 519
diff changeset
327 require "urchin.inc.php";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
328 ?>
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
329 </body>
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
330 </html>