annotate index.php @ 282:43d3d2e943aa gmap2

Bump version.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 16 Apr 2015 22:05:13 +0300
parents 9ed3aa7ca7b5
children 05ced537a07f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
1 <?php
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
2 require "config.inc.php";
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
3
255
d9e51ab58503 Improve the bootstrap configuration process.
Matti Hamalainen <ccr@tnsp.org>
parents: 253
diff changeset
4 if (!isset($pageBaseURL) || !isset($gmapsKey) || !isset($gmapsVersion))
d9e51ab58503 Improve the bootstrap configuration process.
Matti Hamalainen <ccr@tnsp.org>
parents: 253
diff changeset
5 {
256
85f79c765ab1 missing semicolon
jeskko
parents: 255
diff changeset
6 echo "Some settings are missing. Please check your configuration.";
255
d9e51ab58503 Improve the bootstrap configuration process.
Matti Hamalainen <ccr@tnsp.org>
parents: 253
diff changeset
7 exit;
d9e51ab58503 Improve the bootstrap configuration process.
Matti Hamalainen <ccr@tnsp.org>
parents: 253
diff changeset
8 }
d9e51ab58503 Improve the bootstrap configuration process.
Matti Hamalainen <ccr@tnsp.org>
parents: 253
diff changeset
9
219
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
10 //
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
11 // Generic settings
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
12 //
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
13 $pageCharset = "UTF-8";
282
43d3d2e943aa Bump version.
Matti Hamalainen <ccr@tnsp.org>
parents: 276
diff changeset
14 $pageVersion = "rev:2015-04-16";
183
a0f377c415ee Nicer style / cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
15
a0f377c415ee Nicer style / cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
16 $pageTitle1 = "BatMUD: The Age of Exiles";
282
43d3d2e943aa Bump version.
Matti Hamalainen <ccr@tnsp.org>
parents: 276
diff changeset
17 $pageTitle2 = "Google Maps Hack";
183
a0f377c415ee Nicer style / cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
18 $pageBy = "by Jeskko &amp; Ggr";
a0f377c415ee Nicer style / cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
19 $pageTitle = $pageTitle1." - ".$pageTitle2." ".$pageBy;
a0f377c415ee Nicer style / cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
20
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
21 $dataCopyrights = "Map data by BAT ry, Ggr, Slobber and Jeskko";
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
22
219
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
23
262
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
24 $jsLibs = array(
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
25 "map.js",
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
26 "lib/util.js",
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
27 "lib/markerwithlabel_packed.js",
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
28 "lib/markermanager_packed.js",
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
29 "world.js",
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
30 "icons.js",
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
31 "markers.js",
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
32 "nav.js",
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
33 );
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
34
271
1359bc5c53e0 Add name attribute to accepted list.
Matti Hamalainen <ccr@tnsp.org>
parents: 262
diff changeset
35 $jsTokens = array("x", "y", "zoom", "token", "name");
262
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
36
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
37
219
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
38 //
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
39 // Handle CSS stuff
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
40 //
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
41 $pageCSSCookie = "gmapcss";
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
42 if (isset($_GET["css"]))
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
43 {
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
44 $pageCSSIndex = intval($_GET["css"]);
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
45 setcookie($pageCSSCookie, $pageCSSIndex, time() + 365*24*60*60, "/"); // expire in a year
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
46 }
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
47 else
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
48 {
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
49 $pageCSSIndex = isset($_COOKIE[$pageCSSCookie]) ? intval($_COOKIE[$pageCSSCookie]) : 1;
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
50 }
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
51 $pageCSS = "css/mapstyle".$pageCSSIndex.".css";
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
52
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
53 echo
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
54 "<!DOCTYPE html>\n".
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
55 "<html>\n".
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
56 " <head>\n".
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
57 " <meta name=\"keywords\" content=\"batmud,map,laenor,lucentium,rothikgen,desolathya,furnachia,mud,mush,moo,online,massively,multiplayer,game,mmorpg,jeskko\" />\n".
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
58 " <meta charset=\"".$pageCharset."\">\n".
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
59 " <meta http-equiv=\"Content-type\" content=\"text/html;charset=".$pageCharset."\">\n".
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
60 " <title>".$pageTitle."</title>\n".
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
61 " <meta name=\"description\" content=\"".$pageTitle."\"/>\n".
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
62 " <script src=\"https://maps.googleapis.com/maps/api/js?v=".$gmapsVersion.
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
63 (isset($gmapsKey) ? "&amp;key=".$gmapsKey: "").
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
64 "&amp;sensor=false\" type=\"text/javascript\"></script>\n".
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
65 " <link rel=\"stylesheet\" href=\"".$pageCSS."\" type=\"text/css\" />\n".
218
373db5c1fe6f Add separate CSS stylesheet file for common color defs.
Matti Hamalainen <ccr@tnsp.org>
parents: 216
diff changeset
66 " <link rel=\"stylesheet\" href=\"css/colors.css\" type=\"text/css\" />\n".
262
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
67 " </head>\n".
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
68 " <body>\n";
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
69
253
c7abc2cce799 Add urchin include.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
70 @include "urchin.inc.php";
c7abc2cce799 Add urchin include.
Matti Hamalainen <ccr@tnsp.org>
parents: 250
diff changeset
71 ?>
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
72 <div id="header">
216
ccb8e748a03f Some stylesheet and HTML work.
Matti Hamalainen <ccr@tnsp.org>
parents: 200
diff changeset
73 <a id="headlogo" href="http://www.bat.org/"></a>
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
74 <div id="headcontent">
183
a0f377c415ee Nicer style / cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
75 <h1><?php echo $pageTitle1 ?></h1>
276
9ed3aa7ca7b5 Cosmetic.
Matti Hamalainen <ccr@tnsp.org>
parents: 275
diff changeset
76 <h2><?php echo $pageTitle2.(isset($pageVersion) ? " ".$pageVersion : "") ?></h2>
183
a0f377c415ee Nicer style / cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
77 <div class="credits"><?php echo $pageBy ?></div>
219
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
78 <div class="controls">
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
79 <?php
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
80 for ($i = 1; $i <= 4; $i++)
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
81 echo " <a class=\"stylesel\" href=\"?css=".$i."\">".$i."</a>\n";
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
82 ?>
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
83 <a href="javascript:pmapMakeLink()">Make link</a>
1e1f3c9967d4 Add CSS selector.
Matti Hamalainen <ccr@tnsp.org>
parents: 218
diff changeset
84 </div>
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
85 </div>
19
7d7eb223cb51 Work on layout.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
86 </div>
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
87 <div id="map"></div>
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
88 <div id="copyrights"><?php echo $dataCopyrights ?></div>
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
89 <div id="sidebar">
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
90 <div id="sidetop"></div>
275
e336d0d18c8f Remove forced style def from HTML.
Matti Hamalainen <ccr@tnsp.org>
parents: 271
diff changeset
91 <div id="sidebox">
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
92 <div id="controls"></div>
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
93 <div id="sidecontent"></div>
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
94 </div>
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
95 <div id="sidebottom"></div>
19
7d7eb223cb51 Work on layout.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
96 </div>
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
97 <div id="sidecoll">
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
98 <div id="collbuttondiv">
198
66ac93b63482 HTML5 compatibility cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 197
diff changeset
99 <a href="javascript:pmapToggleSideBar()"><img src="img/right.gif" id="collbutton" alt="Collapse or uncollapse menus"></a>
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
100 </div>
0
f8eeb66cdb07 initial commit of new map
jeskko
parents:
diff changeset
101 </div>
167
01720e81667e Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents: 165
diff changeset
102 <div id="footer">
216
ccb8e748a03f Some stylesheet and HTML work.
Matti Hamalainen <ccr@tnsp.org>
parents: 200
diff changeset
103 <div id="footercontent">&nbsp;</div>
19
7d7eb223cb51 Work on layout.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
104 </div>
200
f5aa704b1ddf Add "Make a link" feature.
Matti Hamalainen <ccr@tnsp.org>
parents: 198
diff changeset
105 <?php
262
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
106
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
107 foreach ($jsLibs as $libName)
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
108 echo " <script type=\"text/javascript\" src=\"".$libName."\"></script>\n";
250
ee5492ccba8e Add configurable base URL.
Matti Hamalainen <ccr@tnsp.org>
parents: 243
diff changeset
109
262
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
110 $jsData = array();
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
111 foreach ($jsTokens as $key)
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
112 {
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
113 if (isset($_GET[$key]) && strlen($_GET[$key]) > 0)
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
114 {
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
115 $sval = $_GET[$key];
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
116 $jsData[] = "\"".$key."\":".(is_numeric($sval) ? $sval : "\"".$sval."\"");
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
117 }
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
118 }
250
ee5492ccba8e Add configurable base URL.
Matti Hamalainen <ccr@tnsp.org>
parents: 243
diff changeset
119
262
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
120 echo
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
121 " <script type=\"text/javascript\">\n".
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
122 " pmapBaseURL = \"".$pageBaseURL."\";\n".
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
123 " pmapInitializeMap({".implode($jsData, ",")."});\n".
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
124 " </script>\n".
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
125 " </body>\n".
254343316a90 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
126 "</html>\n";
200
f5aa704b1ddf Add "Make a link" feature.
Matti Hamalainen <ccr@tnsp.org>
parents: 198
diff changeset
127 ?>