Completed
Push — master ( 46434e...ad133e )
by Yannick
32:08 queued 16:03
created
highlights-table.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@  discard block
 block discarded – undo
7 7
 require_once('header.php');
8 8
 
9 9
 //calculuation for the pagination
10
-if(!isset($_GET['limit']) || $_GET['limit'] == "")
10
+if (!isset($_GET['limit']) || $_GET['limit'] == "")
11 11
 {
12 12
 	$limit_start = 0;
13 13
 	$limit_end = 25;
14 14
 	$absolute_difference = 25;
15
-}  else {
15
+} else {
16 16
 	$limit_explode = explode(",", $_GET['limit']);
17 17
 	$limit_start = $limit_explode[0];
18 18
 	$limit_end = $limit_explode[1];
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 print '<div class="table column">';	
40 40
 print '<p>'._("The table below shows the detailed information of all custom selected flights who have special aspects to it, such as unique liveries, destinations etc.").'</p>';
41 41
 
42
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
42
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
43 43
 if ($sort != '') {
44 44
 	$spotter_array = $Spotter->getSpotterDataByHighlight($limit_start.",".$absolute_difference, $sort);
45 45
 } else {
Please login to merge, or discard this patch.
date-statistics-route.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
8
-$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
8
+$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
9 9
 
10 10
 if (!empty($spotter_array))
11 11
 {
12
-	$title = sprintf(_("Most Common Routes on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
12
+	$title = sprintf(_("Most Common Routes on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
13 13
 
14 14
 	require_once('header.php');
15 15
 	print '<div class="select-item">';
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>';
28 28
 	print '<br />';
29 29
 	print '<div class="info column">';
30
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
30
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
31 31
 	print '</div>';
32 32
 
33 33
 	include('date-sub-menu.php');
34 34
 	print '<div class="column">';
35 35
 	print '<h2>'._("Most Common Routes").'</h2>';
36
-	print '<p>'.sprintf(_("The statistic below shows the most common routes on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
36
+	print '<p>'.sprintf(_("The statistic below shows the most common routes on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
37 37
 
38 38
 	$route_array = $Spotter->countAllRoutesByDate($date);
39 39
 	if (!empty($route_array))
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		print '</thead>';
51 51
 		print '<tbody>';
52 52
 		$i = 1;
53
-		foreach($route_array as $route_item)
53
+		foreach ($route_array as $route_item)
54 54
 		{
55 55
 			print '<tr>';
56 56
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
live-santa-czml.php 1 patch
Spacing   +290 added lines, -290 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 //	$output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "LOOP_STOP","step": "SYSTEM_CLOCK_MULTIPLIER"}';
28 28
 
29 29
 //	$output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
30
-$output .= ',"clock": {"currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"';
30
+$output .= ',"clock": {"currentTime" : "'.date("c", time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"';
31 31
 if (!isset($_GET['now'])) $output .= ',"interval": "'.date("Y").'-12-24T02:00:00Z/'.date("Y").'-12-25T02:00:00Z"';
32 32
 $output .= '}';
33 33
 //$output .= ',"clock": {"currentTime" : "'.date("c",time()).'","multiplier" : 300,"range" : "UNBOUNDED","step": "TICK_DEPENDENT"}';
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 if (!isset($_GET['now'])) {
60 60
 	$output .= '"epoch" : "'.date("Y").'-12-24T02:00:00Z",';
61 61
 } else {
62
-	$output .= '"epoch" : "'.date("c",time() - $globalLiveInterval).'",';
62
+	$output .= '"epoch" : "'.date("c", time() - $globalLiveInterval).'",';
63 63
 }
64 64
 //$output .= '"type": "Point",';
65 65
 //$output .= '"interpolationAlgorithm" : "LAGRANGE",';
@@ -69,581 +69,581 @@  discard block
 block discarded – undo
69 69
 $output .= '"cartographicDegrees": [';
70 70
 $i = 0;
71 71
 $output .= $i.',-114.4,82.7,150000,';
72
-$i = $i+300;
72
+$i = $i + 300;
73 73
 $output .= $i.',-173.300003,64.379997,150000,';
74
-$i = $i+300;
74
+$i = $i + 300;
75 75
 $output .= $i.',177.479995,64.75,150000,';
76
-$i = $i+300;
76
+$i = $i + 300;
77 77
 $output .= $i.',158.65,53.016667,150000,';
78
-$i = $i+300;
78
+$i = $i + 300;
79 79
 $output .= $i.',165.545318,11.626074,150000,';
80
-$i = $i+300;
80
+$i = $i + 300;
81 81
 $output .= $i.',171.1300517813333,7.07999665990053,150000,';
82
-$i = $i+300;
82
+$i = $i + 300;
83 83
 $output .= $i.',179.380004,-16.469999,150000,';
84
-$i = $i+300;
84
+$i = $i + 300;
85 85
 $output .= $i.',178.429992,-18.129999,150000,';
86
-$i = $i+300;
86
+$i = $i + 300;
87 87
 $output .= $i.',174.759994,-36.849998,150000,';
88
-$i = $i+300;
88
+$i = $i + 300;
89 89
 $output .= $i.',176.839996,-39.639999,150000,';
90
-$i = $i+300;
90
+$i = $i + 300;
91 91
 $output .= $i.',174.779998,-41.279998,150000,';
92
-$i = $i+300;
92
+$i = $i + 300;
93 93
 $output .= $i.',172.639999,-43.529998,150000,';
94
-$i = $i+300;
94
+$i = $i + 300;
95 95
 $output .= $i.',167.838199,-46.986747,150000,';
96
-$i = $i+300;
96
+$i = $i + 300;
97 97
 $output .= $i.',168.320999,-17.740391,150000,';
98
-$i = $i+300;
98
+$i = $i + 300;
99 99
 $output .= $i.',167.149993,-15.51,150000,';
100
-$i = $i+300;
100
+$i = $i + 300;
101 101
 $output .= $i.',159.910003,-9.43,150000,';
102
-$i = $i+300;
102
+$i = $i + 300;
103 103
 $output .= $i.',156.850006,-8.1,150000,';
104
-$i = $i+300;
104
+$i = $i + 300;
105 105
 $output .= $i.',158.160003,6.92,150000,';
106
-$i = $i+300;
106
+$i = $i + 300;
107 107
 $output .= $i.',150.017702,45.873311,150000,';
108
-$i = $i+300;
108
+$i = $i + 300;
109 109
 $output .= $i.',154.796487,49.429802,150000,';
110
-$i = $i+300;
110
+$i = $i + 300;
111 111
 $output .= $i.',142.7262,46.948978,150000,';
112
-$i = $i+300;
112
+$i = $i + 300;
113 113
 $output .= $i.',150.800003,59.569999,150000,';
114
-$i = $i+300;
114
+$i = $i + 300;
115 115
 $output .= $i.',135.119995,48.419998,150000,';
116
-$i = $i+300;
116
+$i = $i + 300;
117 117
 $output .= $i.',131.899993,43.130001,150000,';
118
-$i = $i+300;
118
+$i = $i + 300;
119 119
 $output .= $i.',142.212096,27.070652,150000,';
120
-$i = $i+300;
120
+$i = $i + 300;
121 121
 $output .= $i.',141.312779,24.78389,150000,';
122
-$i = $i+300;
122
+$i = $i + 300;
123 123
 $output .= $i.',144.79373,13.444305,150000,';
124
-$i = $i+300;
124
+$i = $i + 300;
125 125
 $output .= $i.',151.783334,8.45,150000,';
126
-$i = $i+300;
126
+$i = $i + 300;
127 127
 $output .= $i.',151.749999,7.416667,150000,';
128
-$i = $i+300;
128
+$i = $i + 300;
129 129
 $output .= $i.',152.160003,-4.199999,150000,';
130
-$i = $i+300;
130
+$i = $i + 300;
131 131
 $output .= $i.',146.990005,-6.719999,150000,';
132
-$i = $i+300;
132
+$i = $i + 300;
133 133
 $output .= $i.',143.211639,-9.085352,150000,';
134
-$i = $i+300;
134
+$i = $i + 300;
135 135
 $output .= $i.',146.779998,-19.26,150000,';
136
-$i = $i+300;
136
+$i = $i + 300;
137 137
 $output .= $i.',149.179992,-21.139999,150000,';
138
-$i = $i+300;
138
+$i = $i + 300;
139 139
 $output .= $i.',153.020004,-27.459999,150000,';
140
-$i = $i+300;
140
+$i = $i + 300;
141 141
 $output .= $i.',151.210006,-33.869998,150000,';
142
-$i = $i+300;
142
+$i = $i + 300;
143 143
 $output .= $i.',147.291199,-42.85088,150000,';
144
-$i = $i+300;
144
+$i = $i + 300;
145 145
 $output .= $i.',138.600006,-34.93,150000,';
146
-$i = $i+300;
146
+$i = $i + 300;
147 147
 $output .= $i.',133.869995,-23.7,150000,';
148
-$i = $i+300;
148
+$i = $i + 300;
149 149
 $output .= $i.',130.850006,-12.43,150000,';
150
-$i = $i+300;
150
+$i = $i + 300;
151 151
 $output .= $i.',143.62,-3.56,150000,';
152
-$i = $i+300;
152
+$i = $i + 300;
153 153
 $output .= $i.',134.5552,7.3608,150000,';
154
-$i = $i+300;
154
+$i = $i + 300;
155 155
 $output .= $i.',135.169998,34.68,150000,';
156
-$i = $i+300;
156
+$i = $i + 300;
157 157
 $output .= $i.',138.690002,35.169998,150000,';
158
-$i = $i+300;
158
+$i = $i + 300;
159 159
 $output .= $i.',139.770004,35.669998,150000,';
160
-$i = $i+300;
160
+$i = $i + 300;
161 161
 $output .= $i.',140.740005,40.830001,150000,';
162
-$i = $i+300;
162
+$i = $i + 300;
163 163
 $output .= $i.',128.600006,35.869998,150000,';
164
-$i = $i+300;
164
+$i = $i + 300;
165 165
 $output .= $i.',125.925925,38.950981,150000,';
166
-$i = $i+300;
166
+$i = $i + 300;
167 167
 $output .= $i.',129.771118,62.093056,150000,';
168
-$i = $i+300;
168
+$i = $i + 300;
169 169
 $output .= $i.',104.239997,52.330001,150000,';
170
-$i = $i+300;
170
+$i = $i + 300;
171 171
 $output .= $i.',114.5056,48.060478,150000,';
172
-$i = $i+300;
172
+$i = $i + 300;
173 173
 $output .= $i.',106.580001,29.569999,150000,';
174
-$i = $i+300;
174
+$i = $i + 300;
175 175
 $output .= $i.',121.470001,31.229999,150000,';
176
-$i = $i+300;
176
+$i = $i + 300;
177 177
 $output .= $i.',113.25,23.12,150000,';
178
-$i = $i+300;
178
+$i = $i + 300;
179 179
 $output .= $i.',114.177465,22.307184,150000,';
180
-$i = $i+300;
180
+$i = $i + 300;
181 181
 $output .= $i.',121.639999,18.36,150000,';
182
-$i = $i+300;
182
+$i = $i + 300;
183 183
 $output .= $i.',122.080001,6.92,150000,';
184
-$i = $i+300;
184
+$i = $i + 300;
185 185
 $output .= $i.',114.639999,4.809999,150000,';
186
-$i = $i+300;
186
+$i = $i + 300;
187 187
 $output .= $i.',119.412399,-5.152193,150000,';
188
-$i = $i+300;
188
+$i = $i + 300;
189 189
 $output .= $i.',122.230003,-17.959999,150000,';
190
-$i = $i+300;
190
+$i = $i + 300;
191 191
 $output .= $i.',115.839996,-31.959999,150000,';
192
-$i = $i+300;
192
+$i = $i + 300;
193 193
 $output .= $i.',105.680687,-10.428593,150000,';
194
-$i = $i+300;
194
+$i = $i + 300;
195 195
 $output .= $i.',104.75,-2.99,150000,';
196
-$i = $i+300;
196
+$i = $i + 300;
197 197
 $output .= $i.',113.029998,3.17,150000,';
198
-$i = $i+300;
198
+$i = $i + 300;
199 199
 $output .= $i.',100.720001,4.86,150000,';
200
-$i = $i+300;
200
+$i = $i + 300;
201 201
 $output .= $i.',104.18,10.609999,150000,';
202
-$i = $i+300;
202
+$i = $i + 300;
203 203
 $output .= $i.',103.864403,13.36866,150000,';
204
-$i = $i+300;
204
+$i = $i + 300;
205 205
 $output .= $i.',99.330001,9.14,150000,';
206
-$i = $i+300;
206
+$i = $i + 300;
207 207
 $output .= $i.',105.073303,18.30217,150000,';
208
-$i = $i+300;
208
+$i = $i + 300;
209 209
 $output .= $i.',91.132088,29.6507,150000,';
210
-$i = $i+300;
210
+$i = $i + 300;
211 211
 $output .= $i.',116.477651,40.332809,150000,';
212
-$i = $i+300;
212
+$i = $i + 300;
213 213
 $output .= $i.',93.059997,56.02,150000,';
214
-$i = $i+300;
214
+$i = $i + 300;
215 215
 $output .= $i.',86.18,69.410003,150000,';
216
-$i = $i+300;
216
+$i = $i + 300;
217 217
 $output .= $i.',88.202881,69.315422,150000,';
218
-$i = $i+300;
218
+$i = $i + 300;
219 219
 $output .= $i.',73.400001,55,150000,';
220
-$i = $i+300;
220
+$i = $i + 300;
221 221
 $output .= $i.',76.949996,52.299999,150000,';
222
-$i = $i+300;
222
+$i = $i + 300;
223 223
 $output .= $i.',78.379997,42.490001,150000,';
224
-$i = $i+300;
224
+$i = $i + 300;
225 225
 $output .= $i.',69.779998,37.919998,150000,';
226
-$i = $i+300;
226
+$i = $i + 300;
227 227
 $output .= $i.',86.933333,27.983333,150000,';
228
-$i = $i+300;
228
+$i = $i + 300;
229 229
 $output .= $i.',84.870002,27.02,150000,';
230
-$i = $i+300;
230
+$i = $i + 300;
231 231
 $output .= $i.',88.36,22.569999,150000,';
232
-$i = $i+300;
232
+$i = $i + 300;
233 233
 $output .= $i.',90.389999,23.7,150000,';
234
-$i = $i+300;
234
+$i = $i + 300;
235 235
 $output .= $i.',97.04,20.78,150000,';
236
-$i = $i+300;
236
+$i = $i + 300;
237 237
 $output .= $i.',92.762917,11.66857,150000,';
238
-$i = $i+300;
238
+$i = $i + 300;
239 239
 $output .= $i.',50.23720550537109,-46.10261535644531,150000,';
240
-$i = $i+300;
240
+$i = $i + 300;
241 241
 $output .= $i.',72.422489,-7.336367,150000,';
242
-$i = $i+300;
242
+$i = $i + 300;
243 243
 $output .= $i.',73.510915,4.174199,150000,';
244
-$i = $i+300;
244
+$i = $i + 300;
245 245
 $output .= $i.',81.050003,6.989999,150000,';
246
-$i = $i+300;
246
+$i = $i + 300;
247 247
 $output .= $i.',72.819999,18.959999,150000,';
248
-$i = $i+300;
248
+$i = $i + 300;
249 249
 $output .= $i.',78.042222,27.174167,150000,';
250
-$i = $i+300;
250
+$i = $i + 300;
251 251
 $output .= $i.',71.449996,30.2,150000,';
252
-$i = $i+300;
252
+$i = $i + 300;
253 253
 $output .= $i.',67.109993,36.703819,150000,';
254
-$i = $i+300;
254
+$i = $i + 300;
255 255
 $output .= $i.',54.36,39.509998,150000,';
256
-$i = $i+300;
256
+$i = $i + 300;
257 257
 $output .= $i.',63.726529,40.214486,150000,';
258
-$i = $i+300;
258
+$i = $i + 300;
259 259
 $output .= $i.',58.853439,48.251126,150000,';
260
-$i = $i+300;
260
+$i = $i + 300;
261 261
 $output .= $i.',56.23246,58.00024,150000,';
262
-$i = $i+300;
262
+$i = $i + 300;
263 263
 $output .= $i.',49.659999,58.599998,150000,';
264
-$i = $i+300;
264
+$i = $i + 300;
265 265
 $output .= $i.',50.150001,53.2,150000,';
266
-$i = $i+300;
266
+$i = $i + 300;
267 267
 $output .= $i.',44.11,41.979999,150000,';
268
-$i = $i+300;
268
+$i = $i + 300;
269 269
 $output .= $i.',49.893226,40.38344,150000,';
270
-$i = $i+300;
270
+$i = $i + 300;
271 271
 $output .= $i.',44.75,40.5,150000,';
272
-$i = $i+300;
272
+$i = $i + 300;
273 273
 $output .= $i.',50.95,34.650001,150000,';
274
-$i = $i+300;
274
+$i = $i + 300;
275 275
 $output .= $i.',56.27433,27.18717,150000,';
276
-$i = $i+300;
276
+$i = $i + 300;
277 277
 $output .= $i.',54.989491,25.005817,150000,';
278
-$i = $i+300;
278
+$i = $i + 300;
279 279
 $output .= $i.',59.549999,22.569999,150000,';
280
-$i = $i+300;
280
+$i = $i + 300;
281 281
 $output .= $i.',47.58318996007591,-9.722414273737707,150000,';
282
-$i = $i+300;
282
+$i = $i + 300;
283 283
 $output .= $i.',57.471008,-20.26026,150000,';
284
-$i = $i+300;
284
+$i = $i + 300;
285 285
 $output .= $i.',37.946460723877,-46.6428451538086,150000,';
286
-$i = $i+300;
286
+$i = $i + 300;
287 287
 $output .= $i.',53,-67.5,150000,';
288
-$i = $i+300;
288
+$i = $i + 300;
289 289
 $output .= $i.',46.99004,-25.03233,150000,';
290
-$i = $i+300;
290
+$i = $i + 300;
291 291
 $output .= $i.',46.310001,-15.72,150000,';
292
-$i = $i+300;
292
+$i = $i + 300;
293 293
 $output .= $i.',44.41203117370608,-12.22338294982911,150000,';
294
-$i = $i+300;
294
+$i = $i + 300;
295 295
 $output .= $i.',39.3822,-6.097406,150000,';
296
-$i = $i+300;
296
+$i = $i + 300;
297 297
 $output .= $i.',39.659999,-4.039999,150000,';
298
-$i = $i+300;
298
+$i = $i + 300;
299 299
 $output .= $i.',40.033333,7.916667,150000,';
300
-$i = $i+300;
300
+$i = $i + 300;
301 301
 $output .= $i.',42.549999,16.899999,150000,';
302
-$i = $i+300;
302
+$i = $i + 300;
303 303
 $output .= $i.',43.970001,26.37,150000,';
304
-$i = $i+300;
304
+$i = $i + 300;
305 305
 $output .= $i.',41.12,30.455,150000,';
306
-$i = $i+300;
306
+$i = $i + 300;
307 307
 $output .= $i.',38.278671,34.547951,150000,';
308
-$i = $i+300;
308
+$i = $i + 300;
309 309
 $output .= $i.',37.619998,55.75,150000,';
310
-$i = $i+300;
310
+$i = $i + 300;
311 311
 $output .= $i.',30.453329,59.951889,150000,';
312
-$i = $i+300;
312
+$i = $i + 300;
313 313
 $output .= $i.',23.12,63.84,150000,';
314
-$i = $i+300;
314
+$i = $i + 300;
315 315
 $output .= $i.',26.709999,58.380001,150000,';
316
-$i = $i+300;
316
+$i = $i + 300;
317 317
 $output .= $i.',25.42,57.549999,150000,';
318
-$i = $i+300;
318
+$i = $i + 300;
319 319
 $output .= $i.',23.319999,55.93,150000,';
320
-$i = $i+300;
320
+$i = $i + 300;
321 321
 $output .= $i.',26.1,52.119998,150000,';
322
-$i = $i+300;
322
+$i = $i + 300;
323 323
 $output .= $i.',32.259998,48.5,150000,';
324
-$i = $i+300;
324
+$i = $i + 300;
325 325
 $output .= $i.',28.829999,47.029998,150000,';
326
-$i = $i+300;
326
+$i = $i + 300;
327 327
 $output .= $i.',25.61,45.659999,150000,';
328
-$i = $i+300;
328
+$i = $i + 300;
329 329
 $output .= $i.',27.469999,42.509998,150000,';
330
-$i = $i+300;
330
+$i = $i + 300;
331 331
 $output .= $i.',23.729999,37.979999,150000,';
332
-$i = $i+300;
332
+$i = $i + 300;
333 333
 $output .= $i.',27.149999,38.43,150000,';
334
-$i = $i+300;
334
+$i = $i + 300;
335 335
 $output .= $i.',31.132659,29.977088,150000,';
336
-$i = $i+300;
336
+$i = $i + 300;
337 337
 $output .= $i.',32.659999,13.17,150000,';
338
-$i = $i+300;
338
+$i = $i + 300;
339 339
 $output .= $i.',33.599998,1.71,150000,';
340
-$i = $i+300;
340
+$i = $i + 300;
341 341
 $output .= $i.',25.92,-2.95,150000,';
342
-$i = $i+300;
342
+$i = $i + 300;
343 343
 $output .= $i.',28.45,-14.439999,150000,';
344
-$i = $i+300;
344
+$i = $i + 300;
345 345
 $output .= $i.',30.819999,-20.059999,150000,';
346
-$i = $i+300;
346
+$i = $i + 300;
347 347
 $output .= $i.',21.639999,-21.7,150000,';
348
-$i = $i+300;
348
+$i = $i + 300;
349 349
 $output .= $i.',25.59,-33.959999,150000,';
350
-$i = $i+300;
350
+$i = $i + 300;
351 351
 $output .= $i.',18.129999,-26.579999,150000,';
352
-$i = $i+300;
352
+$i = $i + 300;
353 353
 $output .= $i.',13.767777,-10.722417,150000,';
354
-$i = $i+300;
354
+$i = $i + 300;
355 355
 $output .= $i.',10.13,-0.15,150000,';
356
-$i = $i+300;
356
+$i = $i + 300;
357 357
 $output .= $i.',20.67,5.76,150000,';
358
-$i = $i+300;
358
+$i = $i + 300;
359 359
 $output .= $i.',9.71,4.059999,150000,';
360
-$i = $i+300;
360
+$i = $i + 300;
361 361
 $output .= $i.',7.44,10.52,150000,';
362
-$i = $i+300;
362
+$i = $i + 300;
363 363
 $output .= $i.',18.69,12.189999,150000,';
364
-$i = $i+300;
364
+$i = $i + 300;
365 365
 $output .= $i.',7.98,17,150000,';
366
-$i = $i+300;
366
+$i = $i + 300;
367 367
 $output .= $i.',14.42,27.069999,150000,';
368
-$i = $i+300;
368
+$i = $i + 300;
369 369
 $output .= $i.',3.678539,32.489059,150000,';
370
-$i = $i+300;
370
+$i = $i + 300;
371 371
 $output .= $i.',-7.619999,33.599998,150000,';
372
-$i = $i+300;
372
+$i = $i + 300;
373 373
 $output .= $i.',13.611066,38.129963,150000,';
374
-$i = $i+300;
374
+$i = $i + 300;
375 375
 $output .= $i.',12.482323,41.895466,150000,';
376
-$i = $i+300;
376
+$i = $i + 300;
377 377
 $output .= $i.',17.189752,44.763891,150000,';
378
-$i = $i+300;
378
+$i = $i + 300;
379 379
 $output .= $i.',16.45,43.509998,150000,';
380
-$i = $i+300;
380
+$i = $i + 300;
381 381
 $output .= $i.',14.51,46.060001,150000,';
382
-$i = $i+300;
382
+$i = $i + 300;
383 383
 $output .= $i.',21.629999,47.54,150000,';
384
-$i = $i+300;
384
+$i = $i + 300;
385 385
 $output .= $i.',16.37,48.220001,150000,';
386
-$i = $i+300;
386
+$i = $i + 300;
387 387
 $output .= $i.',10.736111,47.554444,150000,';
388
-$i = $i+300;
388
+$i = $i + 300;
389 389
 $output .= $i.',14.43,50.080001,150000,';
390
-$i = $i+300;
390
+$i = $i + 300;
391 391
 $output .= $i.',17.129999,48.159999,150000,';
392
-$i = $i+300;
392
+$i = $i + 300;
393 393
 $output .= $i.',22.569999,51.240001,150000,';
394
-$i = $i+300;
394
+$i = $i + 300;
395 395
 $output .= $i.',13.411895,52.523781,150000,';
396
-$i = $i+300;
396
+$i = $i + 300;
397 397
 $output .= $i.',10.039999,56.470001,150000,';
398
-$i = $i+300;
398
+$i = $i + 300;
399 399
 $output .= $i.',13.02,55.61,150000,';
400
-$i = $i+300;
400
+$i = $i + 300;
401 401
 $output .= $i.',17.329999,62.400001,150000,';
402
-$i = $i+300;
402
+$i = $i + 300;
403 403
 $output .= $i.',14.229999,78.059997,150000,';
404
-$i = $i+300;
404
+$i = $i + 300;
405 405
 $output .= $i.',10.399999,63.439998,150000,';
406
-$i = $i+300;
406
+$i = $i + 300;
407 407
 $output .= $i.',2.350966,48.856558,150000,';
408
-$i = $i+300;
408
+$i = $i + 300;
409 409
 $output .= $i.',7.42,43.75,150000,';
410
-$i = $i+300;
410
+$i = $i + 300;
411 411
 $output .= $i.',1.57,42.54,150000,';
412
-$i = $i+300;
412
+$i = $i + 300;
413 413
 $output .= $i.',-0.991293,37.605651,150000,';
414
-$i = $i+300;
414
+$i = $i + 300;
415 415
 $output .= $i.',-7.429999,39.29,150000,';
416
-$i = $i+300;
416
+$i = $i + 300;
417 417
 $output .= $i.',-11.4053,16.5889,150000,';
418
-$i = $i+300;
418
+$i = $i + 300;
419 419
 $output .= $i.',-3.009999,16.78,150000,';
420
-$i = $i+300;
420
+$i = $i + 300;
421 421
 $output .= $i.',-5.36008,5.83885,150000,';
422
-$i = $i+300;
422
+$i = $i + 300;
423 423
 $output .= $i.',-12.3,11.319999,150000,';
424
-$i = $i+300;
424
+$i = $i + 300;
425 425
 $output .= $i.',-16.239999,12.829999,150000,';
426
-$i = $i+300;
426
+$i = $i + 300;
427 427
 $output .= $i.',-16.2507,28.457661,150000,';
428
-$i = $i+300;
428
+$i = $i + 300;
429 429
 $output .= $i.',-0.126197,51.500197,150000,';
430
-$i = $i+300;
430
+$i = $i + 300;
431 431
 $output .= $i.',-2.968111,56.461428,150000,';
432
-$i = $i+300;
432
+$i = $i + 300;
433 433
 $output .= $i.',-7.308429,54.998539,150000,';
434
-$i = $i+300;
434
+$i = $i + 300;
435 435
 $output .= $i.',-8.92,52.7,150000,';
436
-$i = $i+300;
436
+$i = $i + 300;
437 437
 $output .= $i.',-19.000959,63.427502,150000,';
438
-$i = $i+300;
438
+$i = $i + 300;
439 439
 $output .= $i.',-28.364049911499,38.47212219238281,150000,';
440
-$i = $i+300;
440
+$i = $i + 300;
441 441
 $output .= $i.',-23.76,15.279999,150000,';
442
-$i = $i+300;
442
+$i = $i + 300;
443 443
 $output .= $i.',-36.511219,-54.274151,150000,';
444
-$i = $i+300;
444
+$i = $i + 300;
445 445
 $output .= $i.',-58.979999,-51.830001,150000,';
446
-$i = $i+300;
446
+$i = $i + 300;
447 447
 $output .= $i.',-64.190002,-31.399999,150000,';
448
-$i = $i+300;
448
+$i = $i + 300;
449 449
 $output .= $i.',-54.18,-32.36,150000,';
450
-$i = $i+300;
450
+$i = $i + 300;
451 451
 $output .= $i.',-43.2,-22.909999,150000,';
452
-$i = $i+300;
452
+$i = $i + 300;
453 453
 $output .= $i.',-37.333333,65.666667,150000,';
454
-$i = $i+300;
454
+$i = $i + 300;
455 455
 $output .= $i.',-69.345131,77.48262,150000,';
456
-$i = $i+300;
456
+$i = $i + 300;
457 457
 $output .= $i.',-55.65049,48.929001,150000,';
458
-$i = $i+300;
458
+$i = $i + 300;
459 459
 $output .= $i.',-63.530471,44.681263,150000,';
460
-$i = $i+300;
460
+$i = $i + 300;
461 461
 $output .= $i.',-66.647818,45.957319,150000,';
462
-$i = $i+300;
462
+$i = $i + 300;
463 463
 $output .= $i.',-59.630001,13.18,150000,';
464
-$i = $i+300;
464
+$i = $i + 300;
465 465
 $output .= $i.',-61.744888,12.06526,150000,';
466
-$i = $i+300;
466
+$i = $i + 300;
467 467
 $output .= $i.',-61.171322,10.30501,150000,';
468
-$i = $i+300;
468
+$i = $i + 300;
469 469
 $output .= $i.',-67.470001,7.9,150000,';
470
-$i = $i+300;
470
+$i = $i + 300;
471 471
 $output .= $i.',-58.159999,6.789999,150000,';
472
-$i = $i+300;
472
+$i = $i + 300;
473 473
 $output .= $i.',-60.02,-3.119999,150000,';
474
-$i = $i+300;
474
+$i = $i + 300;
475 475
 $output .= $i.',-56.45,-14.409999,150000,';
476
-$i = $i+300;
476
+$i = $i + 300;
477 477
 $output .= $i.',-65.260002,-19.059999,150000,';
478
-$i = $i+300;
478
+$i = $i + 300;
479 479
 $output .= $i.',-56.636503,-24.158676,150000,';
480
-$i = $i+300;
480
+$i = $i + 300;
481 481
 $output .= $i.',-56.509998,-33.409999,150000,';
482
-$i = $i+300;
482
+$i = $i + 300;
483 483
 $output .= $i.',-68.523514,-50.021889,150000,';
484
-$i = $i+300;
484
+$i = $i + 300;
485 485
 $output .= $i.',-72.505127,-51.732529,150000,';
486
-$i = $i+300;
486
+$i = $i + 300;
487 487
 $output .= $i.',-71.639999,-33.04,150000,';
488
-$i = $i+300;
488
+$i = $i + 300;
489 489
 $output .= $i.',-72.515821,-13.162849,150000,';
490
-$i = $i+300;
490
+$i = $i + 300;
491 491
 $output .= $i.',-76.970001,-6.03,150000,';
492
-$i = $i+300;
492
+$i = $i + 300;
493 493
 $output .= $i.',-78.620002,-1.24,150000,';
494
-$i = $i+300;
494
+$i = $i + 300;
495 495
 $output .= $i.',-76.739997,8.1,150000,';
496
-$i = $i+300;
496
+$i = $i + 300;
497 497
 $output .= $i.',-79.879913,9.368985,150000,';
498
-$i = $i+300;
498
+$i = $i + 300;
499 499
 $output .= $i.',-76.949996,18,150000,';
500
-$i = $i+300;
500
+$i = $i + 300;
501 501
 $output .= $i.',-72.699996,19.11,150000,';
502
-$i = $i+300;
502
+$i = $i + 300;
503 503
 $output .= $i.',-75.220001,20.149999,150000,';
504
-$i = $i+300;
504
+$i = $i + 300;
505 505
 $output .= $i.',-73.682953,20.95027,150000,';
506
-$i = $i+300;
506
+$i = $i + 300;
507 507
 $output .= $i.',-80.605,28.405556,150000,';
508
-$i = $i+300;
508
+$i = $i + 300;
509 509
 $output .= $i.',-84.388056,33.748889,150000,';
510
-$i = $i+300;
510
+$i = $i + 300;
511 511
 $output .= $i.',-79.931111,32.776389,150000,';
512
-$i = $i+300;
512
+$i = $i + 300;
513 513
 $output .= $i.',-83.920833,35.960556,150000,';
514
-$i = $i+300;
514
+$i = $i + 300;
515 515
 $output .= $i.',-84.500278,38.049167,150000,';
516
-$i = $i+300;
516
+$i = $i + 300;
517 517
 $output .= $i.',-77.460833,38.303056,150000,';
518
-$i = $i+300;
518
+$i = $i + 300;
519 519
 $output .= $i.',-82.515556,40.758333,150000,';
520
-$i = $i+300;
520
+$i = $i + 300;
521 521
 $output .= $i.',-83.045833,42.331389,150000,';
522
-$i = $i+300;
522
+$i = $i + 300;
523 523
 $output .= $i.',-74.006389,40.714167,150000,';
524
-$i = $i+300;
524
+$i = $i + 300;
525 525
 $output .= $i.',-71.802778,42.2625,150000,';
526
-$i = $i+300;
526
+$i = $i + 300;
527 527
 $output .= $i.',-72.973056,43.610556,150000,';
528
-$i = $i+300;
528
+$i = $i + 300;
529 529
 $output .= $i.',-68.0125,46.860556,150000,';
530
-$i = $i+300;
530
+$i = $i + 300;
531 531
 $output .= $i.',-72.581779,46.357398,150000,';
532
-$i = $i+300;
532
+$i = $i + 300;
533 533
 $output .= $i.',-78.53632621543271,52.72737572958358,150000,';
534
-$i = $i+300;
534
+$i = $i + 300;
535 535
 $output .= $i.',-66.921779,52.940118,150000,';
536
-$i = $i+300;
536
+$i = $i + 300;
537 537
 $output .= $i.',-75.652573,62.201069,150000,';
538
-$i = $i+300;
538
+$i = $i + 300;
539 539
 $output .= $i.',-64.865257,67.935417,150000,';
540
-$i = $i+300;
540
+$i = $i + 300;
541 541
 $output .= $i.',-94.969443,74.716943,150000,';
542
-$i = $i+300;
542
+$i = $i + 300;
543 543
 $output .= $i.',-82.793909,76.395731,150000,';
544
-$i = $i+300;
544
+$i = $i + 300;
545 545
 $output .= $i.',-97.49276733398439,69.18675994873048,150000,';
546
-$i = $i+300;
546
+$i = $i + 300;
547 547
 $output .= $i.',-90.5537452697754,63.36753463745121,150000,';
548
-$i = $i+300;
548
+$i = $i + 300;
549 549
 $output .= $i.',-89.270113,48.412197,150000,';
550
-$i = $i+300;
550
+$i = $i + 300;
551 551
 $output .= $i.',-79.604159,43.68731,150000,';
552
-$i = $i+300;
552
+$i = $i + 300;
553 553
 $output .= $i.',-89.401111,43.073056,150000,';
554
-$i = $i+300;
554
+$i = $i + 300;
555 555
 $output .= $i.',-94.633611,42.395278,150000,';
556
-$i = $i+300;
556
+$i = $i + 300;
557 557
 $output .= $i.',-89.588889,40.693611,150000,';
558
-$i = $i+300;
558
+$i = $i + 300;
559 559
 $output .= $i.',-90.197778,38.627222,150000,';
560
-$i = $i+300;
560
+$i = $i + 300;
561 561
 $output .= $i.',-90.704167,35.842222,150000,';
562
-$i = $i+300;
562
+$i = $i + 300;
563 563
 $output .= $i.',-91.061667,33.41,150000,';
564
-$i = $i+300;
564
+$i = $i + 300;
565 565
 $output .= $i.',-92.445,31.311111,150000,';
566
-$i = $i+300;
566
+$i = $i + 300;
567 567
 $output .= $i.',-98.493333,29.423889,150000,';
568
-$i = $i+300;
568
+$i = $i + 300;
569 569
 $output .= $i.',-103.349998,20.67,150000,';
570
-$i = $i+300;
570
+$i = $i + 300;
571 571
 $output .= $i.',-86.830001,21.17,150000,';
572
-$i = $i+300;
572
+$i = $i + 300;
573 573
 $output .= $i.',-89.529998,14.979999,150000,';
574
-$i = $i+300;
574
+$i = $i + 300;
575 575
 $output .= $i.',-87.449996,13.42,150000,';
576
-$i = $i+300;
576
+$i = $i + 300;
577 577
 $output .= $i.',-83.709999,9.369999,150000,';
578
-$i = $i+300;
578
+$i = $i + 300;
579 579
 $output .= $i.',-91.5149765,-0.3781085,150000,';
580
-$i = $i+300;
580
+$i = $i + 300;
581 581
 $output .= $i.',-109.425598,-27.1546,150000,';
582
-$i = $i+300;
582
+$i = $i + 300;
583 583
 $output .= $i.',-109.9142,22.88093,150000,';
584
-$i = $i+300;
584
+$i = $i + 300;
585 585
 $output .= $i.',-110.910003,27.92,150000,';
586
-$i = $i+300;
586
+$i = $i + 300;
587 587
 $output .= $i.',-110.925833,32.221667,150000,';
588
-$i = $i+300;
588
+$i = $i + 300;
589 589
 $output .= $i.',-104.526667,33.395,150000,';
590
-$i = $i+300;
590
+$i = $i + 300;
591 591
 $output .= $i.',-113.061111,37.6775,150000,';
592
-$i = $i+300;
592
+$i = $i + 300;
593 593
 $output .= $i.',-104.820833,38.833889,150000,';
594
-$i = $i+300;
594
+$i = $i + 300;
595 595
 $output .= $i.',-108.73,42.833056,150000,';
596
-$i = $i+300;
596
+$i = $i + 300;
597 597
 $output .= $i.',-113.895,45.175833,150000,';
598
-$i = $i+300;
598
+$i = $i + 300;
599 599
 $output .= $i.',-113.993056,46.872222,150000,';
600
-$i = $i+300;
600
+$i = $i + 300;
601 601
 $output .= $i.',-114.080796,51.039877,150000,';
602
-$i = $i+300;
602
+$i = $i + 300;
603 603
 $output .= $i.',-102.3889594419702,57.15883691318781,150000,';
604
-$i = $i+300;
604
+$i = $i + 300;
605 605
 $output .= $i.',-118.0333,66.0833,150000,';
606
-$i = $i+300;
606
+$i = $i + 300;
607 607
 $output .= $i.',-140.55,64.45,150000,';
608
-$i = $i+300;
608
+$i = $i + 300;
609 609
 $output .= $i.',-122.690386,58.80667,150000,';
610
-$i = $i+300;
610
+$i = $i + 300;
611 611
 $output .= $i.',-121.92985,50.686341,150000,';
612
-$i = $i+300;
612
+$i = $i + 300;
613 613
 $output .= $i.',-122.330833,47.606389,150000,';
614
-$i = $i+300;
614
+$i = $i + 300;
615 615
 $output .= $i.',-122.274167,47.564167,150000,';
616
-$i = $i+300;
616
+$i = $i + 300;
617 617
 $output .= $i.',-122.968503,45.309901,150000,';
618
-$i = $i+300;
618
+$i = $i + 300;
619 619
 $output .= $i.',-122.874444,42.326667,150000,';
620
-$i = $i+300;
620
+$i = $i + 300;
621 621
 $output .= $i.',-122.390556,40.586667,150000,';
622
-$i = $i+300;
622
+$i = $i + 300;
623 623
 $output .= $i.',-117.068611,39.493333,150000,';
624
-$i = $i+300;
624
+$i = $i + 300;
625 625
 $output .= $i.',-122.418333,37.775,150000,';
626
-$i = $i+300;
626
+$i = $i + 300;
627 627
 $output .= $i.',-117.108333,34.207778,150000,';
628
-$i = $i+300;
628
+$i = $i + 300;
629 629
 $output .= $i.',-116.544444,33.830278,150000,';
630
-$i = $i+300;
630
+$i = $i + 300;
631 631
 $output .= $i.',-117.156389,32.715278,150000,';
632
-$i = $i+300;
632
+$i = $i + 300;
633 633
 $output .= $i.',-149.891667,61.218333,150000,';
634
-$i = $i+300;
634
+$i = $i + 300;
635 635
 $output .= $i.',-155.566389,62.948889,150000,';
636
-$i = $i+300;
636
+$i = $i + 300;
637 637
 $output .= $i.',-165.406389,64.501111,150000,';
638
-$i = $i+300;
638
+$i = $i + 300;
639 639
 $output .= $i.',-155.09,19.729722,150000,';
640
-$i = $i+300;
640
+$i = $i + 300;
641 641
 $output .= $i.',-156.337974,20.804858,150000,';
642
-$i = $i+300;
642
+$i = $i + 300;
643 643
 $output .= $i.',-157.043209,21.141189,150000,';
644
-$i = $i+300;
644
+$i = $i + 300;
645 645
 $output .= $i.',-158.009167,21.386667,150000,';
646
-$i = $i+300;
646
+$i = $i + 300;
647 647
 $output .= $i.',-159.371111,21.981111,150000';
648 648
 
649 649
 $output .= ']}}';
Please login to merge, or discard this patch.
live-santa-geojson.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 $timearray = array();
11 11
 if (isset($_GET['now'])) $begin = time();
12 12
 else $begin = strtotime(date("Y").'-12-24T02:00:00Z');
13
-for ($i =0; $i <= 288; $i++) {
13
+for ($i = 0; $i <= 288; $i++) {
14 14
 	$timearray[] = ($begin + $i*300)*1000;
15 15
 }
16
-$output = '{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Name":"santaclaus","time": ['.implode(',',$timearray).']},"geometry":{"type":"MultiPoint","coordinates":[[-114.4,82.7,0],[-173.300003,64.379997,0],[177.479995,64.75,0],[158.65,53.016667,0],[165.545318,11.626074,0],[171.1300517813333,7.07999665990053,0],[179.380004,-16.469999,0],[178.429992,-18.129999,0],[174.759994,-36.849998,0],[176.839996,-39.639999,0],[174.779998,-41.279998,0],[172.639999,-43.529998,0],[167.838199,-46.986747,0],[168.320999,-17.740391,0],[167.149993,-15.51,0],[159.910003,-9.43,0],[156.850006,-8.1,0],[158.160003,6.92,0],[150.017702,45.873311,0],[154.796487,49.429802,0],[142.7262,46.948978,0],[150.800003,59.569999,0],[135.119995,48.419998,0],[131.899993,43.130001,0],[142.212096,27.070652,0],[141.312779,24.78389,0],[144.79373,13.444305,0],[151.783334,8.45,0],[151.749999,7.416667,0],[152.160003,-4.199999,0],[146.990005,-6.719999,0],[143.211639,-9.085352,0],[146.779998,-19.26,0],[149.179992,-21.139999,0],[153.020004,-27.459999,0],[151.210006,-33.869998,0],[147.291199,-42.85088,0],[138.600006,-34.93,0],[133.869995,-23.7,0],[130.850006,-12.43,0],[143.62,-3.56,0],[134.5552,7.3608,0],[135.169998,34.68,0],[138.690002,35.169998,0],[139.770004,35.669998,0],[140.740005,40.830001,0],[128.600006,35.869998,0],[125.925925,38.950981,0],[129.771118,62.093056,0],[104.239997,52.330001,0],[114.5056,48.060478,0],[106.580001,29.569999,0],[121.470001,31.229999,0],[113.25,23.12,0],[114.177465,22.307184,0],[121.639999,18.36,0],[122.080001,6.92,0],[114.639999,4.809999,0],[119.412399,-5.152193,0],[122.230003,-17.959999,0],[115.839996,-31.959999,0],[105.680687,-10.428593,0],[104.75,-2.99,0],[113.029998,3.17,0],[100.720001,4.86,0],[104.18,10.609999,0],[103.864403,13.36866,0],[99.330001,9.14,0],[105.073303,18.30217,0],[91.132088,29.6507,0],[116.477651,40.332809,0],[93.059997,56.02,0],[86.18,69.410003,0],[88.202881,69.315422,0],[73.400001,55,0],[76.949996,52.299999,0],[78.379997,42.490001,0],[69.779998,37.919998,0],[86.933333,27.983333,0],[84.870002,27.02,0],[88.36,22.569999,0],[90.389999,23.7,0],[97.04,20.78,0],[92.762917,11.66857,0],[50.23720550537109,-46.10261535644531,0],[72.422489,-7.336367,0],[73.510915,4.174199,0],[81.050003,6.989999,0],[72.819999,18.959999,0],[78.042222,27.174167,0],[71.449996,30.2,0],[67.109993,36.703819,0],[54.36,39.509998,0],[63.726529,40.214486,0],[58.853439,48.251126,0],[56.23246,58.00024,0],[49.659999,58.599998,0],[50.150001,53.2,0],[44.11,41.979999,0],[49.893226,40.38344,0],[44.75,40.5,0],[50.95,34.650001,0],[56.27433,27.18717,0],[54.989491,25.005817,0],[59.549999,22.569999,0],[47.58318996007591,-9.722414273737707,0],[57.471008,-20.26026,0],[37.946460723877,-46.6428451538086,0],[53,-67.5,0],[46.99004,-25.03233,0],[46.310001,-15.72,0],[44.41203117370608,-12.22338294982911,0],[39.3822,-6.097406,0],[39.659999,-4.039999,0],[40.033333,7.916667,0],[42.549999,16.899999,0],[43.970001,26.37,0],[41.12,30.455,0],[38.278671,34.547951,0],[37.619998,55.75,0],[30.453329,59.951889,0],[23.12,63.84,0],[26.709999,58.380001,0],[25.42,57.549999,0],[23.319999,55.93,0],[26.1,52.119998,0],[32.259998,48.5,0],[28.829999,47.029998,0],[25.61,45.659999,0],[27.469999,42.509998,0],[23.729999,37.979999,0],[27.149999,38.43,0],[31.132659,29.977088,0],[32.659999,13.17,0],[33.599998,1.71,0],[25.92,-2.95,0],[28.45,-14.439999,0],[30.819999,-20.059999,0],[21.639999,-21.7,0],[25.59,-33.959999,0],[18.129999,-26.579999,0],[13.767777,-10.722417,0],[10.13,-0.15,0],[20.67,5.76,0],[9.71,4.059999,0],[7.44,10.52,0],[18.69,12.189999,0],[7.98,17,0],[14.42,27.069999,0],[3.678539,32.489059,0],[-7.619999,33.599998,0],[13.611066,38.129963,0],[12.482323,41.895466,0],[17.189752,44.763891,0],[16.45,43.509998,0],[14.51,46.060001,0],[21.629999,47.54,0],[16.37,48.220001,0],[10.736111,47.554444,0],[14.43,50.080001,0],[17.129999,48.159999,0],[22.569999,51.240001,0],[13.411895,52.523781,0],[10.039999,56.470001,0],[13.02,55.61,0],[17.329999,62.400001,0],[14.229999,78.059997,0],[10.399999,63.439998,0],[2.350966,48.856558,0],[7.42,43.75,0],[1.57,42.54,0],[-0.991293,37.605651,0],[-7.429999,39.29,0],[-11.4053,16.5889,0],[-3.009999,16.78,0],[-5.36008,5.83885,0],[-12.3,11.319999,0],[-16.239999,12.829999,0],[-16.2507,28.457661,0],[-0.126197,51.500197,0],[-2.968111,56.461428,0],[-7.308429,54.998539,0],[-8.92,52.7,0],[-19.000959,63.427502,0],[-28.364049911499,38.47212219238281,0],[-23.76,15.279999,0],[-36.511219,-54.274151,0],[-58.979999,-51.830001,0],[-64.190002,-31.399999,0],[-54.18,-32.36,0],[-43.2,-22.909999,0],[-37.333333,65.666667,0],[-69.345131,77.48262,0],[-55.65049,48.929001,0],[-63.530471,44.681263,0],[-66.647818,45.957319,0],[-59.630001,13.18,0],[-61.744888,12.06526,0],[-61.171322,10.30501,0],[-67.470001,7.9,0],[-58.159999,6.789999,0],[-60.02,-3.119999,0],[-56.45,-14.409999,0],[-65.260002,-19.059999,0],[-56.636503,-24.158676,0],[-56.509998,-33.409999,0],[-68.523514,-50.021889,0],[-72.505127,-51.732529,0],[-71.639999,-33.04,0],[-72.515821,-13.162849,0],[-76.970001,-6.03,0],[-78.620002,-1.24,0],[-76.739997,8.1,0],[-79.879913,9.368985,0],[-76.949996,18,0],[-72.699996,19.11,0],[-75.220001,20.149999,0],[-73.682953,20.95027,0],[-80.605,28.405556,0],[-84.388056,33.748889,0],[-79.931111,32.776389,0],[-83.920833,35.960556,0],[-84.500278,38.049167,0],[-77.460833,38.303056,0],[-82.515556,40.758333,0],[-83.045833,42.331389,0],[-74.006389,40.714167,0],[-71.802778,42.2625,0],[-72.973056,43.610556,0],[-68.0125,46.860556,0],[-72.581779,46.357398,0],[-78.53632621543271,52.72737572958358,0],[-66.921779,52.940118,0],[-75.652573,62.201069,0],[-64.865257,67.935417,0],[-94.969443,74.716943,0],[-82.793909,76.395731,0],[-97.49276733398439,69.18675994873048,0],[-90.5537452697754,63.36753463745121,0],[-89.270113,48.412197,0],[-79.604159,43.68731,0],[-89.401111,43.073056,0],[-94.633611,42.395278,0],[-89.588889,40.693611,0],[-90.197778,38.627222,0],[-90.704167,35.842222,0],[-91.061667,33.41,0],[-92.445,31.311111,0],[-98.493333,29.423889,0],[-103.349998,20.67,0],[-86.830001,21.17,0],[-89.529998,14.979999,0],[-87.449996,13.42,0],[-83.709999,9.369999,0],[-91.5149765,-0.3781085,0],[-109.425598,-27.1546,0],[-109.9142,22.88093,0],[-110.910003,27.92,0],[-110.925833,32.221667,0],[-104.526667,33.395,0],[-113.061111,37.6775,0],[-104.820833,38.833889,0],[-108.73,42.833056,0],[-113.895,45.175833,0],[-113.993056,46.872222,0],[-114.080796,51.039877,0],[-102.3889594419702,57.15883691318781,0],[-118.0333,66.0833,0],[-140.55,64.45,0],[-122.690386,58.80667,0],[-121.92985,50.686341,0],[-122.330833,47.606389,0],[-122.274167,47.564167,0],[-122.968503,45.309901,0],[-122.874444,42.326667,0],[-122.390556,40.586667,0],[-117.068611,39.493333,0],[-122.418333,37.775,0],[-117.108333,34.207778,0],[-116.544444,33.830278,0],[-117.156389,32.715278,0],[-149.891667,61.218333,0],[-155.566389,62.948889,0],[-165.406389,64.501111,0],[-155.09,19.729722,0],[-156.337974,20.804858,0],[-157.043209,21.141189,0],[-158.009167,21.386667,0],[-159.371111,21.981111,0]]}}]}';
16
+$output = '{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Name":"santaclaus","time": ['.implode(',', $timearray).']},"geometry":{"type":"MultiPoint","coordinates":[[-114.4,82.7,0],[-173.300003,64.379997,0],[177.479995,64.75,0],[158.65,53.016667,0],[165.545318,11.626074,0],[171.1300517813333,7.07999665990053,0],[179.380004,-16.469999,0],[178.429992,-18.129999,0],[174.759994,-36.849998,0],[176.839996,-39.639999,0],[174.779998,-41.279998,0],[172.639999,-43.529998,0],[167.838199,-46.986747,0],[168.320999,-17.740391,0],[167.149993,-15.51,0],[159.910003,-9.43,0],[156.850006,-8.1,0],[158.160003,6.92,0],[150.017702,45.873311,0],[154.796487,49.429802,0],[142.7262,46.948978,0],[150.800003,59.569999,0],[135.119995,48.419998,0],[131.899993,43.130001,0],[142.212096,27.070652,0],[141.312779,24.78389,0],[144.79373,13.444305,0],[151.783334,8.45,0],[151.749999,7.416667,0],[152.160003,-4.199999,0],[146.990005,-6.719999,0],[143.211639,-9.085352,0],[146.779998,-19.26,0],[149.179992,-21.139999,0],[153.020004,-27.459999,0],[151.210006,-33.869998,0],[147.291199,-42.85088,0],[138.600006,-34.93,0],[133.869995,-23.7,0],[130.850006,-12.43,0],[143.62,-3.56,0],[134.5552,7.3608,0],[135.169998,34.68,0],[138.690002,35.169998,0],[139.770004,35.669998,0],[140.740005,40.830001,0],[128.600006,35.869998,0],[125.925925,38.950981,0],[129.771118,62.093056,0],[104.239997,52.330001,0],[114.5056,48.060478,0],[106.580001,29.569999,0],[121.470001,31.229999,0],[113.25,23.12,0],[114.177465,22.307184,0],[121.639999,18.36,0],[122.080001,6.92,0],[114.639999,4.809999,0],[119.412399,-5.152193,0],[122.230003,-17.959999,0],[115.839996,-31.959999,0],[105.680687,-10.428593,0],[104.75,-2.99,0],[113.029998,3.17,0],[100.720001,4.86,0],[104.18,10.609999,0],[103.864403,13.36866,0],[99.330001,9.14,0],[105.073303,18.30217,0],[91.132088,29.6507,0],[116.477651,40.332809,0],[93.059997,56.02,0],[86.18,69.410003,0],[88.202881,69.315422,0],[73.400001,55,0],[76.949996,52.299999,0],[78.379997,42.490001,0],[69.779998,37.919998,0],[86.933333,27.983333,0],[84.870002,27.02,0],[88.36,22.569999,0],[90.389999,23.7,0],[97.04,20.78,0],[92.762917,11.66857,0],[50.23720550537109,-46.10261535644531,0],[72.422489,-7.336367,0],[73.510915,4.174199,0],[81.050003,6.989999,0],[72.819999,18.959999,0],[78.042222,27.174167,0],[71.449996,30.2,0],[67.109993,36.703819,0],[54.36,39.509998,0],[63.726529,40.214486,0],[58.853439,48.251126,0],[56.23246,58.00024,0],[49.659999,58.599998,0],[50.150001,53.2,0],[44.11,41.979999,0],[49.893226,40.38344,0],[44.75,40.5,0],[50.95,34.650001,0],[56.27433,27.18717,0],[54.989491,25.005817,0],[59.549999,22.569999,0],[47.58318996007591,-9.722414273737707,0],[57.471008,-20.26026,0],[37.946460723877,-46.6428451538086,0],[53,-67.5,0],[46.99004,-25.03233,0],[46.310001,-15.72,0],[44.41203117370608,-12.22338294982911,0],[39.3822,-6.097406,0],[39.659999,-4.039999,0],[40.033333,7.916667,0],[42.549999,16.899999,0],[43.970001,26.37,0],[41.12,30.455,0],[38.278671,34.547951,0],[37.619998,55.75,0],[30.453329,59.951889,0],[23.12,63.84,0],[26.709999,58.380001,0],[25.42,57.549999,0],[23.319999,55.93,0],[26.1,52.119998,0],[32.259998,48.5,0],[28.829999,47.029998,0],[25.61,45.659999,0],[27.469999,42.509998,0],[23.729999,37.979999,0],[27.149999,38.43,0],[31.132659,29.977088,0],[32.659999,13.17,0],[33.599998,1.71,0],[25.92,-2.95,0],[28.45,-14.439999,0],[30.819999,-20.059999,0],[21.639999,-21.7,0],[25.59,-33.959999,0],[18.129999,-26.579999,0],[13.767777,-10.722417,0],[10.13,-0.15,0],[20.67,5.76,0],[9.71,4.059999,0],[7.44,10.52,0],[18.69,12.189999,0],[7.98,17,0],[14.42,27.069999,0],[3.678539,32.489059,0],[-7.619999,33.599998,0],[13.611066,38.129963,0],[12.482323,41.895466,0],[17.189752,44.763891,0],[16.45,43.509998,0],[14.51,46.060001,0],[21.629999,47.54,0],[16.37,48.220001,0],[10.736111,47.554444,0],[14.43,50.080001,0],[17.129999,48.159999,0],[22.569999,51.240001,0],[13.411895,52.523781,0],[10.039999,56.470001,0],[13.02,55.61,0],[17.329999,62.400001,0],[14.229999,78.059997,0],[10.399999,63.439998,0],[2.350966,48.856558,0],[7.42,43.75,0],[1.57,42.54,0],[-0.991293,37.605651,0],[-7.429999,39.29,0],[-11.4053,16.5889,0],[-3.009999,16.78,0],[-5.36008,5.83885,0],[-12.3,11.319999,0],[-16.239999,12.829999,0],[-16.2507,28.457661,0],[-0.126197,51.500197,0],[-2.968111,56.461428,0],[-7.308429,54.998539,0],[-8.92,52.7,0],[-19.000959,63.427502,0],[-28.364049911499,38.47212219238281,0],[-23.76,15.279999,0],[-36.511219,-54.274151,0],[-58.979999,-51.830001,0],[-64.190002,-31.399999,0],[-54.18,-32.36,0],[-43.2,-22.909999,0],[-37.333333,65.666667,0],[-69.345131,77.48262,0],[-55.65049,48.929001,0],[-63.530471,44.681263,0],[-66.647818,45.957319,0],[-59.630001,13.18,0],[-61.744888,12.06526,0],[-61.171322,10.30501,0],[-67.470001,7.9,0],[-58.159999,6.789999,0],[-60.02,-3.119999,0],[-56.45,-14.409999,0],[-65.260002,-19.059999,0],[-56.636503,-24.158676,0],[-56.509998,-33.409999,0],[-68.523514,-50.021889,0],[-72.505127,-51.732529,0],[-71.639999,-33.04,0],[-72.515821,-13.162849,0],[-76.970001,-6.03,0],[-78.620002,-1.24,0],[-76.739997,8.1,0],[-79.879913,9.368985,0],[-76.949996,18,0],[-72.699996,19.11,0],[-75.220001,20.149999,0],[-73.682953,20.95027,0],[-80.605,28.405556,0],[-84.388056,33.748889,0],[-79.931111,32.776389,0],[-83.920833,35.960556,0],[-84.500278,38.049167,0],[-77.460833,38.303056,0],[-82.515556,40.758333,0],[-83.045833,42.331389,0],[-74.006389,40.714167,0],[-71.802778,42.2625,0],[-72.973056,43.610556,0],[-68.0125,46.860556,0],[-72.581779,46.357398,0],[-78.53632621543271,52.72737572958358,0],[-66.921779,52.940118,0],[-75.652573,62.201069,0],[-64.865257,67.935417,0],[-94.969443,74.716943,0],[-82.793909,76.395731,0],[-97.49276733398439,69.18675994873048,0],[-90.5537452697754,63.36753463745121,0],[-89.270113,48.412197,0],[-79.604159,43.68731,0],[-89.401111,43.073056,0],[-94.633611,42.395278,0],[-89.588889,40.693611,0],[-90.197778,38.627222,0],[-90.704167,35.842222,0],[-91.061667,33.41,0],[-92.445,31.311111,0],[-98.493333,29.423889,0],[-103.349998,20.67,0],[-86.830001,21.17,0],[-89.529998,14.979999,0],[-87.449996,13.42,0],[-83.709999,9.369999,0],[-91.5149765,-0.3781085,0],[-109.425598,-27.1546,0],[-109.9142,22.88093,0],[-110.910003,27.92,0],[-110.925833,32.221667,0],[-104.526667,33.395,0],[-113.061111,37.6775,0],[-104.820833,38.833889,0],[-108.73,42.833056,0],[-113.895,45.175833,0],[-113.993056,46.872222,0],[-114.080796,51.039877,0],[-102.3889594419702,57.15883691318781,0],[-118.0333,66.0833,0],[-140.55,64.45,0],[-122.690386,58.80667,0],[-121.92985,50.686341,0],[-122.330833,47.606389,0],[-122.274167,47.564167,0],[-122.968503,45.309901,0],[-122.874444,42.326667,0],[-122.390556,40.586667,0],[-117.068611,39.493333,0],[-122.418333,37.775,0],[-117.108333,34.207778,0],[-116.544444,33.830278,0],[-117.156389,32.715278,0],[-149.891667,61.218333,0],[-155.566389,62.948889,0],[-165.406389,64.501111,0],[-155.09,19.729722,0],[-156.337974,20.804858,0],[-157.043209,21.141189,0],[-158.009167,21.386667,0],[-159.371111,21.981111,0]]}}]}';
17 17
 print $output;
18 18
 
19 19
 ?>
Please login to merge, or discard this patch.
require/libs/simple_html_dom.php 1 patch
Spacing   +238 added lines, -238 removed lines patch added patch discarded remove patch
@@ -45,21 +45,21 @@  discard block
 block discarded – undo
45 45
  */
46 46
 define('HDOM_TYPE_ELEMENT', 1);
47 47
 define('HDOM_TYPE_COMMENT', 2);
48
-define('HDOM_TYPE_TEXT',	3);
49
-define('HDOM_TYPE_ENDTAG',  4);
50
-define('HDOM_TYPE_ROOT',	5);
48
+define('HDOM_TYPE_TEXT', 3);
49
+define('HDOM_TYPE_ENDTAG', 4);
50
+define('HDOM_TYPE_ROOT', 5);
51 51
 define('HDOM_TYPE_UNKNOWN', 6);
52 52
 define('HDOM_QUOTE_DOUBLE', 0);
53 53
 define('HDOM_QUOTE_SINGLE', 1);
54
-define('HDOM_QUOTE_NO',	 3);
55
-define('HDOM_INFO_BEGIN',   0);
56
-define('HDOM_INFO_END',	 1);
57
-define('HDOM_INFO_QUOTE',   2);
58
-define('HDOM_INFO_SPACE',   3);
59
-define('HDOM_INFO_TEXT',	4);
60
-define('HDOM_INFO_INNER',   5);
61
-define('HDOM_INFO_OUTER',   6);
62
-define('HDOM_INFO_ENDSPACE',7);
54
+define('HDOM_QUOTE_NO', 3);
55
+define('HDOM_INFO_BEGIN', 0);
56
+define('HDOM_INFO_END', 1);
57
+define('HDOM_INFO_QUOTE', 2);
58
+define('HDOM_INFO_SPACE', 3);
59
+define('HDOM_INFO_TEXT', 4);
60
+define('HDOM_INFO_INNER', 5);
61
+define('HDOM_INFO_OUTER', 6);
62
+define('HDOM_INFO_ENDSPACE', 7);
63 63
 define('DEFAULT_TARGET_CHARSET', 'UTF-8');
64 64
 define('DEFAULT_BR_TEXT', "\r\n");
65 65
 define('DEFAULT_SPAN_TEXT', " ");
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 // -----------------------------------------------------------------------------
69 69
 // get html dom from file
70 70
 // $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1.
71
-function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
71
+function file_get_html($url, $use_include_path = false, $context = null, $offset = -1, $maxLen = -1, $lowercase = true, $forceTagsClosed = true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT)
72 72
 {
73 73
 	// We DO force the tags to be terminated.
74 74
 	$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 }
87 87
 
88 88
 // get html dom from string
89
-function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
89
+function str_get_html($str, $lowercase = true, $forceTagsClosed = true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT)
90 90
 {
91 91
 	$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
92 92
 	if (empty($str) || strlen($str) > MAX_FILE_SIZE)
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 }
100 100
 
101 101
 // dump html dom tree
102
-function dump_html_tree($node, $show_attr=true, $deep=0)
102
+function dump_html_tree($node, $show_attr = true, $deep = 0)
103 103
 {
104 104
 	$node->dump($node);
105 105
 }
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
 	}
152 152
 
153 153
 	// dump node's tree
154
-	function dump($show_attr=true, $deep=0)
154
+	function dump($show_attr = true, $deep = 0)
155 155
 	{
156 156
 		$lead = str_repeat('	', $deep);
157 157
 
158 158
 		echo $lead.$this->tag;
159
-		if ($show_attr && count($this->attr)>0)
159
+		if ($show_attr && count($this->attr) > 0)
160 160
 		{
161 161
 			echo '(';
162 162
 			foreach ($this->attr as $k=>$v)
@@ -169,18 +169,18 @@  discard block
 block discarded – undo
169 169
 		{
170 170
 			foreach ($this->nodes as $c)
171 171
 			{
172
-				$c->dump($show_attr, $deep+1);
172
+				$c->dump($show_attr, $deep + 1);
173 173
 			}
174 174
 		}
175 175
 	}
176 176
 
177 177
 
178 178
 	// Debugging function to dump a single dom node with a bunch of information about it.
179
-	function dump_node($echo=true)
179
+	function dump_node($echo = true)
180 180
 	{
181 181
 
182 182
 		$string = $this->tag;
183
-		if (count($this->attr)>0)
183
+		if (count($this->attr) > 0)
184 184
 		{
185 185
 			$string .= '(';
186 186
 			foreach ($this->attr as $k=>$v)
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 			}
190 190
 			$string .= ')';
191 191
 		}
192
-		if (count($this->_)>0)
192
+		if (count($this->_) > 0)
193 193
 		{
194 194
 			$string .= ' $_ (';
195 195
 			foreach ($this->_ as $k=>$v)
@@ -211,22 +211,22 @@  discard block
 block discarded – undo
211 211
 
212 212
 		if (isset($this->text))
213 213
 		{
214
-			$string .= " text: (" . $this->text . ")";
214
+			$string .= " text: (".$this->text.")";
215 215
 		}
216 216
 
217 217
 		$string .= " HDOM_INNER_INFO: '";
218 218
 		if (isset($node->_[HDOM_INFO_INNER]))
219 219
 		{
220
-			$string .= $node->_[HDOM_INFO_INNER] . "'";
220
+			$string .= $node->_[HDOM_INFO_INNER]."'";
221 221
 		}
222 222
 		else
223 223
 		{
224 224
 			$string .= ' NULL ';
225 225
 		}
226 226
 
227
-		$string .= " children: " . count($this->children);
228
-		$string .= " nodes: " . count($this->nodes);
229
-		$string .= " tag_start: " . $this->tag_start;
227
+		$string .= " children: ".count($this->children);
228
+		$string .= " nodes: ".count($this->nodes);
229
+		$string .= " tag_start: ".$this->tag_start;
230 230
 		$string .= "\n";
231 231
 
232 232
 		if ($echo)
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
 	// returns the parent of node
244 244
 	// If a node is passed in, it will reset the parent of the current node to that one.
245
-	function parent($parent=null)
245
+	function parent($parent = null)
246 246
 	{
247 247
 		// I am SURE that this doesn't work properly.
248 248
 		// It fails to unset the current node from it's current parents nodes or children list first.
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
 	}
264 264
 
265 265
 	// returns children of node
266
-	function children($idx=-1)
266
+	function children($idx = -1)
267 267
 	{
268
-		if ($idx===-1)
268
+		if ($idx === -1)
269 269
 		{
270 270
 			return $this->children;
271 271
 		}
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	// returns the first child of node
280 280
 	function first_child()
281 281
 	{
282
-		if (count($this->children)>0)
282
+		if (count($this->children) > 0)
283 283
 		{
284 284
 			return $this->children[0];
285 285
 		}
@@ -289,9 +289,9 @@  discard block
 block discarded – undo
289 289
 	// returns the last child of node
290 290
 	function last_child()
291 291
 	{
292
-		if (($count=count($this->children))>0)
292
+		if (($count = count($this->children)) > 0)
293 293
 		{
294
-			return $this->children[$count-1];
294
+			return $this->children[$count - 1];
295 295
 		}
296 296
 		return null;
297 297
 	}
@@ -299,18 +299,18 @@  discard block
 block discarded – undo
299 299
 	// returns the next sibling of node
300 300
 	function next_sibling()
301 301
 	{
302
-		if ($this->parent===null)
302
+		if ($this->parent === null)
303 303
 		{
304 304
 			return null;
305 305
 		}
306 306
 
307 307
 		$idx = 0;
308 308
 		$count = count($this->parent->children);
309
-		while ($idx<$count && $this!==$this->parent->children[$idx])
309
+		while ($idx < $count && $this !== $this->parent->children[$idx])
310 310
 		{
311 311
 			++$idx;
312 312
 		}
313
-		if (++$idx>=$count)
313
+		if (++$idx >= $count)
314 314
 		{
315 315
 			return null;
316 316
 		}
@@ -320,12 +320,12 @@  discard block
 block discarded – undo
320 320
 	// returns the previous sibling of node
321 321
 	function prev_sibling()
322 322
 	{
323
-		if ($this->parent===null) return null;
323
+		if ($this->parent === null) return null;
324 324
 		$idx = 0;
325 325
 		$count = count($this->parent->children);
326
-		while ($idx<$count && $this!==$this->parent->children[$idx])
326
+		while ($idx < $count && $this !== $this->parent->children[$idx])
327 327
 			++$idx;
328
-		if (--$idx<0) return null;
328
+		if (--$idx < 0) return null;
329 329
 		return $this->parent->children[$idx];
330 330
 	}
331 331
 
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 
341 341
 		while (!is_null($returnDom))
342 342
 		{
343
-			if (is_object($debug_object)) { $debug_object->debug_log(2, "Current tag is: " . $returnDom->tag); }
343
+			if (is_object($debug_object)) { $debug_object->debug_log(2, "Current tag is: ".$returnDom->tag); }
344 344
 
345 345
 			if ($returnDom->tag == $tag)
346 346
 			{
@@ -374,16 +374,16 @@  discard block
 block discarded – undo
374 374
 			{
375 375
 				if (!empty($this->text))
376 376
 				{
377
-					$text = " with text: " . $this->text;
377
+					$text = " with text: ".$this->text;
378 378
 				}
379 379
 			}
380
-			$debug_object->debug_log(1, 'Innertext of tag: ' . $this->tag . $text);
380
+			$debug_object->debug_log(1, 'Innertext of tag: '.$this->tag.$text);
381 381
 		}
382 382
 
383
-		if ($this->tag==='root') return $this->innertext();
383
+		if ($this->tag === 'root') return $this->innertext();
384 384
 
385 385
 		// trigger callback
386
-		if ($this->dom && $this->dom->callback!==null)
386
+		if ($this->dom && $this->dom->callback !== null)
387 387
 		{
388 388
 			call_user_func_array($this->dom->callback, array($this));
389 389
 		}
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 		}
419 419
 
420 420
 		// render end tag
421
-		if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END]!=0)
421
+		if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END] != 0)
422 422
 			$ret .= '</'.$this->tag.'>';
423 423
 		return $ret;
424 424
 	}
@@ -433,8 +433,8 @@  discard block
 block discarded – undo
433 433
 			case HDOM_TYPE_COMMENT: return '';
434 434
 			case HDOM_TYPE_UNKNOWN: return '';
435 435
 		}
436
-		if (strcasecmp($this->tag, 'script')===0) return '';
437
-		if (strcasecmp($this->tag, 'style')===0) return '';
436
+		if (strcasecmp($this->tag, 'script') === 0) return '';
437
+		if (strcasecmp($this->tag, 'style') === 0) return '';
438 438
 
439 439
 		$ret = '';
440 440
 		// In rare cases, (always node type 1 or HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL.
@@ -480,12 +480,12 @@  discard block
 block discarded – undo
480 480
 			++$i;
481 481
 
482 482
 			// skip removed attribute
483
-			if ($val===null || $val===false)
483
+			if ($val === null || $val === false)
484 484
 				continue;
485 485
 
486 486
 			$ret .= $this->_[HDOM_INFO_SPACE][$i][0];
487 487
 			//no value attr: nowrap, checked selected...
488
-			if ($val===true)
488
+			if ($val === true)
489 489
 				$ret .= $key;
490 490
 			else {
491 491
 				switch ($this->_[HDOM_INFO_QUOTE][$i])
@@ -498,34 +498,34 @@  discard block
 block discarded – undo
498 498
 			}
499 499
 		}
500 500
 		$ret = $this->dom->restore_noise($ret);
501
-		return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>';
501
+		return $ret.$this->_[HDOM_INFO_ENDSPACE].'>';
502 502
 	}
503 503
 
504 504
 	// find elements by css selector
505 505
 	//PaperG - added ability for find to lowercase the value of the selector.
506
-	function find($selector, $idx=null, $lowercase=false)
506
+	function find($selector, $idx = null, $lowercase = false)
507 507
 	{
508 508
 		$selectors = $this->parse_selector($selector);
509
-		if (($count=count($selectors))===0) return array();
509
+		if (($count = count($selectors)) === 0) return array();
510 510
 		$found_keys = array();
511 511
 
512 512
 		// find each selector
513
-		for ($c=0; $c<$count; ++$c)
513
+		for ($c = 0; $c < $count; ++$c)
514 514
 		{
515 515
 			// The change on the below line was documented on the sourceforge code tracker id 2788009
516 516
 			// used to be: if (($levle=count($selectors[0]))===0) return array();
517
-			if (($levle=count($selectors[$c]))===0) return array();
517
+			if (($levle = count($selectors[$c])) === 0) return array();
518 518
 			if (!isset($this->_[HDOM_INFO_BEGIN])) return array();
519 519
 
520 520
 			$head = array($this->_[HDOM_INFO_BEGIN]=>1);
521 521
 
522 522
 			// handle descendant selectors, no recursive!
523
-			for ($l=0; $l<$levle; ++$l)
523
+			for ($l = 0; $l < $levle; ++$l)
524 524
 			{
525 525
 				$ret = array();
526 526
 				foreach ($head as $k=>$v)
527 527
 				{
528
-					$n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k];
528
+					$n = ($k === -1) ? $this->dom->root : $this->dom->nodes[$k];
529 529
 					//PaperG - Pass this optional parameter on to the seek function.
530 530
 					$n->seek($selectors[$c][$l], $ret, $lowercase);
531 531
 				}
@@ -550,13 +550,13 @@  discard block
 block discarded – undo
550 550
 
551 551
 		// return nth-element or array
552 552
 		if (is_null($idx)) return $found;
553
-		else if ($idx<0) $idx = count($found) + $idx;
553
+		else if ($idx < 0) $idx = count($found) + $idx;
554 554
 		return (isset($found[$idx])) ? $found[$idx] : null;
555 555
 	}
556 556
 
557 557
 	// seek for given conditions
558 558
 	// PaperG - added parameter to allow for case insensitive testing of the value of a selector.
559
-	protected function seek($selector, &$ret, $lowercase=false)
559
+	protected function seek($selector, &$ret, $lowercase = false)
560 560
 	{
561 561
 		global $debug_object;
562 562
 		if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
@@ -569,8 +569,8 @@  discard block
 block discarded – undo
569 569
 			$count = 0;
570 570
 			foreach ($this->children as $c)
571 571
 			{
572
-				if ($tag==='*' || $tag===$c->tag) {
573
-					if (++$count==$key) {
572
+				if ($tag === '*' || $tag === $c->tag) {
573
+					if (++$count == $key) {
574 574
 						$ret[$c->_[HDOM_INFO_BEGIN]] = 1;
575 575
 						return;
576 576
 					}
@@ -580,38 +580,38 @@  discard block
 block discarded – undo
580 580
 		}
581 581
 
582 582
 		$end = (!empty($this->_[HDOM_INFO_END])) ? $this->_[HDOM_INFO_END] : 0;
583
-		if ($end==0) {
583
+		if ($end == 0) {
584 584
 			$parent = $this->parent;
585
-			while (!isset($parent->_[HDOM_INFO_END]) && $parent!==null) {
585
+			while (!isset($parent->_[HDOM_INFO_END]) && $parent !== null) {
586 586
 				$end -= 1;
587 587
 				$parent = $parent->parent;
588 588
 			}
589 589
 			$end += $parent->_[HDOM_INFO_END];
590 590
 		}
591 591
 
592
-		for ($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) {
592
+		for ($i = $this->_[HDOM_INFO_BEGIN] + 1; $i < $end; ++$i) {
593 593
 			$node = $this->dom->nodes[$i];
594 594
 
595 595
 			$pass = true;
596 596
 
597
-			if ($tag==='*' && !$key) {
597
+			if ($tag === '*' && !$key) {
598 598
 				if (in_array($node, $this->children, true))
599 599
 					$ret[$i] = 1;
600 600
 				continue;
601 601
 			}
602 602
 
603 603
 			// compare tag
604
-			if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=false;}
604
+			if ($tag && $tag != $node->tag && $tag !== '*') {$pass = false; }
605 605
 			// compare key
606 606
 			if ($pass && $key) {
607 607
 				if ($no_key) {
608
-					if (isset($node->attr[$key])) $pass=false;
608
+					if (isset($node->attr[$key])) $pass = false;
609 609
 				} else {
610
-					if (($key != "plaintext") && !isset($node->attr[$key])) $pass=false;
610
+					if (($key != "plaintext") && !isset($node->attr[$key])) $pass = false;
611 611
 				}
612 612
 			}
613 613
 			// compare value
614
-			if ($pass && $key && $val  && $val!=='*') {
614
+			if ($pass && $key && $val && $val !== '*') {
615 615
 				// If they have told us that this is a "plaintext" search then we want the plaintext of the node - right?
616 616
 				if ($key == "plaintext") {
617 617
 					// $node->plaintext actually returns $node->text();
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 					// this is a normal search, we want the value of that attribute of the tag.
621 621
 					$nodeKeyValue = $node->attr[$key];
622 622
 				}
623
-				if (is_object($debug_object)) {$debug_object->debug_log(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);}
623
+				if (is_object($debug_object)) {$debug_object->debug_log(2, "testing node: ".$node->tag." for attribute: ".$key.$exp.$val." where nodes value is: ".$nodeKeyValue); }
624 624
 
625 625
 				//PaperG - If lowercase is set, do a case insensitive test of the value of the selector.
626 626
 				if ($lowercase) {
@@ -628,11 +628,11 @@  discard block
 block discarded – undo
628 628
 				} else {
629 629
 					$check = $this->match($exp, $val, $nodeKeyValue);
630 630
 				}
631
-				if (is_object($debug_object)) {$debug_object->debug_log(2, "after match: " . ($check ? "true" : "false"));}
631
+				if (is_object($debug_object)) {$debug_object->debug_log(2, "after match: ".($check ? "true" : "false")); }
632 632
 
633 633
 				// handle multiple class
634
-				if (!$check && strcasecmp($key, 'class')===0) {
635
-					foreach (explode(' ',$node->attr[$key]) as $k) {
634
+				if (!$check && strcasecmp($key, 'class') === 0) {
635
+					foreach (explode(' ', $node->attr[$key]) as $k) {
636 636
 						// Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form.
637 637
 						if (!empty($k)) {
638 638
 							if ($lowercase) {
@@ -650,24 +650,24 @@  discard block
 block discarded – undo
650 650
 			unset($node);
651 651
 		}
652 652
 		// It's passed by reference so this is actually what this function returns.
653
-		if (is_object($debug_object)) {$debug_object->debug_log(1, "EXIT - ret: ", $ret);}
653
+		if (is_object($debug_object)) {$debug_object->debug_log(1, "EXIT - ret: ", $ret); }
654 654
 	}
655 655
 
656 656
 	protected function match($exp, $pattern, $value) {
657 657
 		global $debug_object;
658
-		if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
658
+		if (is_object($debug_object)) {$debug_object->debug_log_entry(1); }
659 659
 
660 660
 		switch ($exp) {
661 661
 			case '=':
662
-				return ($value===$pattern);
662
+				return ($value === $pattern);
663 663
 			case '!=':
664
-				return ($value!==$pattern);
664
+				return ($value !== $pattern);
665 665
 			case '^=':
666
-				return preg_match("/^".preg_quote($pattern,'/')."/", $value);
666
+				return preg_match("/^".preg_quote($pattern, '/')."/", $value);
667 667
 			case '$=':
668
-				return preg_match("/".preg_quote($pattern,'/')."$/", $value);
668
+				return preg_match("/".preg_quote($pattern, '/')."$/", $value);
669 669
 			case '*=':
670
-				if ($pattern[0]=='/') {
670
+				if ($pattern[0] == '/') {
671 671
 					return preg_match($pattern, $value);
672 672
 				}
673 673
 				return preg_match("/".$pattern."/i", $value);
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 
678 678
 	protected function parse_selector($selector_string) {
679 679
 		global $debug_object;
680
-		if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
680
+		if (is_object($debug_object)) {$debug_object->debug_log_entry(1); }
681 681
 
682 682
 		// pattern of CSS selectors, modified from mootools
683 683
 		// Paperg: Add the colon to the attrbute, so that it properly finds <tag attr:ibute="something" > like google does.
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
 //		$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
689 689
 		$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
690 690
 		preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER);
691
-		if (is_object($debug_object)) {$debug_object->debug_log(2, "Matches Array: ", $matches);}
691
+		if (is_object($debug_object)) {$debug_object->debug_log(2, "Matches Array: ", $matches); }
692 692
 
693 693
 		$selectors = array();
694 694
 		$result = array();
@@ -696,29 +696,29 @@  discard block
 block discarded – undo
696 696
 
697 697
 		foreach ($matches as $m) {
698 698
 			$m[0] = trim($m[0]);
699
-			if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') continue;
699
+			if ($m[0] === '' || $m[0] === '/' || $m[0] === '//') continue;
700 700
 			// for browser generated xpath
701
-			if ($m[1]==='tbody') continue;
701
+			if ($m[1] === 'tbody') continue;
702 702
 
703 703
 			list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false);
704
-			if (!empty($m[2])) {$key='id'; $val=$m[2];}
705
-			if (!empty($m[3])) {$key='class'; $val=$m[3];}
706
-			if (!empty($m[4])) {$key=$m[4];}
707
-			if (!empty($m[5])) {$exp=$m[5];}
708
-			if (!empty($m[6])) {$val=$m[6];}
704
+			if (!empty($m[2])) {$key = 'id'; $val = $m[2]; }
705
+			if (!empty($m[3])) {$key = 'class'; $val = $m[3]; }
706
+			if (!empty($m[4])) {$key = $m[4]; }
707
+			if (!empty($m[5])) {$exp = $m[5]; }
708
+			if (!empty($m[6])) {$val = $m[6]; }
709 709
 
710 710
 			// convert to lowercase
711
-			if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);}
711
+			if ($this->dom->lowercase) {$tag = strtolower($tag); $key = strtolower($key); }
712 712
 			//elements that do NOT have the specified attribute
713
-			if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;}
713
+			if (isset($key[0]) && $key[0] === '!') {$key = substr($key, 1); $no_key = true; }
714 714
 
715 715
 			$result[] = array($tag, $key, $val, $exp, $no_key);
716
-			if (trim($m[7])===',') {
716
+			if (trim($m[7]) === ',') {
717 717
 				$selectors[] = $result;
718 718
 				$result = array();
719 719
 			}
720 720
 		}
721
-		if (count($result)>0)
721
+		if (count($result) > 0)
722 722
 			$selectors[] = $result;
723 723
 		return $selectors;
724 724
 	}
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 	function __set($name, $value)
743 743
 	{
744 744
 		global $debug_object;
745
-		if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
745
+		if (is_object($debug_object)) {$debug_object->debug_log_entry(1); }
746 746
 
747 747
 		switch ($name)
748 748
 		{
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
 	function convert_text($text)
781 781
 	{
782 782
 		global $debug_object;
783
-		if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
783
+		if (is_object($debug_object)) {$debug_object->debug_log_entry(1); }
784 784
 
785 785
 		$converted_text = $text;
786 786
 
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 			$sourceCharset = strtoupper($this->dom->_charset);
793 793
 			$targetCharset = strtoupper($this->dom->_target_charset);
794 794
 		}
795
-		if (is_object($debug_object)) {$debug_object->debug_log(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);}
795
+		if (is_object($debug_object)) {$debug_object->debug_log(3, "source charset: ".$sourceCharset." target charaset: ".$targetCharset); }
796 796
 
797 797
 		if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0))
798 798
 		{
@@ -831,27 +831,27 @@  discard block
 block discarded – undo
831 831
 	*/
832 832
 	static function is_utf8($str)
833 833
 	{
834
-		$c=0; $b=0;
835
-		$bits=0;
836
-		$len=strlen($str);
837
-		for($i=0; $i<$len; $i++)
834
+		$c = 0; $b = 0;
835
+		$bits = 0;
836
+		$len = strlen($str);
837
+		for ($i = 0; $i < $len; $i++)
838 838
 		{
839
-			$c=ord($str[$i]);
840
-			if($c > 128)
839
+			$c = ord($str[$i]);
840
+			if ($c > 128)
841 841
 			{
842
-				if(($c >= 254)) return false;
843
-				elseif($c >= 252) $bits=6;
844
-				elseif($c >= 248) $bits=5;
845
-				elseif($c >= 240) $bits=4;
846
-				elseif($c >= 224) $bits=3;
847
-				elseif($c >= 192) $bits=2;
842
+				if (($c >= 254)) return false;
843
+				elseif ($c >= 252) $bits = 6;
844
+				elseif ($c >= 248) $bits = 5;
845
+				elseif ($c >= 240) $bits = 4;
846
+				elseif ($c >= 224) $bits = 3;
847
+				elseif ($c >= 192) $bits = 2;
848 848
 				else return false;
849
-				if(($i+$bits) > $len) return false;
850
-				while($bits > 1)
849
+				if (($i + $bits) > $len) return false;
850
+				while ($bits > 1)
851 851
 				{
852 852
 					$i++;
853
-					$b=ord($str[$i]);
854
-					if($b < 128 || $b > 191) return false;
853
+					$b = ord($str[$i]);
854
+					if ($b < 128 || $b > 191) return false;
855 855
 					$bits--;
856 856
 				}
857 857
 			}
@@ -955,24 +955,24 @@  discard block
 block discarded – undo
955 955
 	}
956 956
 
957 957
 	// camel naming conventions
958
-	function getAllAttributes() {return $this->attr;}
959
-	function getAttribute($name) {return $this->__get($name);}
960
-	function setAttribute($name, $value) {$this->__set($name, $value);}
961
-	function hasAttribute($name) {return $this->__isset($name);}
962
-	function removeAttribute($name) {$this->__set($name, null);}
963
-	function getElementById($id) {return $this->find("#$id", 0);}
964
-	function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);}
965
-	function getElementByTagName($name) {return $this->find($name, 0);}
966
-	function getElementsByTagName($name, $idx=null) {return $this->find($name, $idx);}
967
-	function parentNode() {return $this->parent();}
968
-	function childNodes($idx=-1) {return $this->children($idx);}
969
-	function firstChild() {return $this->first_child();}
970
-	function lastChild() {return $this->last_child();}
971
-	function nextSibling() {return $this->next_sibling();}
972
-	function previousSibling() {return $this->prev_sibling();}
973
-	function hasChildNodes() {return $this->has_child();}
974
-	function nodeName() {return $this->tag;}
975
-	function appendChild($node) {$node->parent($this); return $node;}
958
+	function getAllAttributes() {return $this->attr; }
959
+	function getAttribute($name) {return $this->__get($name); }
960
+	function setAttribute($name, $value) {$this->__set($name, $value); }
961
+	function hasAttribute($name) {return $this->__isset($name); }
962
+	function removeAttribute($name) {$this->__set($name, null); }
963
+	function getElementById($id) {return $this->find("#$id", 0); }
964
+	function getElementsById($id, $idx = null) {return $this->find("#$id", $idx); }
965
+	function getElementByTagName($name) {return $this->find($name, 0); }
966
+	function getElementsByTagName($name, $idx = null) {return $this->find($name, $idx); }
967
+	function parentNode() {return $this->parent(); }
968
+	function childNodes($idx = -1) {return $this->children($idx); }
969
+	function firstChild() {return $this->first_child(); }
970
+	function lastChild() {return $this->last_child(); }
971
+	function nextSibling() {return $this->next_sibling(); }
972
+	function previousSibling() {return $this->prev_sibling(); }
973
+	function hasChildNodes() {return $this->has_child(); }
974
+	function nodeName() {return $this->tag; }
975
+	function appendChild($node) {$node->parent($this); return $node; }
976 976
 
977 977
 }
978 978
 
@@ -1028,11 +1028,11 @@  discard block
 block discarded – undo
1028 1028
 		'option'=>array('option'=>1),
1029 1029
 	);
1030 1030
 
1031
-	function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
1031
+	function __construct($str = null, $lowercase = true, $forceTagsClosed = true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT)
1032 1032
 	{
1033 1033
 		if ($str)
1034 1034
 		{
1035
-			if (preg_match("/^http:\/\//i",$str) || is_file($str))
1035
+			if (preg_match("/^http:\/\//i", $str) || is_file($str))
1036 1036
 			{
1037 1037
 				$this->load_file($str);
1038 1038
 			}
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
 		}
1044 1044
 		// Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html.
1045 1045
 		if (!$forceTagsClosed) {
1046
-			$this->optional_closing_array=array();
1046
+			$this->optional_closing_array = array();
1047 1047
 		}
1048 1048
 		$this->_target_charset = $target_charset;
1049 1049
 	}
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
 	}
1055 1055
 
1056 1056
 	// load html from string
1057
-	function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
1057
+	function load($str, $lowercase = true, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT)
1058 1058
 	{
1059 1059
 		global $debug_object;
1060 1060
 
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 		$args = func_get_args();
1097 1097
 		$this->load(call_user_func_array('file_get_contents', $args), true);
1098 1098
 		// Throw an error if we can't properly load the dom.
1099
-		if (($error=error_get_last())!==null) {
1099
+		if (($error = error_get_last()) !== null) {
1100 1100
 			$this->clear();
1101 1101
 			return false;
1102 1102
 		}
@@ -1115,16 +1115,16 @@  discard block
 block discarded – undo
1115 1115
 	}
1116 1116
 
1117 1117
 	// save dom as string
1118
-	function save($filepath='')
1118
+	function save($filepath = '')
1119 1119
 	{
1120 1120
 		$ret = $this->root->innertext();
1121
-		if ($filepath!=='') file_put_contents($filepath, $ret, LOCK_EX);
1121
+		if ($filepath !== '') file_put_contents($filepath, $ret, LOCK_EX);
1122 1122
 		return $ret;
1123 1123
 	}
1124 1124
 
1125 1125
 	// find dom node by css selector
1126 1126
 	// Paperg - allow us to specify that we want case insensitive testing of the value of the selector.
1127
-	function find($selector, $idx=null, $lowercase=false)
1127
+	function find($selector, $idx = null, $lowercase = false)
1128 1128
 	{
1129 1129
 		return $this->root->find($selector, $idx, $lowercase);
1130 1130
 	}
@@ -1132,22 +1132,22 @@  discard block
 block discarded – undo
1132 1132
 	// clean up memory due to php5 circular references memory leak...
1133 1133
 	function clear()
1134 1134
 	{
1135
-		foreach ($this->nodes as $n) {$n->clear(); $n = null;}
1135
+		foreach ($this->nodes as $n) {$n->clear(); $n = null; }
1136 1136
 		// This add next line is documented in the sourceforge repository. 2977248 as a fix for ongoing memory leaks that occur even with the use of clear.
1137
-		if (isset($this->children)) foreach ($this->children as $n) {$n->clear(); $n = null;}
1138
-		if (isset($this->parent)) {$this->parent->clear(); unset($this->parent);}
1139
-		if (isset($this->root)) {$this->root->clear(); unset($this->root);}
1137
+		if (isset($this->children)) foreach ($this->children as $n) {$n->clear(); $n = null; }
1138
+		if (isset($this->parent)) {$this->parent->clear(); unset($this->parent); }
1139
+		if (isset($this->root)) {$this->root->clear(); unset($this->root); }
1140 1140
 		unset($this->doc);
1141 1141
 		unset($this->noise);
1142 1142
 	}
1143 1143
 
1144
-	function dump($show_attr=true)
1144
+	function dump($show_attr = true)
1145 1145
 	{
1146 1146
 		$this->root->dump($show_attr);
1147 1147
 	}
1148 1148
 
1149 1149
 	// prepare HTML data and init everything
1150
-	protected function prepare($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
1150
+	protected function prepare($str, $lowercase = true, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT, $defaultSpanText = DEFAULT_SPAN_TEXT)
1151 1151
 	{
1152 1152
 		$this->clear();
1153 1153
 
@@ -1178,13 +1178,13 @@  discard block
 block discarded – undo
1178 1178
 		$this->root->_[HDOM_INFO_BEGIN] = -1;
1179 1179
 		$this->root->nodetype = HDOM_TYPE_ROOT;
1180 1180
 		$this->parent = $this->root;
1181
-		if ($this->size>0) $this->char = $this->doc[0];
1181
+		if ($this->size > 0) $this->char = $this->doc[0];
1182 1182
 	}
1183 1183
 
1184 1184
 	// parse html content
1185 1185
 	protected function parse()
1186 1186
 	{
1187
-		if (($s = $this->copy_until_char('<'))==='')
1187
+		if (($s = $this->copy_until_char('<')) === '')
1188 1188
 		{
1189 1189
 			return $this->read_tag();
1190 1190
 		}
@@ -1213,18 +1213,18 @@  discard block
 block discarded – undo
1213 1213
 			if ($success)
1214 1214
 			{
1215 1215
 				$charset = $matches[1];
1216
-				if (is_object($debug_object)) {$debug_object->debug_log(2, 'header content-type found charset of: ' . $charset);}
1216
+				if (is_object($debug_object)) {$debug_object->debug_log(2, 'header content-type found charset of: '.$charset); }
1217 1217
 			}
1218 1218
 
1219 1219
 		}
1220 1220
 
1221 1221
 		if (empty($charset))
1222 1222
 		{
1223
-			$el = $this->root->find('meta[http-equiv=Content-Type]',0, true);
1223
+			$el = $this->root->find('meta[http-equiv=Content-Type]', 0, true);
1224 1224
 			if (!empty($el))
1225 1225
 			{
1226 1226
 				$fullvalue = $el->content;
1227
-				if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag found' . $fullvalue);}
1227
+				if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag found'.$fullvalue); }
1228 1228
 
1229 1229
 				if (!empty($fullvalue))
1230 1230
 				{
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
 					else
1237 1237
 					{
1238 1238
 						// If there is a meta tag, and they don't specify the character set, research says that it's typically ISO-8859-1
1239
-						if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag couldn\'t be parsed. using iso-8859 default.');}
1239
+						if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag couldn\'t be parsed. using iso-8859 default.'); }
1240 1240
 						$charset = 'ISO-8859-1';
1241 1241
 					}
1242 1242
 				}
@@ -1251,14 +1251,14 @@  discard block
 block discarded – undo
1251 1251
 			if (function_exists('mb_detect_encoding'))
1252 1252
 			{
1253 1253
 				// Have php try to detect the encoding from the text given to us.
1254
-				$charset = mb_detect_encoding($this->root->plaintext . "ascii", $encoding_list = array( "UTF-8", "CP1252" ) );
1255
-				if (is_object($debug_object)) {$debug_object->debug_log(2, 'mb_detect found: ' . $charset);}
1254
+				$charset = mb_detect_encoding($this->root->plaintext."ascii", $encoding_list = array("UTF-8", "CP1252"));
1255
+				if (is_object($debug_object)) {$debug_object->debug_log(2, 'mb_detect found: '.$charset); }
1256 1256
 			}
1257 1257
 
1258 1258
 			// and if this doesn't work...  then we need to just wrongheadedly assume it's UTF-8 so that we can move on - cause this will usually give us most of what we need...
1259 1259
 			if ($charset === false)
1260 1260
 			{
1261
-				if (is_object($debug_object)) {$debug_object->debug_log(2, 'since mb_detect failed - using default of utf-8');}
1261
+				if (is_object($debug_object)) {$debug_object->debug_log(2, 'since mb_detect failed - using default of utf-8'); }
1262 1262
 				$charset = 'UTF-8';
1263 1263
 			}
1264 1264
 		}
@@ -1266,11 +1266,11 @@  discard block
 block discarded – undo
1266 1266
 		// Since CP1252 is a superset, if we get one of it's subsets, we want it instead.
1267 1267
 		if ((strtolower($charset) == strtolower('ISO-8859-1')) || (strtolower($charset) == strtolower('Latin1')) || (strtolower($charset) == strtolower('Latin-1')))
1268 1268
 		{
1269
-			if (is_object($debug_object)) {$debug_object->debug_log(2, 'replacing ' . $charset . ' with CP1252 as its a superset');}
1269
+			if (is_object($debug_object)) {$debug_object->debug_log(2, 'replacing '.$charset.' with CP1252 as its a superset'); }
1270 1270
 			$charset = 'CP1252';
1271 1271
 		}
1272 1272
 
1273
-		if (is_object($debug_object)) {$debug_object->debug_log(1, 'EXIT - ' . $charset);}
1273
+		if (is_object($debug_object)) {$debug_object->debug_log(1, 'EXIT - '.$charset); }
1274 1274
 
1275 1275
 		return $this->_charset = $charset;
1276 1276
 	}
@@ -1278,41 +1278,41 @@  discard block
 block discarded – undo
1278 1278
 	// read tag info
1279 1279
 	protected function read_tag()
1280 1280
 	{
1281
-		if ($this->char!=='<')
1281
+		if ($this->char !== '<')
1282 1282
 		{
1283 1283
 			$this->root->_[HDOM_INFO_END] = $this->cursor;
1284 1284
 			return false;
1285 1285
 		}
1286 1286
 		$begin_tag_pos = $this->pos;
1287
-		$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1287
+		$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1288 1288
 
1289 1289
 		// end tag
1290
-		if ($this->char==='/')
1290
+		if ($this->char === '/')
1291 1291
 		{
1292
-			$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1292
+			$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1293 1293
 			// This represents the change in the simple_html_dom trunk from revision 180 to 181.
1294 1294
 			// $this->skip($this->token_blank_t);
1295 1295
 			$this->skip($this->token_blank);
1296 1296
 			$tag = $this->copy_until_char('>');
1297 1297
 
1298 1298
 			// skip attributes in end tag
1299
-			if (($pos = strpos($tag, ' '))!==false)
1299
+			if (($pos = strpos($tag, ' ')) !== false)
1300 1300
 				$tag = substr($tag, 0, $pos);
1301 1301
 
1302 1302
 			$parent_lower = strtolower($this->parent->tag);
1303 1303
 			$tag_lower = strtolower($tag);
1304 1304
 
1305
-			if ($parent_lower!==$tag_lower)
1305
+			if ($parent_lower !== $tag_lower)
1306 1306
 			{
1307 1307
 				if (isset($this->optional_closing_tags[$parent_lower]) && isset($this->block_tags[$tag_lower]))
1308 1308
 				{
1309 1309
 					$this->parent->_[HDOM_INFO_END] = 0;
1310 1310
 					$org_parent = $this->parent;
1311 1311
 
1312
-					while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower)
1312
+					while (($this->parent->parent) && strtolower($this->parent->tag) !== $tag_lower)
1313 1313
 						$this->parent = $this->parent->parent;
1314 1314
 
1315
-					if (strtolower($this->parent->tag)!==$tag_lower) {
1315
+					if (strtolower($this->parent->tag) !== $tag_lower) {
1316 1316
 						$this->parent = $org_parent; // restore origonal parent
1317 1317
 						if ($this->parent->parent) $this->parent = $this->parent->parent;
1318 1318
 						$this->parent->_[HDOM_INFO_END] = $this->cursor;
@@ -1324,17 +1324,17 @@  discard block
 block discarded – undo
1324 1324
 					$this->parent->_[HDOM_INFO_END] = 0;
1325 1325
 					$org_parent = $this->parent;
1326 1326
 
1327
-					while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower)
1327
+					while (($this->parent->parent) && strtolower($this->parent->tag) !== $tag_lower)
1328 1328
 						$this->parent = $this->parent->parent;
1329 1329
 
1330
-					if (strtolower($this->parent->tag)!==$tag_lower)
1330
+					if (strtolower($this->parent->tag) !== $tag_lower)
1331 1331
 					{
1332 1332
 						$this->parent = $org_parent; // restore origonal parent
1333 1333
 						$this->parent->_[HDOM_INFO_END] = $this->cursor;
1334 1334
 						return $this->as_text_node($tag);
1335 1335
 					}
1336 1336
 				}
1337
-				else if (($this->parent->parent) && strtolower($this->parent->parent->tag)===$tag_lower)
1337
+				else if (($this->parent->parent) && strtolower($this->parent->parent->tag) === $tag_lower)
1338 1338
 				{
1339 1339
 					$this->parent->_[HDOM_INFO_END] = 0;
1340 1340
 					$this->parent = $this->parent->parent;
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 			$this->parent->_[HDOM_INFO_END] = $this->cursor;
1347 1347
 			if ($this->parent->parent) $this->parent = $this->parent->parent;
1348 1348
 
1349
-			$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1349
+			$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1350 1350
 			return true;
1351 1351
 		}
1352 1352
 
@@ -1357,25 +1357,25 @@  discard block
 block discarded – undo
1357 1357
 		$node->tag_start = $begin_tag_pos;
1358 1358
 
1359 1359
 		// doctype, cdata & comments...
1360
-		if (isset($tag[0]) && $tag[0]==='!') {
1361
-			$node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until_char('>');
1360
+		if (isset($tag[0]) && $tag[0] === '!') {
1361
+			$node->_[HDOM_INFO_TEXT] = '<'.$tag.$this->copy_until_char('>');
1362 1362
 
1363
-			if (isset($tag[2]) && $tag[1]==='-' && $tag[2]==='-') {
1363
+			if (isset($tag[2]) && $tag[1] === '-' && $tag[2] === '-') {
1364 1364
 				$node->nodetype = HDOM_TYPE_COMMENT;
1365 1365
 				$node->tag = 'comment';
1366 1366
 			} else {
1367 1367
 				$node->nodetype = HDOM_TYPE_UNKNOWN;
1368 1368
 				$node->tag = 'unknown';
1369 1369
 			}
1370
-			if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>';
1370
+			if ($this->char === '>') $node->_[HDOM_INFO_TEXT] .= '>';
1371 1371
 			$this->link_nodes($node, true);
1372
-			$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1372
+			$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1373 1373
 			return true;
1374 1374
 		}
1375 1375
 
1376 1376
 		// text
1377
-		if ($pos=strpos($tag, '<')!==false) {
1378
-			$tag = '<' . substr($tag, 0, -1);
1377
+		if ($pos = strpos($tag, '<') !== false) {
1378
+			$tag = '<'.substr($tag, 0, -1);
1379 1379
 			$node->_[HDOM_INFO_TEXT] = $tag;
1380 1380
 			$this->link_nodes($node, false);
1381 1381
 			$this->char = $this->doc[--$this->pos]; // prev
@@ -1383,15 +1383,15 @@  discard block
 block discarded – undo
1383 1383
 		}
1384 1384
 
1385 1385
 		if (!preg_match("/^[\w-:]+$/", $tag)) {
1386
-			$node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>');
1387
-			if ($this->char==='<') {
1386
+			$node->_[HDOM_INFO_TEXT] = '<'.$tag.$this->copy_until('<>');
1387
+			if ($this->char === '<') {
1388 1388
 				$this->link_nodes($node, false);
1389 1389
 				return true;
1390 1390
 			}
1391 1391
 
1392
-			if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>';
1392
+			if ($this->char === '>') $node->_[HDOM_INFO_TEXT] .= '>';
1393 1393
 			$this->link_nodes($node, false);
1394
-			$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1394
+			$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1395 1395
 			return true;
1396 1396
 		}
1397 1397
 
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 		$node->tag = ($this->lowercase) ? $tag_lower : $tag;
1402 1402
 
1403 1403
 		// handle optional closing tags
1404
-		if (isset($this->optional_closing_tags[$tag_lower]) )
1404
+		if (isset($this->optional_closing_tags[$tag_lower]))
1405 1405
 		{
1406 1406
 			while (isset($this->optional_closing_tags[$tag_lower][strtolower($this->parent->tag)]))
1407 1407
 			{
@@ -1417,67 +1417,67 @@  discard block
 block discarded – undo
1417 1417
 		// attributes
1418 1418
 		do
1419 1419
 		{
1420
-			if ($this->char!==null && $space[0]==='')
1420
+			if ($this->char !== null && $space[0] === '')
1421 1421
 			{
1422 1422
 				break;
1423 1423
 			}
1424 1424
 			$name = $this->copy_until($this->token_equal);
1425
-			if ($guard===$this->pos)
1425
+			if ($guard === $this->pos)
1426 1426
 			{
1427
-				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1427
+				$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1428 1428
 				continue;
1429 1429
 			}
1430 1430
 			$guard = $this->pos;
1431 1431
 
1432 1432
 			// handle endless '<'
1433
-			if ($this->pos>=$this->size-1 && $this->char!=='>') {
1433
+			if ($this->pos >= $this->size - 1 && $this->char !== '>') {
1434 1434
 				$node->nodetype = HDOM_TYPE_TEXT;
1435 1435
 				$node->_[HDOM_INFO_END] = 0;
1436
-				$node->_[HDOM_INFO_TEXT] = '<'.$tag . $space[0] . $name;
1436
+				$node->_[HDOM_INFO_TEXT] = '<'.$tag.$space[0].$name;
1437 1437
 				$node->tag = 'text';
1438 1438
 				$this->link_nodes($node, false);
1439 1439
 				return true;
1440 1440
 			}
1441 1441
 
1442 1442
 			// handle mismatch '<'
1443
-			if ($this->doc[$this->pos-1]=='<') {
1443
+			if ($this->doc[$this->pos - 1] == '<') {
1444 1444
 				$node->nodetype = HDOM_TYPE_TEXT;
1445 1445
 				$node->tag = 'text';
1446 1446
 				$node->attr = array();
1447 1447
 				$node->_[HDOM_INFO_END] = 0;
1448
-				$node->_[HDOM_INFO_TEXT] = substr($this->doc, $begin_tag_pos, $this->pos-$begin_tag_pos-1);
1448
+				$node->_[HDOM_INFO_TEXT] = substr($this->doc, $begin_tag_pos, $this->pos - $begin_tag_pos - 1);
1449 1449
 				$this->pos -= 2;
1450
-				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1450
+				$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1451 1451
 				$this->link_nodes($node, false);
1452 1452
 				return true;
1453 1453
 			}
1454 1454
 
1455
-			if ($name!=='/' && $name!=='') {
1455
+			if ($name !== '/' && $name !== '') {
1456 1456
 				$space[1] = $this->copy_skip($this->token_blank);
1457 1457
 				$name = $this->restore_noise($name);
1458 1458
 				if ($this->lowercase) $name = strtolower($name);
1459
-				if ($this->char==='=') {
1460
-					$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1459
+				if ($this->char === '=') {
1460
+					$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1461 1461
 					$this->parse_attr($node, $name, $space);
1462 1462
 				}
1463 1463
 				else {
1464 1464
 					//no value attr: nowrap, checked selected...
1465 1465
 					$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
1466 1466
 					$node->attr[$name] = true;
1467
-					if ($this->char!='>') $this->char = $this->doc[--$this->pos]; // prev
1467
+					if ($this->char != '>') $this->char = $this->doc[--$this->pos]; // prev
1468 1468
 				}
1469 1469
 				$node->_[HDOM_INFO_SPACE][] = $space;
1470 1470
 				$space = array($this->copy_skip($this->token_blank), '', '');
1471 1471
 			}
1472 1472
 			else
1473 1473
 				break;
1474
-		} while ($this->char!=='>' && $this->char!=='/');
1474
+		} while ($this->char !== '>' && $this->char !== '/');
1475 1475
 
1476 1476
 		$this->link_nodes($node, true);
1477 1477
 		$node->_[HDOM_INFO_ENDSPACE] = $space[0];
1478 1478
 
1479 1479
 		// check self closing
1480
-		if ($this->copy_until_char_escape('>')==='/')
1480
+		if ($this->copy_until_char_escape('>') === '/')
1481 1481
 		{
1482 1482
 			$node->_[HDOM_INFO_ENDSPACE] .= '/';
1483 1483
 			$node->_[HDOM_INFO_END] = 0;
@@ -1487,7 +1487,7 @@  discard block
 block discarded – undo
1487 1487
 			// reset parent
1488 1488
 			if (!isset($this->self_closing_tags[strtolower($node->tag)])) $this->parent = $node;
1489 1489
 		}
1490
-		$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1490
+		$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1491 1491
 
1492 1492
 		// If it's a BR tag, we need to set it's text to the default text.
1493 1493
 		// This way when we see it in plaintext, we can generate formatting that the user wants.
@@ -1514,15 +1514,15 @@  discard block
 block discarded – undo
1514 1514
 		switch ($this->char) {
1515 1515
 			case '"':
1516 1516
 				$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
1517
-				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1517
+				$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1518 1518
 				$node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('"'));
1519
-				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1519
+				$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1520 1520
 				break;
1521 1521
 			case '\'':
1522 1522
 				$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_SINGLE;
1523
-				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1523
+				$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1524 1524
 				$node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('\''));
1525
-				$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1525
+				$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1526 1526
 				break;
1527 1527
 			default:
1528 1528
 				$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
@@ -1553,16 +1553,16 @@  discard block
 block discarded – undo
1553 1553
 	{
1554 1554
 		$node = new simple_html_dom_node($this);
1555 1555
 		++$this->cursor;
1556
-		$node->_[HDOM_INFO_TEXT] = '</' . $tag . '>';
1556
+		$node->_[HDOM_INFO_TEXT] = '</'.$tag.'>';
1557 1557
 		$this->link_nodes($node, false);
1558
-		$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1558
+		$this->char = (++$this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1559 1559
 		return true;
1560 1560
 	}
1561 1561
 
1562 1562
 	protected function skip($chars)
1563 1563
 	{
1564 1564
 		$this->pos += strspn($this->doc, $chars, $this->pos);
1565
-		$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1565
+		$this->char = ($this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1566 1566
 	}
1567 1567
 
1568 1568
 	protected function copy_skip($chars)
@@ -1570,8 +1570,8 @@  discard block
 block discarded – undo
1570 1570
 		$pos = $this->pos;
1571 1571
 		$len = strspn($this->doc, $chars, $pos);
1572 1572
 		$this->pos += $len;
1573
-		$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1574
-		if ($len===0) return '';
1573
+		$this->char = ($this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1574
+		if ($len === 0) return '';
1575 1575
 		return substr($this->doc, $pos, $len);
1576 1576
 	}
1577 1577
 
@@ -1580,70 +1580,70 @@  discard block
 block discarded – undo
1580 1580
 		$pos = $this->pos;
1581 1581
 		$len = strcspn($this->doc, $chars, $pos);
1582 1582
 		$this->pos += $len;
1583
-		$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
1583
+		$this->char = ($this->pos < $this->size) ? $this->doc[$this->pos] : null; // next
1584 1584
 		return substr($this->doc, $pos, $len);
1585 1585
 	}
1586 1586
 
1587 1587
 	protected function copy_until_char($char)
1588 1588
 	{
1589
-		if ($this->char===null) return '';
1589
+		if ($this->char === null) return '';
1590 1590
 
1591
-		if (($pos = strpos($this->doc, $char, $this->pos))===false) {
1592
-			$ret = substr($this->doc, $this->pos, $this->size-$this->pos);
1591
+		if (($pos = strpos($this->doc, $char, $this->pos)) === false) {
1592
+			$ret = substr($this->doc, $this->pos, $this->size - $this->pos);
1593 1593
 			$this->char = null;
1594 1594
 			$this->pos = $this->size;
1595 1595
 			return $ret;
1596 1596
 		}
1597 1597
 
1598
-		if ($pos===$this->pos) return '';
1598
+		if ($pos === $this->pos) return '';
1599 1599
 		$pos_old = $this->pos;
1600 1600
 		$this->char = $this->doc[$pos];
1601 1601
 		$this->pos = $pos;
1602
-		return substr($this->doc, $pos_old, $pos-$pos_old);
1602
+		return substr($this->doc, $pos_old, $pos - $pos_old);
1603 1603
 	}
1604 1604
 
1605 1605
 	protected function copy_until_char_escape($char)
1606 1606
 	{
1607
-		if ($this->char===null) return '';
1607
+		if ($this->char === null) return '';
1608 1608
 
1609 1609
 		$start = $this->pos;
1610 1610
 		while (1)
1611 1611
 		{
1612
-			if (($pos = strpos($this->doc, $char, $start))===false)
1612
+			if (($pos = strpos($this->doc, $char, $start)) === false)
1613 1613
 			{
1614
-				$ret = substr($this->doc, $this->pos, $this->size-$this->pos);
1614
+				$ret = substr($this->doc, $this->pos, $this->size - $this->pos);
1615 1615
 				$this->char = null;
1616 1616
 				$this->pos = $this->size;
1617 1617
 				return $ret;
1618 1618
 			}
1619 1619
 
1620
-			if ($pos===$this->pos) return '';
1620
+			if ($pos === $this->pos) return '';
1621 1621
 
1622
-			if ($this->doc[$pos-1]==='\\') {
1623
-				$start = $pos+1;
1622
+			if ($this->doc[$pos - 1] === '\\') {
1623
+				$start = $pos + 1;
1624 1624
 				continue;
1625 1625
 			}
1626 1626
 
1627 1627
 			$pos_old = $this->pos;
1628 1628
 			$this->char = $this->doc[$pos];
1629 1629
 			$this->pos = $pos;
1630
-			return substr($this->doc, $pos_old, $pos-$pos_old);
1630
+			return substr($this->doc, $pos_old, $pos - $pos_old);
1631 1631
 		}
1632 1632
 	}
1633 1633
 
1634 1634
 	// remove noise from html content
1635 1635
 	// save the noise in the $this->noise array.
1636
-	protected function remove_noise($pattern, $remove_tag=false)
1636
+	protected function remove_noise($pattern, $remove_tag = false)
1637 1637
 	{
1638 1638
 		global $debug_object;
1639 1639
 		if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
1640 1640
 
1641 1641
 		$count = preg_match_all($pattern, $this->doc, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE);
1642 1642
 
1643
-		for ($i=$count-1; $i>-1; --$i)
1643
+		for ($i = $count - 1; $i > -1; --$i)
1644 1644
 		{
1645
-			$key = '___noise___'.sprintf('% 5d', count($this->noise)+1000);
1646
-			if (is_object($debug_object)) { $debug_object->debug_log(2, 'key is: ' . $key); }
1645
+			$key = '___noise___'.sprintf('% 5d', count($this->noise) + 1000);
1646
+			if (is_object($debug_object)) { $debug_object->debug_log(2, 'key is: '.$key); }
1647 1647
 			$idx = ($remove_tag) ? 0 : 1;
1648 1648
 			$this->noise[$key] = $matches[$i][$idx][0];
1649 1649
 			$this->doc = substr_replace($this->doc, $key, $matches[$i][$idx][1], strlen($matches[$i][$idx][0]));
@@ -1651,7 +1651,7 @@  discard block
 block discarded – undo
1651 1651
 
1652 1652
 		// reset the length of content
1653 1653
 		$this->size = strlen($this->doc);
1654
-		if ($this->size>0)
1654
+		if ($this->size > 0)
1655 1655
 		{
1656 1656
 			$this->char = $this->doc[0];
1657 1657
 		}
@@ -1663,28 +1663,28 @@  discard block
 block discarded – undo
1663 1663
 		global $debug_object;
1664 1664
 		if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
1665 1665
 
1666
-		while (($pos=strpos($text, '___noise___'))!==false)
1666
+		while (($pos = strpos($text, '___noise___')) !== false)
1667 1667
 		{
1668 1668
 			// Sometimes there is a broken piece of markup, and we don't GET the pos+11 etc... token which indicates a problem outside of us...
1669
-			if (strlen($text) > $pos+15)
1669
+			if (strlen($text) > $pos + 15)
1670 1670
 			{
1671
-				$key = '___noise___'.$text[$pos+11].$text[$pos+12].$text[$pos+13].$text[$pos+14].$text[$pos+15];
1672
-				if (is_object($debug_object)) { $debug_object->debug_log(2, 'located key of: ' . $key); }
1671
+				$key = '___noise___'.$text[$pos + 11].$text[$pos + 12].$text[$pos + 13].$text[$pos + 14].$text[$pos + 15];
1672
+				if (is_object($debug_object)) { $debug_object->debug_log(2, 'located key of: '.$key); }
1673 1673
 
1674 1674
 				if (isset($this->noise[$key]))
1675 1675
 				{
1676
-					$text = substr($text, 0, $pos).$this->noise[$key].substr($text, $pos+16);
1676
+					$text = substr($text, 0, $pos).$this->noise[$key].substr($text, $pos + 16);
1677 1677
 				}
1678 1678
 				else
1679 1679
 				{
1680 1680
 					// do this to prevent an infinite loop.
1681
-					$text = substr($text, 0, $pos).'UNDEFINED NOISE FOR KEY: '.$key . substr($text, $pos+16);
1681
+					$text = substr($text, 0, $pos).'UNDEFINED NOISE FOR KEY: '.$key.substr($text, $pos + 16);
1682 1682
 				}
1683 1683
 			}
1684 1684
 			else
1685 1685
 			{
1686 1686
 				// There is no valid key being given back to us... We must get rid of the ___noise___ or we will have a problem.
1687
-				$text = substr($text, 0, $pos).'NO NUMERIC NOISE KEY' . substr($text, $pos+11);
1687
+				$text = substr($text, 0, $pos).'NO NUMERIC NOISE KEY'.substr($text, $pos + 11);
1688 1688
 			}
1689 1689
 		}
1690 1690
 		return $text;
@@ -1696,9 +1696,9 @@  discard block
 block discarded – undo
1696 1696
 		global $debug_object;
1697 1697
 		if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
1698 1698
 
1699
-		foreach($this->noise as $noiseElement)
1699
+		foreach ($this->noise as $noiseElement)
1700 1700
 		{
1701
-			if (strpos($noiseElement, $text)!==false)
1701
+			if (strpos($noiseElement, $text) !== false)
1702 1702
 			{
1703 1703
 				return $noiseElement;
1704 1704
 			}
@@ -1727,16 +1727,16 @@  discard block
 block discarded – undo
1727 1727
 	}
1728 1728
 
1729 1729
 	// camel naming conventions
1730
-	function childNodes($idx=-1) {return $this->root->childNodes($idx);}
1731
-	function firstChild() {return $this->root->first_child();}
1732
-	function lastChild() {return $this->root->last_child();}
1733
-	function createElement($name, $value=null) {return @str_get_html("<$name>$value</$name>")->first_child();}
1734
-	function createTextNode($value) {return @end(str_get_html($value)->nodes);}
1735
-	function getElementById($id) {return $this->find("#$id", 0);}
1736
-	function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);}
1737
-	function getElementByTagName($name) {return $this->find($name, 0);}
1738
-	function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);}
1739
-	function loadFile() {$args = func_get_args();$this->load_file($args);}
1730
+	function childNodes($idx = -1) {return $this->root->childNodes($idx); }
1731
+	function firstChild() {return $this->root->first_child(); }
1732
+	function lastChild() {return $this->root->last_child(); }
1733
+	function createElement($name, $value = null) {return @str_get_html("<$name>$value</$name>")->first_child(); }
1734
+	function createTextNode($value) {return @end(str_get_html($value)->nodes); }
1735
+	function getElementById($id) {return $this->find("#$id", 0); }
1736
+	function getElementsById($id, $idx = null) {return $this->find("#$id", $idx); }
1737
+	function getElementByTagName($name) {return $this->find($name, 0); }
1738
+	function getElementsByTagName($name, $idx = -1) {return $this->find($name, $idx); }
1739
+	function loadFile() {$args = func_get_args(); $this->load_file($args); }
1740 1740
 }
1741 1741
 
1742 1742
 ?>
1743 1743
\ No newline at end of file
Please login to merge, or discard this patch.
install/class.settings.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 		$Common = new Common();
13 13
 		$settings_filename = '../require/settings.php';
14 14
 		$content = file_get_contents($settings_filename);
15
-		$fh = fopen($settings_filename,'w');
15
+		$fh = fopen($settings_filename, 'w');
16 16
 		foreach ($settings as $settingname => $value) {
17 17
 			if ($value == 'TRUE' || $value == 'FALSE') {
18 18
 				$pattern = '/\R\$'.$settingname." = ".'(TRUE|FALSE)'."/";
@@ -79,21 +79,21 @@  discard block
 block discarded – undo
79 79
 				$replace = "\n".'\$'.$settingname." = '".$value."'";
80 80
 			}
81 81
 			$rep_cnt = 0;
82
-			$content = preg_replace($pattern,$replace,$content,1,$rep_cnt);
82
+			$content = preg_replace($pattern, $replace, $content, 1, $rep_cnt);
83 83
 			
84 84
 			/// If setting was a string and is now an array
85 85
 			if ($rep_cnt === 0 && is_array($value)) {
86 86
 				$pattern = '/\R\$'.$settingname." = '".'(.*)'."'/";
87
-				$content = preg_replace($pattern,$replace,$content,1,$rep_cnt);
87
+				$content = preg_replace($pattern, $replace, $content, 1, $rep_cnt);
88 88
 			}
89 89
 			
90 90
 			// If setting is not in settings.php (for update)
91 91
 			if ($rep_cnt === 0) {
92
-				$content = preg_replace('/\?>/',$replace.";\n?>",$content,1,$rep_cnt);
92
+				$content = preg_replace('/\?>/', $replace.";\n?>", $content, 1, $rep_cnt);
93 93
 			}
94 94
 
95 95
 		}
96
-		fwrite($fh,$content);
96
+		fwrite($fh, $content);
97 97
 		fclose($fh);
98 98
 	}
99 99
 
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
 		$Common = new Common();
106 106
 		$settings_filename = '../require/settings.php';
107 107
 		$content = file_get_contents($settings_filename);
108
-		$fh = fopen($settings_filename,'w');
108
+		$fh = fopen($settings_filename, 'w');
109 109
 		foreach ($settings as $settingname) {
110 110
 			$pattern = '/\R\$'.$settingname." = /";
111 111
 			$replace = '//$'.$settingname." = ";
112
-			$content = preg_replace($pattern,$replace,$content);
112
+			$content = preg_replace($pattern, $replace, $content);
113 113
 		}
114
-		fwrite($fh,$content);
114
+		fwrite($fh, $content);
115 115
 		fclose($fh);
116 116
 	}
117 117
 }
Please login to merge, or discard this patch.
aircraft.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
 	if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') $aircraft_types = $Spotter->getAllAircraftTypes();
20 20
 	$previous = null;
21 21
 	print '<div class="alphabet-legend">';
22
-	foreach($aircraft_types as $value) {
22
+	foreach ($aircraft_types as $value) {
23 23
 		//$firstLetter = substr($value['aircraft_name'], 0, 1);
24 24
 		$firstLetter = substr($value['aircraft_manufacturer'], 0, 1);
25
-		if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
25
+		if ($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
26 26
 		{
27 27
 			if ($previous !== null) print ' | ';
28 28
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	}
32 32
 	print '</div>';
33 33
 	$previous = null;
34
-	foreach($aircraft_types as $value) {
34
+	foreach ($aircraft_types as $value) {
35 35
 		//$firstLetter = substr($value['aircraft_name'], 0, 1);
36 36
 		$firstLetter = substr($value['aircraft_manufacturer'], 0, 1);
37 37
 		if ($firstLetter != "")
38 38
 		{
39
-			if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
39
+			if ($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
40 40
 			{
41 41
 				if ($previous !== null) print '</div>';
42 42
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
ident-statistics-registration.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
11
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
11
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Aircraft by Registration of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Aircraft by Registration of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Aircraft by Registration").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by Registration of flights using the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by Registration of flights using the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 
29 29
 	$aircraft_array = $Spotter->countAllAircraftRegistrationByIdent($ident);
30 30
 	
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		print '</thead>';
43 43
 		print '<tbody>';
44 44
 		$i = 1;
45
-		foreach($aircraft_array as $aircraft_item)
45
+		foreach ($aircraft_array as $aircraft_item)
46 46
 		{
47 47
 			print '<tr>';
48 48
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
accident-detailed.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 {
11 11
 	$date = date('Y-m-d');
12 12
 } else {
13
-	$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
13
+	$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
14 14
 }
15 15
 
16
-if(!isset($_GET['limit']))
16
+if (!isset($_GET['limit']))
17 17
 {
18 18
 	$limit_start = 0;
19 19
 	$limit_end = 25;
@@ -48,25 +48,25 @@  discard block
 block discarded – undo
48 48
 print '<br />';
49 49
 
50 50
 print '<div class="info column">';
51
-if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/',$date)) {
52
-	print '<h1>'.sprintf(_("Accidents from %s"),date("l F j, Y",strtotime($date))).'</h1>';
53
-} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/',$date)) {
54
-	print '<h1>'.sprintf(_("Accidents from %s"),date("F, Y",strtotime($date))).'</h1>';
55
-} elseif (preg_match('/^[0-9]{4}$/',$date)) {
56
-	print '<h1>'.sprintf(_("Accidents from %s"),$date).'</h1>';
51
+if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $date)) {
52
+	print '<h1>'.sprintf(_("Accidents from %s"), date("l F j, Y", strtotime($date))).'</h1>';
53
+} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/', $date)) {
54
+	print '<h1>'.sprintf(_("Accidents from %s"), date("F, Y", strtotime($date))).'</h1>';
55
+} elseif (preg_match('/^[0-9]{4}$/', $date)) {
56
+	print '<h1>'.sprintf(_("Accidents from %s"), $date).'</h1>';
57 57
 }
58 58
 print '</div>';
59 59
 
60 60
 print '<div class="table column">';
61 61
 
62
-if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/',$date)) {
63
-	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."),date("l M j, Y",strtotime($date))).'</p>';
64
-} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/',$date)) {
65
-	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."),date("M, Y",strtotime($date))).'</p>';
66
-} elseif (preg_match('/^[0-9]{4}$/',$date)) {
67
-	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."),$date).'</p>';
62
+if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $date)) {
63
+	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."), date("l M j, Y", strtotime($date))).'</p>';
64
+} elseif (preg_match('/^[0-9]{4}-[0-9]{2}$/', $date)) {
65
+	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."), date("M, Y", strtotime($date))).'</p>';
66
+} elseif (preg_match('/^[0-9]{4}$/', $date)) {
67
+	print '<p>'.sprintf(_("The table below shows the Accidents on <strong>%s</strong>."), $date).'</p>';
68 68
 }
69
-$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference,'accident',$date);
69
+$spotter_array = $Accident->getAccidentData($limit_start.",".$absolute_difference, 'accident', $date);
70 70
 //print_r($spotter_array);
71 71
 if (!empty($spotter_array) && isset($spotter_array[0]['query_number_rows']) && $spotter_array[0]['query_number_rows'] != 0) {
72 72
 	include('table-output.php');
Please login to merge, or discard this patch.