-
Notifications
You must be signed in to change notification settings - Fork 0
/
site4old.php
311 lines (259 loc) · 8.02 KB
/
site4old.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
<?php
include('includes/paths.php');
if ($_GET['type']){
switch($_GET['type']){
case 'rail':
$rail = "true";
$traffic = "false";
$weather = "false";
break;
case 'traffic':
$rail = "false";
$traffic = "true";
$weather = "false";
break;
case 'weather':
default:
$rail = "false";
$traffic = "false";
$weather = "true";
break;
}
}else{
$rail = "false";
$traffic = "false";
$weather = "true";
}
if ($_GET['ldb']){
$show_ldb = "true";
}else{
$show_ldb = "false";
}
if ($_GET['mw']){
$show_mw = "true";
}else{
$show_mw = "false";
}
if ($_GET['marker'] || $_GET['marker'] == "0"){
$marker_id = $_GET['marker'];
$markers = "true";
}else{
$marker_id = 0;
$markers = "false";
}
if ($_GET['lat']){
$zoom = "true";
$lv = $_GET['lat'];
$lnv = $_GET['lon'];
$zl = $_GET['zl'];
}else{
$zoom = "false";
$lv = 1;
$lnv = 1;
$zl = 1;
}
if ($_GET['day'])
{
$day = $_GET['day'];
}
else
{
$day = 0;
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="/styles/style4.css" />
<title>BlueGhost UK Weather, with weather.com® & backstage.bbc.co.uk</title>
<script src="http://maps.google.com/maps?file=api&v=2.x&key=<?php echo $googleKey;?>" type="text/javascript"></script>
<script src="/javascript/common4.js" type="text/javascript"></script>
<script src="/javascript/controls.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var weather = <?php echo $weather;?>;
var rail = <?php echo $rail;?>;
var traffic = <?php echo $traffic;?>;
var ldb_visible = <?php echo $show_ldb;?>;
var m_visible = <?php echo $show_mw;?>;
var day = <?php echo $day;?>;
function GetPermalink()
{
document.location.href = 'http://bbc.blueghost.co.uk/site4.php?' + GenPermalink();
}
function CreateWeatherMarker(point, img, size, name, temp, time, links ,id)
{
var img_url = "<?php echo $img_url;?>weather/"+size+"x"+size+"/"+img+".png";
var icon = makeIcon(img_url, size, size);
var marker = new GMarker(point,icon);
marker.title = name;
var title = 'Weather For '+name+'<img width="64" height="64" src="<?php echo $img_url;?>weather/64x64/'+img+'.png" alt="Weather img" />';
var text = temp+'°C @ '+time+'<br />';
text +='<strong>Featured on Weather.com</strong><br />';
var linkst ='<a href="<?php echo $bbc_s;?>'+name+'" target="_blank">More @ BBC Weather</a>';
var html = '<strong>'+name+'</strong><img src="<?php echo $img_url;?>weather/64x64/'+img+'.png" alt="Weather img" /><br /><span style="font-size:small;">'+temp+'°C @ '+time+'</span>';
html += '<br /><a href="<?php echo $bbc_s;?>'+name+'" target="_blank">More @ BBC Weather</a>';
html += '<br /><br /><strong>Featured on weather.com®:</strong>';
for (var i=0; i < links.length; i++)
{
var a_text = '<br />'+links[i];
text += a_text;
html += a_text;
}
GEvent.addListener(marker, "click", function()
{
ShowMapClickText(html);
last_open = id; //refers to mkrs[]
});
GEvent.addListener(marker, "mouseover", function()
{
ShowMapClickText(html);
});
GEvent.addListener(marker, "mouseout", function()
{
//HideMapClickText();
});
if ( (first_run) && (id == <?php echo $marker_id;?>) )
{
GEvent.trigger(marker, "click");
first_run = false;
}
return marker;
}
/* createRailMarker() moved to common4.js */
function CreateLDBMarker(point, name, code, id)
{
var marker = new GMarker(point, ldbICon);
//marker.setTooltip(name);
var request = GXmlHttp.create();
var links ='<div class="weather_link"><a href="<?php echo $ldb_site;?>'+code+'">Live Data from National Rail</a>';
GEvent.addListener(marker, "click", function()
{
map.setCenter(point, 12);
loadLDB(marker, name, code);
last_open = id; //refers to rail_markers
});
GEvent.addListener(marker, "mouseover", function()
{
ShowMapClickText('<strong>Click Icon to see Live Departures & Arrivals For '+name+'</strong>');
});
GEvent.addListener(marker, "mouseout", function()
{
//HideMapClickText();
});
if ( (first_run) && (id == <?php echo $marker_id;?>) )
{
GEvent.trigger(marker, "click");
first_run = false;
}
return marker;
}
/*loadLDB() moved to common4.js*/
/*createTrafficMarker() moved to common4.js*/
function CreateTrafficCountyMarker(html, title, lat, lon, id, id2)
{
var point = new GLatLng(lat,lon);
var marker = new GMarker(point,tICon);
var id = county_markers.length;
var info_html = document.createElement("div");
info_html.id = 'traffic_'+html+'';
info_html.className = 'weather_link';
info_html.innerHTML = '<a>'+title+'</a><br/><a href="javascript:goToTraffic(\''+html+'\', '+lat+', '+lon+', '+id2+', \''+title+'\', '+id+');" title="See Delays in '+title+'">Show Delays</a><br/><a href="javascript:zoomOut();" title="Zoom Out">Zoom Out</a>';
county_markers.push(info_html);
var title = "Traffic Warnings for "+title;
var text = 'Last Updated @ <?php echo date("D d/m H:i:s", filectime($t_dir."shropshire_tpeg_copy.xml"));?>';
GEvent.addListener(marker, "click", function()
{
marker.openInfoWindow(county_markers[id]);
last_open = id2; //refers to t_markers
});
GEvent.addListener(marker, "mouseover", function()
{
ShowMapClickText('<strong>Click Icon to see '+title+'</strong>');
});
GEvent.addListener(marker, "mouseout", function()
{
HideMapClickText();
});
GEvent.addListener(marker, "onmouseover",
function()
{
ShowMapClickText(title);
}
);
return marker;
}
function OnLoad()
{
if (GBrowserIsCompatible())
{
loc = new GLatLng(<?php echo $lat;?>, <?php echo $lon;?>);
cen = new GLatLng(<?php echo $lat;?>, <?php echo $lon;?>);
map = new GMap2(document.getElementById("weatherMap"));
map.addControl(new GLargeMapControl());
//map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.addControl(new BlueGhostBBCControl());
map.addControl(new BlueGhostStatusControl());
map.addControl(new BlueGhostCopyrightControl());
//new 2.5.8 features
map.enableContinuousZoom();
map.enableDoubleClickZoom();
//setup global map events
GlobalEvents();
if (<?php echo $zoom;?>)
{
var p = new GLatLng(<?php echo $lv;?>, <?php echo $lnv;?>);
map.setCenter(p, <?php echo $zl;?>);
}
else
{
map.setCenter(cen, 6);
}
if (<?php echo $markers;?>)
first_run = true;
if (weather)
{
SetupWeather();
}
if (rail)
{
SetupRail();
}
if (traffic)
{
SetupTraffic();
}
reload();
}//end iscompat
}//end onLoad
function SetupWeather()
{
HideExtraInfoBox();
var html = 'Weather data provided by <a href="http://www.weather.com/?prod=xoap&par=<?php echo $partnerID;?>" title="Go to weather.com" target="_blank">weather.com ®</a>';
ShowCopyText(html);
}
/*setupTraffic() moved to common4.js*/
/*setupRail() moved to common4.js*/
/*reload() moved to common.js*/
/*reloadWeather() moved to common.js*/
/*reloadRail() moved to common.js*/
/*doLDB() moved to common.js*/
/*goToTraffic moved to common4.js */
/*removeTraffic moved to common4.js*/
/*reloadTraffic() moved to common.js*/
/*goToSidebar() removed*/
//]]>
</script>
</head>
<body onLoad="OnLoad()" onUnload="UnLoad()">
<div id="weatherMap"></div>
<!--Access Keys-->
<a id="ak_w" accesskey="w" href="javascript:GoTo('weather');" title="Show Weather"></a>
<a id="ak_t" accesskey="t" href="javascript:GoTo('traffic');" title="Show Road Traffic"></a>
<a id="ak_r" accesskey="r" href="javascript:GoTo('rail');" title="Show Rail"></a>
<a id="ak_p" accesskey="p" href="javascript:GetPermalink();" title="Permalink"></a>
<a id="ak_h" accesskey="h" href="javascript:openHelp();" title="Help"></a>
<a id="ak_a" accesskey="a" href="javascript:openAbout();" title="About"></a>
</body>
</html>