annotate www/loc.php @ 519:50ce4311214e

Sync.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 19 Jan 2008 22:27:10 +0000
parents 622767fb509e
children e98844e26c69
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
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 function makeURL($pcities, $coders, $name, $desc, $class)
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 $s = "";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 if ($pcities) $s = "c";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 if (!$coders) {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 if ($s != "") $s .= "&amp;";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 $s .= "s";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 }
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 if (isset($name)) {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 if ($s != "") $s .= "&amp;";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 $s .= "n=".$name;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
441
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
20 echo " <td><a ";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 if (isset($class))
441
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
22 echo "class=\"".$class."\" ";
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
23 echo "href=\"".$GLOBALS["SCRIPT_NAME"];
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
24 if (strlen($s) > 0) echo "?".$s;
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
25 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
26 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
28
441
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
29 /* Initialization
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
30 */
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
31 printPageHeader($pageTitle." - Locations",
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
32 "<script type=\"text/javascript\" src=\"tooltip.js\"></script>");
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
33 //echo "<div><b>DEVELOPMENT VERSION</b></div>";
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
34
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
35 $locTable = array();
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
36 $wizTable = array();
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
37
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
38 $onlyPCities = isset($_GET["c"]);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
39 $showCoders = !isset($_GET["s"]);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
40
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
41 if (isset($_GET["a"])) {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
42 $coderName = basename($_GET["a"]);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
43 $coderName = strtoupper(substr($coderName, 0, 1)).strtolower(substr($coderName, 1));
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
44 readWizInfo("wizards.txt", $wizTable);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
45 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
46
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
47 if (isset($_GET["n"])) {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
48 $setName = strtolower(basename($_GET["n"]));
509
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
49 if (file_exists($setName.".loc")) {
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
50 readLocations($setName, $locTable, $onlyPCities);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
51 } else {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
52 echo "<h1>No such continent ID!</h1>";
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
53 unset($setName);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
54 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
55 } else {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
56 reset($continentList);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
57 while (list($iKey, $iValue) = each($continentList)) {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
58 readLocations($iKey, $locTable, $onlyPCities);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
59 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
60 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
61
441
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
62
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
63 /* 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
64 */
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 echo "<h1>";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 if ($onlyPCities)
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 echo "Player cities";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 else
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 echo "Locations";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70 echo " of ";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 if (isset($continentList[$setName]))
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 echo $continentList[$setName]." continent in ";
509
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
73 else
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
74 if (isset($specialList[$setName]))
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
75 echo $specialList[$setName]." in ";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 echo "BatMUD";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 if (isset($coderName))
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 echo " by ".$coderName;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 echo "</h1>\n";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
81 echo "<div class=\"selbar\">\n <table>\n <tr>\n";
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
82 makeURL(FALSE, TRUE, null, "EVERYTHING", "sel1");
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 if (!$onlyPCities) {
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
85 makeURL(TRUE, $showCoders, $setName, "PCities", "sel2");
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 if (!$showCoders)
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
88 makeURL($onlyPCities, TRUE, $setName, "Show Coders", "sel3");
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 else
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
90 makeURL($onlyPCities, FALSE, $setName, "Hide Coders", "sel3");
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 } else {
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
92 makeURL(FALSE, $showCoders, $setName, "Locations", "sel2");
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 if (!$showCoders)
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
95 makeURL($onlyPCities, TRUE, $setName, "Show SS", "sel3");
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 else
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
97 makeURL($onlyPCities, FALSE, $setName, "Hide SS", "sel3");
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
100 echo " <td></td>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 reset($continentList);
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 while (list($iKey, $iValue) = each($continentList)) {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 makeURL($onlyPCities, $showCoders, $iKey, $iValue, $iKey);
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106 ?>
441
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
107 <td><a href="<? echo $pageIndex ?>">Back to main page</a></td>
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
108 </tr>
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
109 </table>
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
110 </div>
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
111
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 <?
441
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
113 /* Coder/creator information box
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
114 */
393
Matti Hamalainen <ccr@tnsp.org>
parents: 368
diff changeset
115 if (isset($coderName) && isset($wizTable[$coderName]) && count($wizTable[$coderName]) > 1) {
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
116 echo "<div class=\"wizinfo\">\n <table>\n <tr>\n";
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
117
501
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
118 $s = $wizTable[$coderName]["imageURL"];
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
119 if (isset($s)) {
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
120 if (substr($s, 0, 6) == "bat://")
501
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
121 $s = "img/unknown.png";
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
122 // $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
123 } else
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
124 $s = "img/unknown.png";
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
125
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
126 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
127
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
128
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
129 echo " <td class=\"info\">\n";
501
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
130 echo " <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
131
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
132 $s = $wizTable[$coderName]["desc"];
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
133 if (isset($s) > 0) {
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
134 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
135 }
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
136
501
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
137 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
138
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
139 $s = $wizTable[$coderName]["homeURL"];
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
140 if (isset($s)) {
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
141 if ($s == "bat")
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
142 $s = "http://wiz.bat.org/~".strtolower($coderName)."/";
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
143
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
144 echo " [<a href=\"".$s."\">Homepage</a>]<br />\n";
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
145 }
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
146
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
147 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
148 }
488
Matti Hamalainen <ccr@tnsp.org>
parents: 441
diff changeset
149
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 /* 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
152 */
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153 if (count($locTable) > 0) {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154 /* Make alphabetical table of locations
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155 */
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 while (list($key, $value) = each($locTable)) {
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
157 if (isset($_GET["nocoders"])) {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
158 if (count($value["coders"]) == 0 && !preg_match("/[SPG]/", $value["flags"]))
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159 $alphaTable[$key[0]][] = $value;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 } else {
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
161 if (isset($coderName)) {
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
162 if (array_search($coderName, $value["coders"]) !== FALSE)
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
163 $alphaTable[$key[0]][] = $value;
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
164 } else
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
165 $alphaTable[$key[0]][] = $value;
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169 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
170
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 /* 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
172 */
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
173 $locationTips = array();
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174 $totalLoc = 0;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175 $maxRow = 6;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176 while (list($key, $value) = each($alphaTable)) {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177 if (count($value) > 0) {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178 asort($value);
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
179
311
134dded5369b Changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 300
diff changeset
180 echo "<h3><a name=\"".strtolower($key)."\"></a>".$key."</h3>\n";
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
181 echo "<table class=\"loc\" width=\"95%\">\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182 $n = 0;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
183 while (list($ik, $iv) = each($value)) {
368
875548a41c71 New "location added to game" timestamp field in location files; Modified mkloc and PHP glue to handle the change.
Matti Hamalainen <ccr@tnsp.org>
parents: 337
diff changeset
184 if ($n == 0)
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
185 echo " <tr>\n";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187 $totalLoc++;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
189 printf(" <td width=\"%d%%\" class=\"%s\">",
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190 (100 / $maxRow), $iv["continent"]);
311
134dded5369b Changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 300
diff changeset
191
509
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
192 if (isset($specialList[$iv["continent"]])) {
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
193 echo "<b>".htmlentities($iv["name"])."</b>";
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
194 } else {
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
195 printURL($iv["continent"].".html#loc".$iv["x"]."_".$iv["y"]);
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
196 echo htmlentities($iv["name"])."</a>";
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
197 }
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
198
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
199 if (isset($iv["freeform"]) && strlen($iv["freeform"]) > 0) {
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
200 echo " <img src=\"question.png\" onmouseover=\"stt(".$totalLoc.");\" onmouseout=\"htt();\" />\n";
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
201
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
202 $locationTips[$totalLoc] = array(
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
203 "title" => $iv["name"],
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
204 "desc" => $iv["freeform"]
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
205 );
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
206 }
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
207
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
208 if (count($iv["coders"]) > 0 && $showCoders) {
393
Matti Hamalainen <ccr@tnsp.org>
parents: 368
diff changeset
209 $isSG = preg_match("/[SG]/", $iv["flags"]);
Matti Hamalainen <ccr@tnsp.org>
parents: 368
diff changeset
210 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
211 $fs = "";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
212 while (list($fKey, $fVal) = each($iv["coders"])) {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
213 if ($fs != "") $fs .= ", ";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
214 if (!$onlyPCities)
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
215 $fs .= "<a href=\"loc.php?a=".$fVal."\">".$fVal."</a>";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
216 else
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
217 $fs .= $fVal;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
218 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
219 echo "<br />[".$fs."]";
393
Matti Hamalainen <ccr@tnsp.org>
parents: 368
diff changeset
220 }
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
221 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223 echo "</td>\n";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
224
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
225 $n++;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
226 if ($n >= $maxRow) {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
227 echo " </tr>\n";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
228 $n = 0;
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
229 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
230 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
231 if ($n > 0) {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
232 while ($n++ < $maxRow)
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
233 echo " <td></td>\n";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
234
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
235 echo " </tr>\n";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
236 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
237 echo "</table>\n";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
238 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
239 }
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
240
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
241 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
242
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
243 /* Print out location tooltip HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
244 */
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
245 reset($locationTips);
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
246 while (list($key, $value) = each($locationTips)) {
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
247 echo "<div class=\"tooltip\" id=\"tt".$key.
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
248 "\"><div class=\"holder\"><b>".htmlentities($value["title"]).
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
249 "</b><br />".htmlentities($value["desc"])."</div></div>\n";
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
250 }
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
251 } else {
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
252 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
253 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
254
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
255 // Google Analytics
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
256 require "../urchin.inc.php";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
257 ?>
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
258 </body>
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
259 </html>