Mercurial > hg > batmud > gmap2
annotate index.php @ 275:e336d0d18c8f gmap2
Remove forced style def from HTML.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 10 Sep 2014 18:04:35 +0300 |
parents | 1359bc5c53e0 |
children | 9ed3aa7ca7b5 |
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 | 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 | 10 // |
11 // Generic settings | |
12 // | |
167
01720e81667e
Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents:
165
diff
changeset
|
13 $pageCharset = "UTF-8"; |
261 | 14 $pageVersion = "(beta)"; |
183 | 15 |
16 $pageTitle1 = "BatMUD: The Age of Exiles"; | |
220 | 17 $pageTitle2 = "Google Maps Hack TNG"; |
183 | 18 $pageBy = "by Jeskko & Ggr"; |
19 $pageTitle = $pageTitle1." - ".$pageTitle2." ".$pageBy; | |
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 | 23 |
262 | 24 $jsLibs = array( |
25 "map.js", | |
26 "lib/util.js", | |
27 "lib/markerwithlabel_packed.js", | |
28 "lib/markermanager_packed.js", | |
29 "world.js", | |
30 "icons.js", | |
31 "markers.js", | |
32 "nav.js", | |
33 ); | |
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 | 36 |
37 | |
219 | 38 // |
39 // Handle CSS stuff | |
40 // | |
41 $pageCSSCookie = "gmapcss"; | |
42 if (isset($_GET["css"])) | |
43 { | |
44 $pageCSSIndex = intval($_GET["css"]); | |
45 setcookie($pageCSSCookie, $pageCSSIndex, time() + 365*24*60*60, "/"); // expire in a year | |
46 } | |
47 else | |
48 { | |
49 $pageCSSIndex = isset($_COOKIE[$pageCSSCookie]) ? intval($_COOKIE[$pageCSSCookie]) : 1; | |
50 } | |
51 $pageCSS = "css/mapstyle".$pageCSSIndex.".css"; | |
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) ? "&key=".$gmapsKey: ""). |
01720e81667e
Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents:
165
diff
changeset
|
64 "&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 | 67 " </head>\n". |
68 " <body>\n"; | |
69 | |
253 | 70 @include "urchin.inc.php"; |
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 | 75 <h1><?php echo $pageTitle1 ?></h1> |
76 <h2><?php echo $pageTitle2." v".$pageVersion ?></h2> | |
77 <div class="credits"><?php echo $pageBy ?></div> | |
219 | 78 <div class="controls"> |
79 <?php | |
80 for ($i = 1; $i <= 4; $i++) | |
81 echo " <a class=\"stylesel\" href=\"?css=".$i."\">".$i."</a>\n"; | |
82 ?> | |
83 <a href="javascript:pmapMakeLink()">Make link</a> | |
84 </div> | |
167
01720e81667e
Separate configuration variables into config.inc.php
Matti Hamalainen <ccr@tnsp.org>
parents:
165
diff
changeset
|
85 </div> |
19 | 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 | 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 | 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"> </div> |
19 | 104 </div> |
200 | 105 <?php |
262 | 106 |
107 foreach ($jsLibs as $libName) | |
108 echo " <script type=\"text/javascript\" src=\"".$libName."\"></script>\n"; | |
250 | 109 |
262 | 110 $jsData = array(); |
111 foreach ($jsTokens as $key) | |
112 { | |
113 if (isset($_GET[$key]) && strlen($_GET[$key]) > 0) | |
114 { | |
115 $sval = $_GET[$key]; | |
116 $jsData[] = "\"".$key."\":".(is_numeric($sval) ? $sval : "\"".$sval."\""); | |
117 } | |
118 } | |
250 | 119 |
262 | 120 echo |
121 " <script type=\"text/javascript\">\n". | |
122 " pmapBaseURL = \"".$pageBaseURL."\";\n". | |
123 " pmapInitializeMap({".implode($jsData, ",")."});\n". | |
124 " </script>\n". | |
125 " </body>\n". | |
126 "</html>\n"; | |
200 | 127 ?> |