Completed
Push — master ( 56054c...3b6993 )
by Yannick
30:25
created
sitemap.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
15 15
 
16 16
 		$spotter_array = $Spotter->getAllFlightsforSitemap();
17
-		foreach($spotter_array as $spotter_item)
17
+		foreach ($spotter_array as $spotter_item)
18 18
 		{
19 19
 			$output .= '<url>';
20 20
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/flightid/'.$spotter_item['spotter_id'].'</loc>';
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 	$output .= '</urlset>';
26 26
 	
27 27
 	
28
-} else if (isset($_GET['type']) && $_GET['type'] == "aircraft"){
28
+} else if (isset($_GET['type']) && $_GET['type'] == "aircraft") {
29 29
 
30 30
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
31 31
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
32 32
 		$aircraft_types = $Stats->getAllAircraftTypes();
33 33
 		if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
34
-		foreach($aircraft_types as $aircraft_item)
34
+		foreach ($aircraft_types as $aircraft_item)
35 35
 		{
36 36
 			$output .= '<url>';
37 37
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/aircraft/'.urlencode($aircraft_item['aircraft_icao']).'</loc>';
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 	$output .= '</urlset>';
43 43
 	
44 44
 	
45
-} else if (isset($_GET['type']) && $_GET['type'] == "registration"){
45
+} else if (isset($_GET['type']) && $_GET['type'] == "registration") {
46 46
 
47 47
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
48 48
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
49 49
 
50 50
 		$aircraft_registrations = $Spotter->getAllAircraftRegistrations();
51
-		foreach($aircraft_registrations as $aircraft_item)
51
+		foreach ($aircraft_registrations as $aircraft_item)
52 52
 		{
53 53
 			$output .= '<url>';
54 54
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/registration/'.urlencode($aircraft_item['registration']).'</loc>';
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
 		}
59 59
 	$output .= '</urlset>';
60 60
 	
61
-} else if (isset($_GET['type']) && $_GET['type'] == "airline"){
61
+} else if (isset($_GET['type']) && $_GET['type'] == "airline") {
62 62
 
63 63
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
64 64
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
65 65
 
66 66
 		$airline_names = $Stats->getAllAirlineNames();
67
-		foreach($airline_names as $airline_item)
67
+		foreach ($airline_names as $airline_item)
68 68
 		{
69 69
 			$output .= '<url>';
70 70
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/airline/'.urlencode($airline_item['airline_icao']).'</loc>';
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
 		}
75 75
 	$output .= '</urlset>';
76 76
 	
77
-} else if (isset($_GET['type']) && $_GET['type'] == "airport"){
77
+} else if (isset($_GET['type']) && $_GET['type'] == "airport") {
78 78
 
79 79
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
80 80
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
81 81
 
82 82
 		$airport_names = $Stats->getAllAirportNames();
83 83
 		if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
84
-		foreach($airport_names as $airport_item)
84
+		foreach ($airport_names as $airport_item)
85 85
 		{
86 86
 			$output .= '<url>';
87 87
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/airport/'.$airport_item['airport_icao'].'</loc>';
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 		}
92 92
 	$output .= '</urlset>';
93 93
 	
94
-} else if (isset($_GET['type']) && $_GET['type'] == "manufacturer"){
94
+} else if (isset($_GET['type']) && $_GET['type'] == "manufacturer") {
95 95
 
96 96
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
97 97
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
98 98
 
99 99
 		$manufacturer_names = $Stats->getAllManufacturers();
100 100
 		if (empty($manufacturer_names)) $manufacturer_names = $Spotter->getAllManufacturers();
101
-		foreach($manufacturer_names as $manufacturer_item)
101
+		foreach ($manufacturer_names as $manufacturer_item)
102 102
 		{
103 103
 			$output .= '<url>';
104 104
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/manufacturer/'.urlencode(strtolower(str_replace(" ", "-", $manufacturer_item['aircraft_manufacturer']))).'</loc>';
@@ -108,13 +108,13 @@  discard block
 block discarded – undo
108 108
 		}
109 109
 	$output .= '</urlset>';
110 110
 	
111
-} else if (isset($_GET['type']) && $_GET['type'] == "country"){
111
+} else if (isset($_GET['type']) && $_GET['type'] == "country") {
112 112
 
113 113
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
114 114
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
115 115
 
116 116
 		$country_names = $Spotter->getAllCountries();
117
-		foreach($country_names as $country_item)
117
+		foreach ($country_names as $country_item)
118 118
 		{
119 119
 			$output .= '<url>';
120 120
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/country/'.urlencode(strtolower(str_replace(" ", "-", $country_item['country']))).'</loc>';
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
124 124
 		}
125 125
 	$output .= '</urlset>';
126 126
 	
127
-} else if (isset($_GET['type']) && $_GET['type'] == "ident"){
127
+} else if (isset($_GET['type']) && $_GET['type'] == "ident") {
128 128
 
129 129
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
130 130
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
131 131
 
132 132
 		$ident_names = $Spotter->getAllIdents();
133
-		foreach($ident_names as $ident_item)
133
+		foreach ($ident_names as $ident_item)
134 134
 		{
135 135
 			if (ctype_alnum($ident_item['ident'])) {
136 136
 				$output .= '<url>';
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
 		}
143 143
 	$output .= '</urlset>';
144 144
 	
145
-} else if (isset($_GET['type']) && $_GET['type'] == "date"){
145
+} else if (isset($_GET['type']) && $_GET['type'] == "date") {
146 146
 
147 147
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
148 148
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
149 149
 
150 150
 		$date_names = $Spotter->getAllDates();
151
-		foreach($date_names as $date_item)
151
+		foreach ($date_names as $date_item)
152 152
 		{
153 153
 			$output .= '<url>';
154 154
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/date/'.date("Y-m-d", strtotime($date_item['date'])).'</loc>';
@@ -158,13 +158,13 @@  discard block
 block discarded – undo
158 158
 		}
159 159
 	$output .= '</urlset>';
160 160
 	
161
-} else if (isset($_GET['type']) && $_GET['type'] == "route"){
161
+} else if (isset($_GET['type']) && $_GET['type'] == "route") {
162 162
 
163 163
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
164 164
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
165 165
 
166 166
 		$route_names = $Spotter->getAllRoutes();
167
-		foreach($route_names as $route_item)
167
+		foreach ($route_names as $route_item)
168 168
 		{
169 169
 			$output .= '<url>';
170 170
 			    $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/route/'.$route_item['airport_departure_icao'].'/'.$route_item['airport_arrival_icao'].'</loc>';
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		}
175 175
 	$output .= '</urlset>';
176 176
 	
177
-} else if (isset($_GET['type']) && $_GET['type'] == "static"){
177
+} else if (isset($_GET['type']) && $_GET['type'] == "static") {
178 178
 
179 179
 	$output .= '<?xml version="1.0" encoding="UTF-8"?>';
180 180
 	$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
Please login to merge, or discard this patch.