annotate www/loc.php @ 2763:78ad0e51b7b5

Improve wizards.txt parser, add functionality for specifying alternative / additional names as some wizards have used more than one. Also other improvements in wizard data handling.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 12 Mar 2024 15:47:58 +0200
parents 7948d14d3893
children b58f261314f8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1646
2cbce82aa3c3 Use full <?php ?> tag, misc cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1638
diff changeset
1 <?php
300
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";
1272
Matti Hamalainen <ccr@tnsp.org>
parents: 1233
diff changeset
3 require "world.inc.php";
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
4 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
5
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
6
1112
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
7 // Wizard info box special formatting tags
2439
61c2e037646a Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 2401
diff changeset
8 $specTags =
61c2e037646a Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 2401
diff changeset
9 [
1112
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
10 "b" => "<b>",
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
11 "\/b" => "</b>",
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
12 "i" => "<i>",
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
13 "\/i" => "</i>",
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
14 "p" => "<br /><br />",
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
15 "br" => "<br />",
1609
c5e15be5315c Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 1607
diff changeset
16 ];
1112
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
17
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
18
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
19 function printTitleLink($afilter, $filter, $authors, $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
20 {
2055
062725ea7be7 Cleanups and minor improvements to location list page.
Matti Hamalainen <ccr@tnsp.org>
parents: 2043
diff changeset
21 global $setName;
062725ea7be7 Cleanups and minor improvements to location list page.
Matti Hamalainen <ccr@tnsp.org>
parents: 2043
diff changeset
22
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 $s = "";
1567
026c6eca781c Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1494
diff changeset
24 if ($afilter)
026c6eca781c Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1494
diff changeset
25 $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
26
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
27 if (!$authors)
1567
026c6eca781c Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1494
diff changeset
28 {
801
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
29 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
30 $s .= "s";
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32
1567
026c6eca781c Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1494
diff changeset
33 if ($qname !== "")
026c6eca781c Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1494
diff changeset
34 {
801
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
35 if ($s !== "") $s .= "&amp;";
Matti Hamalainen <ccr@tnsp.org>
parents: 735
diff changeset
36 $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
37 }
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
38
2055
062725ea7be7 Cleanups and minor improvements to location list page.
Matti Hamalainen <ccr@tnsp.org>
parents: 2043
diff changeset
39 if ($setName == $qname || ($setName == "" && $qname == "all"))
062725ea7be7 Cleanups and minor improvements to location list page.
Matti Hamalainen <ccr@tnsp.org>
parents: 2043
diff changeset
40 $qclass .= " active";
062725ea7be7 Cleanups and minor improvements to location list page.
Matti Hamalainen <ccr@tnsp.org>
parents: 2043
diff changeset
41
1567
026c6eca781c Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1494
diff changeset
42 echo
026c6eca781c Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1494
diff changeset
43 " <a class=\"control continent ".$qclass.
1918
3075415f052e Get rid of PHP_SELF usage.
Matti Hamalainen <ccr@tnsp.org>
parents: 1900
diff changeset
44 "\" href=\"?".$s."\">".$desc."</a>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 }
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
47
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
48 function qcheck($arr, $key, &$result)
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
49 {
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
50 if (isset($key) && isset($arr[$key]))
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
51 {
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
52 $result = $arr[$key];
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
53 return TRUE;
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
54 }
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
55 else
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
56 {
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
57 unset($result);
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
58 return FALSE;
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
59 }
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
60 }
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
61
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
62
2278
3293678b598b Use a custom comparision function for location sorting.
Matti Hamalainen <ccr@tnsp.org>
parents: 2272
diff changeset
63 function locCompare($va, $vb)
3293678b598b Use a custom comparision function for location sorting.
Matti Hamalainen <ccr@tnsp.org>
parents: 2272
diff changeset
64 {
3293678b598b Use a custom comparision function for location sorting.
Matti Hamalainen <ccr@tnsp.org>
parents: 2272
diff changeset
65 return strcmp($va["name"], $vb["name"]);
3293678b598b Use a custom comparision function for location sorting.
Matti Hamalainen <ccr@tnsp.org>
parents: 2272
diff changeset
66 }
3293678b598b Use a custom comparision function for location sorting.
Matti Hamalainen <ccr@tnsp.org>
parents: 2272
diff changeset
67
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
68
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
69 //
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
70 // Initialization
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
71 //
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
72 // Special backwards compatibility case for pcities
2055
062725ea7be7 Cleanups and minor improvements to location list page.
Matti Hamalainen <ccr@tnsp.org>
parents: 2043
diff changeset
73 if (isset($_REQUEST["c"]))
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
74 {
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
75 $filterID = "C";
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
76 $applyFilter = TRUE;
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
77 }
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
78 else
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
79 // Try to get the filter ID
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
80 if (($filterID = mpGetRequestItem("f", "", TRUE)) != "")
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
81 {
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
82 if (!array_key_exists($filterID, $locationTypes))
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
83 {
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
84 mpError("Invalid location filter rule '".chentities($filterID)."'.");
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
85 $filterID = "";
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
86 $applyFilter = FALSE;
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
87 }
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
88 else
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
89 $applyFilter = TRUE;
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
90 }
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
91 else
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
92 // No filter ID specified, default to showing everything
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
93 {
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
94 $filterID = "";
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
95 $applyFilter = FALSE;
621
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
96 }
537fae9ebf1d Synced.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
97
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
98
2055
062725ea7be7 Cleanups and minor improvements to location list page.
Matti Hamalainen <ccr@tnsp.org>
parents: 2043
diff changeset
99 $showCoders = !isset($_REQUEST["s"]);
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
100
2055
062725ea7be7 Cleanups and minor improvements to location list page.
Matti Hamalainen <ccr@tnsp.org>
parents: 2043
diff changeset
101 if (($tmpName = mpGetRequestItem("a", FALSE, TRUE)) !== FALSE)
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
102 {
1620
6d620441af7f Rename various functions, and other cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1609
diff changeset
103 if (preg_match("#^([a-z]{1,15})#i", $tmpName, $matches))
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
104 {
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
105 $authorName = $matches[1];
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
106 $authorName = strtoupper(substr($authorName, 0, 1)).strtolower(substr($authorName, 1));
1150
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
107
2033
57ecb49d7b4a Update the apc functions to use apcu_ prefix.
Matti Hamalainen <ccr@tnsp.org>
parents: 2032
diff changeset
108 $wizTable = apcu_fetch("wizTable");
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
109 if (empty($wizTable))
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
110 {
1620
6d620441af7f Rename various functions, and other cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1609
diff changeset
111 $wizTable = mpReadWizInfoFiles();
2033
57ecb49d7b4a Update the apc functions to use apcu_ prefix.
Matti Hamalainen <ccr@tnsp.org>
parents: 2032
diff changeset
112 apcu_store("wizTable", $wizTable, 3600);
1150
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
113 }
2763
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
114
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
115 // Correct aliases
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
116 if (isset($wizTable[$authorName]))
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
117 $authorName = $wizTable[$authorName]["name"];
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
118 }
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
119 else
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
120 {
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
121 $authorName = "???";
1900
ed98d2fe4bca Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1891
diff changeset
122 mpError("Invalid wizard name.");
1150
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
123 }
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
124 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
125
2055
062725ea7be7 Cleanups and minor improvements to location list page.
Matti Hamalainen <ccr@tnsp.org>
parents: 2043
diff changeset
126 if (($tmpName = mpGetRequestItem("n", FALSE, TRUE)) !== FALSE)
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
127 {
1609
c5e15be5315c Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 1607
diff changeset
128 $locTable = [];
2055
062725ea7be7 Cleanups and minor improvements to location list page.
Matti Hamalainen <ccr@tnsp.org>
parents: 2043
diff changeset
129 $setName = strtolower(trim(basename($tmpName)));
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
130 if (file_exists($setName.".loc"))
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
131 {
2033
57ecb49d7b4a Update the apc functions to use apcu_ prefix.
Matti Hamalainen <ccr@tnsp.org>
parents: 2032
diff changeset
132 $locTable = apcu_fetch("loc_".$setName);
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
133 if (empty($locTable))
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
134 {
1609
c5e15be5315c Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 1607
diff changeset
135 $locTable = [];
2037
e82ba6f55708 Refactor how the location filtering works internally to use proper LOC flags.
Matti Hamalainen <ccr@tnsp.org>
parents: 2033
diff changeset
136 mpParseLocFile($setName, $locTable, $applyFilter, $locationTypes[$filterID][LTI_INVERT_FLAGS], $locationTypes[$filterID][LTI_FLAGS]);
2033
57ecb49d7b4a Update the apc functions to use apcu_ prefix.
Matti Hamalainen <ccr@tnsp.org>
parents: 2032
diff changeset
137 apcu_store("loc_".$setName, $locTable, 3600);
1150
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
138 }
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
139 }
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
140 else
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
141 {
1900
ed98d2fe4bca Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1891
diff changeset
142 mpError("No such continent ID!");
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
143 unset($setName);
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
144 }
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
145 }
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
146 else
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
147 {
2033
57ecb49d7b4a Update the apc functions to use apcu_ prefix.
Matti Hamalainen <ccr@tnsp.org>
parents: 2032
diff changeset
148 $locTable = apcu_fetch("loc_locTable");
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
149 if (empty($locTable))
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
150 {
2037
e82ba6f55708 Refactor how the location filtering works internally to use proper LOC flags.
Matti Hamalainen <ccr@tnsp.org>
parents: 2033
diff changeset
151 $locTable = mpParseLocFiles($applyFilter, $locationTypes[$filterID][LTI_INVERT_FLAGS], $locationTypes[$filterID][LTI_FLAGS]);
2033
57ecb49d7b4a Update the apc functions to use apcu_ prefix.
Matti Hamalainen <ccr@tnsp.org>
parents: 2032
diff changeset
152 apcu_store("loc_locTable", $locTable, 3600);
1150
02fe48a608d7 Use APC for caching of location and wizard data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
153 }
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
154 }
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
155
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
156
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
157 // Make alphabetically sorted table of locations
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
158 $alphaTable = [];
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
159 foreach ($locTable as $id => $data)
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
160 if (isset($data["name"]))
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
161 {
2440
cba2376dcb39 Fix duping of location letters due to upper/lower getting separated.
Matti Hamalainen <ccr@tnsp.org>
parents: 2439
diff changeset
162 $idx = strtolower($data["name"][0]);
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
163 if (isset($authorName))
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
164 {
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
165 foreach ($data["authors"] as $author)
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
166 {
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
167 if ($authorName == $author["name"])
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
168 $alphaTable[$idx][] = $data;
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
169 }
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
170 }
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
171 else
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
172 $alphaTable[$idx][] = $data;
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
173 }
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
174
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
175 ksort($alphaTable, SORT_STRING);
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
176
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
177
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
178 //
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
179 // Start of the page
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
180 //
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
181 if ($applyFilter)
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
182 $mtitle = $locationTypes[$filterID][LTI_PAGE_DESC];
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
183 else
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
184 $mtitle = "Locations";
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
185
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
186 $mtitle .= " of ";
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
187
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
188 if (isset($setName) && isset($continentList[$setName]))
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
189 {
2032
d9c15f7ae4c4 Add defines for continent list array index constants and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 2015
diff changeset
190 $mtitle .= $continentList[$setName][CTI_NAME].
d9c15f7ae4c4 Add defines for continent list array index constants and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 2015
diff changeset
191 ($continentList[$setName][CTI_SPECIAL] ? " in " : " continent in ");
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
192 }
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
193
1620
6d620441af7f Rename various functions, and other cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1609
diff changeset
194 mpPrintPageHeader($pageTitle." - Locations",
1694
Matti Hamalainen <ccr@tnsp.org>
parents: 1687
diff changeset
195 " <script type=\"text/javascript\" src=\"tooltip.js\"></script>\n".
2234
94d3c4ae7121 Activate tooltip.js functionality on load.
Matti Hamalainen <ccr@tnsp.org>
parents: 2055
diff changeset
196 " <meta name=\"robots\" content=\"nofollow\" />\n",
94d3c4ae7121 Activate tooltip.js functionality on load.
Matti Hamalainen <ccr@tnsp.org>
parents: 2055
diff changeset
197 " onload=\"mapOnLoad()\"");
1140
3bb8253db932 New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 1115
diff changeset
198
3bb8253db932 New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 1115
diff changeset
199 echo
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
200 "<h1>".$mtitle."BatMUD".(isset($authorName) ? " by ".chentities($authorName) : "")."</h1>\n".
1918
3075415f052e Get rid of PHP_SELF usage.
Matti Hamalainen <ccr@tnsp.org>
parents: 1900
diff changeset
201 "<form action=\"?\" method=\"get\">\n".
1567
026c6eca781c Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1494
diff changeset
202 "<div class=\"controls\">\n";
1140
3bb8253db932 New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 1115
diff changeset
203
622
6d2c28904660 Synchronized.
Matti Hamalainen <ccr@tnsp.org>
parents: 621
diff changeset
204 if (isset($setName))
1694
Matti Hamalainen <ccr@tnsp.org>
parents: 1687
diff changeset
205 echo " <input type=\"hidden\" name=\"n\" value=\"".chentities($setName)."\" />\n";
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
206
1694
Matti Hamalainen <ccr@tnsp.org>
parents: 1687
diff changeset
207 echo " <select class=\"control dropdown\" name=\"f\" onChange=\"this.form.submit();\">\n";
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
208 foreach ($locationTypes as $lid => $ldata)
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
209 {
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
210 echo
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
211 " <option value=\"".$lid."\"".
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
212 (($applyFilter && $filterID == $lid) ? " selected=\"selected\"" : "").
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
213 ">".$ldata[LTI_MENU_TITLE]."</option>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
214 }
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
215 echo
1694
Matti Hamalainen <ccr@tnsp.org>
parents: 1687
diff changeset
216 " </select>\n".
Matti Hamalainen <ccr@tnsp.org>
parents: 1687
diff changeset
217 " <noscript><input type=\"submit\" value=\" Update \" class=\"control submit\" /></noscript>\n";
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
218
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
219
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
220 printTitleLink($applyFilter, $filterID, $showCoders, "All&nbsp;continents", "", "all");
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
221 foreach ($continentList as $continent => $data)
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
222 {
2032
d9c15f7ae4c4 Add defines for continent list array index constants and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 2015
diff changeset
223 if ($data[CTI_HAS_MAP])
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
224 printTitleLink($applyFilter, $filterID, $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
225 }
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
226 printTitleLink($applyFilter, $filterID, $showCoders, "Special", "special", "special");
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
227
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
228 echo
1567
026c6eca781c Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1494
diff changeset
229 "</div>\n".
026c6eca781c Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1494
diff changeset
230 "</form>\n";
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
231
1329
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
232
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
233 //
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
234 // Wizard/author/creator information box
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
235 //
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
236 if (isset($authorName))
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
237 {
2763
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
238 if (isset($wizTable[$authorName]))
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
239 {
2763
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
240 $entry = &$wizTable[$authorName];
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
241
1329
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
242 // Profile picture
2763
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
243 //$imageURL = $wizImageURL.(qcheck($entry, "imageURL", $imageName) ? $imageName : "unknown.png");
2551
a36fa06a6c93 No longer show wizard portrait images.
Matti Hamalainen <ccr@tnsp.org>
parents: 2550
diff changeset
244 $imageURL = $wizImageURL."unknown.png";
1112
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
245
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
246 echo
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
247 "<div class=\"wizInfoBox\">\n".
2763
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
248 " <div class=\"wizImage\"><img src=\"".$imageURL."\" alt=\"".$entry["name"]."\" /></div>\n".
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
249 " <div class=\"wizInfo\">\n".
2763
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
250 " <h2>".$entry["name"];
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
251
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
252 if (count($entry["names"]) > 0)
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
253 {
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
254 echo " (aka ".implode(" aka ", $entry["names"]).")";
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
255 }
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
256
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
257 echo
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
258 "</h2>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
259
1329
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
260 // Description block
2763
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
261 if (qcheck($entry, "desc", $str))
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
262 {
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
263 // Handle special tags
1918
3075415f052e Get rid of PHP_SELF usage.
Matti Hamalainen <ccr@tnsp.org>
parents: 1900
diff changeset
264 $str = preg_replace("/\~([A-Z][a-z]+)\~/i", "<a href=\"?a=\${1}\">\${1}</a>", $str);
1112
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
265
1329
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
266 foreach ($specTags as $tag => $rep)
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
267 $str = preg_replace("/\[".$tag."\]/i", $rep, $str);
1112
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
268
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
269 echo " <p>".$str."</p>\n";
1329
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
270 }
321
eeb6167cf81e Updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
271
1329
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
272 // Links, etc.
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
273 echo " [<a href=\"".mpFingerURL($authorName)."\">Finger</a>]\n";
337
ca191c3a0ce1 Updates and lots of new ugly glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 321
diff changeset
274
2763
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
275 if (qcheck($entry, "homeURL", $s))
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
276 {
1329
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
277 if ($s == "bat")
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
278 $s = "https://wiz.bat.org/~".strtolower($authorName)."/";
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
279
2736
7948d14d3893 Improve cosmetic output of wizard information entry.
Matti Hamalainen <ccr@tnsp.org>
parents: 2714
diff changeset
280 echo " [<a href=\"".$s."\">Homepage</a>]\n";
1329
Matti Hamalainen <ccr@tnsp.org>
parents: 1272
diff changeset
281 }
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
282
2763
78ad0e51b7b5 Improve wizards.txt parser, add functionality for specifying alternative /
Matti Hamalainen <ccr@tnsp.org>
parents: 2736
diff changeset
283 if (qcheck($entry, "countries", $s))
2714
06b7c448338b Add countries field to wizard info database.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
284 {
2736
7948d14d3893 Improve cosmetic output of wizard information entry.
Matti Hamalainen <ccr@tnsp.org>
parents: 2714
diff changeset
285 echo " [".implode(" | ", array_map(
7948d14d3893 Improve cosmetic output of wizard information entry.
Matti Hamalainen <ccr@tnsp.org>
parents: 2714
diff changeset
286 function ($item)
7948d14d3893 Improve cosmetic output of wizard information entry.
Matti Hamalainen <ccr@tnsp.org>
parents: 2714
diff changeset
287 {
7948d14d3893 Improve cosmetic output of wizard information entry.
Matti Hamalainen <ccr@tnsp.org>
parents: 2714
diff changeset
288 return strtoupper($item);
7948d14d3893 Improve cosmetic output of wizard information entry.
Matti Hamalainen <ccr@tnsp.org>
parents: 2714
diff changeset
289 }, $s))."]<br />\n";
2714
06b7c448338b Add countries field to wizard info database.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
290 }
06b7c448338b Add countries field to wizard info database.
Matti Hamalainen <ccr@tnsp.org>
parents: 2620
diff changeset
291
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
292 echo
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
293 " </div>\n".
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
294 "</div>\n";
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
295 }
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
296 else
1900
ed98d2fe4bca Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1891
diff changeset
297 mpError("No information entry for this wizard.");
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
298 }
488
Matti Hamalainen <ccr@tnsp.org>
parents: 441
diff changeset
299
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
300
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
301 //
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
302 // Print out errors
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
303 //
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
304 if ($errorSet)
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
305 {
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
306 echo
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
307 "<div style=\"color: red;\">\n".
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
308 " <ul>\n";
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
309
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
310 foreach ($errorMsgs as $msg)
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
311 echo " <li>".$msg."</li>\n";
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
312
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
313 echo
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
314 " </ul>\n".
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
315 "</div>\n";
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
316 }
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
317
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
318
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
319 //
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
320 // Print list of locations
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
321 //
1638
775208d791fa Code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1630
diff changeset
322 if (count($alphaTable) > 0)
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
323 {
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
324
1609
c5e15be5315c Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 1607
diff changeset
325 $locationTips = [];
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
326 $totalLoc = 0;
1656
828a20694fcc Rename a variable.
Matti Hamalainen <ccr@tnsp.org>
parents: 1646
diff changeset
327 $maxColumns = 6;
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
328 foreach ($alphaTable as $alpha => $alphaLocs)
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
329 {
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
330 if (count($alphaLocs) <= 0) continue;
1148
52550f58cee5 Move alphabetic table printing code to a function in common routines.
Matti Hamalainen <ccr@tnsp.org>
parents: 1140
diff changeset
331 $letter = strtoupper($alpha);
817
eaba088b5424 Show alternative location names on location page.
Matti Hamalainen <ccr@tnsp.org>
parents: 816
diff changeset
332
2278
3293678b598b Use a custom comparision function for location sorting.
Matti Hamalainen <ccr@tnsp.org>
parents: 2272
diff changeset
333 uasort($alphaLocs, "locCompare");
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
334
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
335 echo
1630
90e6a0eda2ae Implement specialdate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1620
diff changeset
336 "<h3 class=\"alpha\"><a id=\"ch".$letter."\"></a>".$letter."</h3>\n".
90e6a0eda2ae Implement specialdate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1620
diff changeset
337 mpSpecialDate("loc", 2).
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
338 "<div class=\"locTable\">\n";
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
339
817
eaba088b5424 Show alternative location names on location page.
Matti Hamalainen <ccr@tnsp.org>
parents: 816
diff changeset
340 $n = 0;
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
341 foreach ($alphaLocs as $ik => $iv)
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
342 {
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
343 $totalLoc++;
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
344
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
345 // Print location entry
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
346 echo
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
347 " <div class=\"locCell ".$iv["continent"]."\">".
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
348 "<div class=\"locHeader\">".
2272
0556b65f137b Cleanups in the web code, show location type again in some places.
Matti Hamalainen <ccr@tnsp.org>
parents: 2234
diff changeset
349 "<span class=\"locTitle\">".
0556b65f137b Cleanups in the web code, show location type again in some places.
Matti Hamalainen <ccr@tnsp.org>
parents: 2234
diff changeset
350 mpGetMapLink($iv, $continentList[$iv["continent"]][CTI_HAS_MAP], TRUE, TRUE).
0556b65f137b Cleanups in the web code, show location type again in some places.
Matti Hamalainen <ccr@tnsp.org>
parents: 2234
diff changeset
351 "</span>";
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
352
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
353 // If either freeform desc or URL field are set, we add those
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
354 if (isset($iv["url"]) || isset($iv["freeform"]))
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
355 {
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
356 // Free form description
926
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
357 $desc = isset($iv["freeform"]) ? chentities($iv["freeform"]) : "";
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
358
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
359 // Add URL information, chopped, if any
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
360 if (isset($iv["url"]))
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
361 {
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
362 $urlEnt = $iv["url"];
926
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
363 $urlBegin = "<a href=\"".chentities($urlEnt)."\" target=\"_blank\">";
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
364 $urlEnd = "</a>";
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
365 if (strlen($iv["url"]) > 40)
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
366 $urlEnt = substr($urlEnt, 0, 40)."...";
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
367 $desc .= "<div class=\"locURL\">".chentities($urlEnt)."</div>";
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
368 }
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
369 else
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
370 {
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
371 $urlBegin = $urlEnd = "";
509
622767fb509e Added support for 'limbo'.
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
372 }
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
373
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
374 echo
1702
dd123d0a75d9 Sync cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1694
diff changeset
375 " ".$urlBegin.
dd123d0a75d9 Sync cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1694
diff changeset
376 "<span onmouseover=\"stt(".$totalLoc.
dd123d0a75d9 Sync cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1694
diff changeset
377 ");\" onmouseout=\"htt();\">&#x1F354;</span>".
dd123d0a75d9 Sync cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1694
diff changeset
378 $urlEnd;
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
379
1609
c5e15be5315c Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 1607
diff changeset
380 $locationTips[$totalLoc] = [
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
381 "title" => $iv["name"],
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
382 "desc" => $desc
1609
c5e15be5315c Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 1607
diff changeset
383 ];
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
384 }
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
385
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
386 echo "</div>"; // locHeader
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
387
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
388 // Alternative names
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
389 if (($nnames = count($iv["names"])) > 1)
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
390 {
1609
c5e15be5315c Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 1607
diff changeset
391 $fs = [];
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
392 for ($nname = 1; $nname < $nnames; $nname++)
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
393 {
1983
9f2e769bcf7a Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
394 $qname = $iv["names"][$nname];
9f2e769bcf7a Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
395 $norig = $qname["flags"] & NAME_ORIG;
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
396 $fs[] =
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
397 ($norig ? "<b>" : "").
1983
9f2e769bcf7a Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
398 chentities($qname["name"]).
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
399 ($norig ? "</b>" : "");
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
400 }
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
401 echo "<div class=\"locAltNames\">".implode(" | ", $fs)."</div>";
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
402 }
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
403
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
404 // Coder / society names
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
405 if (count($iv["authors"]) > 0 && $showCoders)
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
406 {
2373
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
407 $fs = [];
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
408 foreach ($iv["authors"] as $name)
2373
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
409 {
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
410 // Tags/flags of this author in relation to the area
2373
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
411 switch ($name["flags"])
1392
ae493885b68e More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1391
diff changeset
412 {
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
413 case AUTHOR_ORIG: $qs = "title=\"Original creator\" class=\"wizorig\""; break;
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
414 case AUTHOR_RECODER: $qs = "title=\"Converter, recoder\" class=\"wizrecoder\""; break;
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
415 case AUTHOR_MAINTAINER: $qs = "title=\"Maintainer\" class=\"wizmaintainer\""; break;
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
416 case AUTHOR_EXPANDER: $qs = "title=\"Implemented new content, expansion(s)\" class=\"wizexpander\""; break;
2373
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
417 default: $qs = "";
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
418 }
1979
3c03ca974e6a Fix issue with "area" selection in location display not actually showing all
Matti Hamalainen <ccr@tnsp.org>
parents: 1918
diff changeset
419
2373
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
420 // Pcity entries do not get "author" links as they are actually SS+
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
421 if ($filterID != "C" || !$applyFilter)
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
422 $fs[] = "<a ".$qs." href=\"?a=".$name["name"]."\">".$name["name"]."</a>";
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
423 else
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
424 $fs[] = $name["name"];
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
425 }
710debf83f53 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2278
diff changeset
426 echo "<div class=\"locCoders\">".implode(", ", $fs)."</div>";
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
427 }
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
428
2620
164aa519640d Use 'author' instead of 'creator' or 'coder'.
Matti Hamalainen <ccr@tnsp.org>
parents: 2619
diff changeset
429 if (/* isset($authorName) && */ $iv["added"] > 0)
2014
e55d83a233fe Display "location added" information on the location listings as well, if available.
Matti Hamalainen <ccr@tnsp.org>
parents: 1983
diff changeset
430 {
2619
7758acc2fc41 Change how addition timestamps are displayed.
Matti Hamalainen <ccr@tnsp.org>
parents: 2551
diff changeset
431 echo "<div class=\"locAdded\">".mpLocFormatTime($iv)."</div>";
2014
e55d83a233fe Display "location added" information on the location listings as well, if available.
Matti Hamalainen <ccr@tnsp.org>
parents: 1983
diff changeset
432 }
e55d83a233fe Display "location added" information on the location listings as well, if available.
Matti Hamalainen <ccr@tnsp.org>
parents: 1983
diff changeset
433
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
434 echo "</div>\n";
908
Matti Hamalainen <ccr@tnsp.org>
parents: 870
diff changeset
435 }
1677
9d51b4138e7d CSS updates and related code changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1656
diff changeset
436 echo "</div>\n";
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
437 }
2015
135b2b595e2c Trailing whitespace cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
438
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
439 echo
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
440 "<p><b>".$totalLoc."</b> locations.</p>\n".
1391
7fcea2fce0be More fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1387
diff changeset
441 "</div>\n"; // end of contents div
1140
3bb8253db932 New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 1115
diff changeset
442
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
443 // Print out location tooltip HTML code
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
444 foreach ($locationTips as $tipID => $tip)
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
445 {
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
446 echo
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
447 "<div class=\"tooltip\" id=\"tt".$tipID.
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
448 "\"><div class=\"holder\"><b>".chentities($tip["title"]).
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
449 "</b><br />".$tip["desc"]."</div></div>\n";
519
Matti Hamalainen <ccr@tnsp.org>
parents: 509
diff changeset
450 }
1140
3bb8253db932 New website layout and some minor improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 1115
diff changeset
451
1391
7fcea2fce0be More fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1387
diff changeset
452 // Print out the alpha link index div
1620
6d620441af7f Rename various functions, and other cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1609
diff changeset
453 mpPrintExtraBoxAlphaList("ch", $alphaTable);
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
454 }
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
455 else
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
456 {
1391
7fcea2fce0be More fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1387
diff changeset
457 echo
7fcea2fce0be More fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1387
diff changeset
458 "<p><b>No locations known!</b></p>\n".
7fcea2fce0be More fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1387
diff changeset
459 "</div>\n"; // end of contents div
7fcea2fce0be More fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1387
diff changeset
460
1900
ed98d2fe4bca Rename some functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1891
diff changeset
461 mpError("No locations known!");
300
edac314ac9bb Added in the ugly PHP-glue used in http://tnsp.org/maps/
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
462 }
1387
2b6b38e94bb2 Various minor code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1331
diff changeset
463
1891
68b784c7eae2 Get rid of mgeneric.inc.php here.
Matti Hamalainen <ccr@tnsp.org>
parents: 1702
diff changeset
464 mpPrintPageFooter(FALSE);
1151
e0794ddb605e Add output caching to main page and location page.
Matti Hamalainen <ccr@tnsp.org>
parents: 1150
diff changeset
465 ?>