|
@@ -18,22 +18,22 @@ discard block |
|
|
block discarded – undo |
|
18
|
18
|
* @return Array the images list |
|
19
|
19
|
* |
|
20
|
20
|
*/ |
|
21
|
|
- public function getSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
|
|
21
|
+ public function getSpotterImage($registration, $aircraft_icao = '', $airline_icao = '') |
|
22
|
22
|
{ |
|
23
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
24
|
|
- $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
25
|
|
- $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
|
23
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
|
24
|
+ $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
|
25
|
+ $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
26
|
26
|
$reg = $registration; |
|
27
|
27
|
if (($reg == '' || $reg == 'NA') && $aircraft_icao != '') $reg = $aircraft_icao.$airline_icao; |
|
28
|
28
|
$reg = trim($reg); |
|
29
|
|
- $query = "SELECT spotter_image.image, spotter_image.image_thumbnail, spotter_image.image_source, spotter_image.image_source_website,spotter_image.image_copyright, spotter_image.registration |
|
|
29
|
+ $query = "SELECT spotter_image.image, spotter_image.image_thumbnail, spotter_image.image_source, spotter_image.image_source_website,spotter_image.image_copyright, spotter_image.registration |
|
30
|
30
|
FROM spotter_image |
|
31
|
31
|
WHERE spotter_image.registration = :registration LIMIT 1"; |
|
32
|
32
|
$sth = $this->db->prepare($query); |
|
33
|
33
|
$sth->execute(array(':registration' => $reg)); |
|
34
|
34
|
$result = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
35
|
35
|
if (!empty($result)) return $result; |
|
36
|
|
- elseif ($registration != '') return $this->getSpotterImage('',$aircraft_icao,$airline_icao); |
|
|
36
|
+ elseif ($registration != '') return $this->getSpotterImage('', $aircraft_icao, $airline_icao); |
|
37
|
37
|
else return array(); |
|
38
|
38
|
} |
|
39
|
39
|
|
|
@@ -43,23 +43,23 @@ discard block |
|
|
block discarded – undo |
|
43
|
43
|
* @return Array the images list |
|
44
|
44
|
* |
|
45
|
45
|
*/ |
|
46
|
|
- public function getMarineImage($mmsi,$imo = '',$name = '') |
|
|
46
|
+ public function getMarineImage($mmsi, $imo = '', $name = '') |
|
47
|
47
|
{ |
|
48
|
|
- $mmsi = filter_var($mmsi,FILTER_SANITIZE_STRING); |
|
49
|
|
- $imo = filter_var($imo,FILTER_SANITIZE_STRING); |
|
50
|
|
- $name = filter_var($name,FILTER_SANITIZE_STRING); |
|
|
48
|
+ $mmsi = filter_var($mmsi, FILTER_SANITIZE_STRING); |
|
|
49
|
+ $imo = filter_var($imo, FILTER_SANITIZE_STRING); |
|
|
50
|
+ $name = filter_var($name, FILTER_SANITIZE_STRING); |
|
51
|
51
|
$name = trim($name); |
|
52
|
|
- $query = "SELECT marine_image.image, marine_image.image_thumbnail, marine_image.image_source, marine_image.image_source_website,marine_image.image_copyright, marine_image.mmsi, marine_image.imo, marine_image.name |
|
|
52
|
+ $query = "SELECT marine_image.image, marine_image.image_thumbnail, marine_image.image_source, marine_image.image_source_website,marine_image.image_copyright, marine_image.mmsi, marine_image.imo, marine_image.name |
|
53
|
53
|
FROM marine_image |
|
54
|
54
|
WHERE marine_image.mmsi = :mmsi"; |
|
55
|
55
|
$query_data = array(':mmsi' => $mmsi); |
|
56
|
56
|
if ($imo != '') { |
|
57
|
57
|
$query .= " AND marine_image.imo = :imo"; |
|
58
|
|
- $query_data = array_merge($query_data,array(':imo' => $imo)); |
|
|
58
|
+ $query_data = array_merge($query_data, array(':imo' => $imo)); |
|
59
|
59
|
} |
|
60
|
60
|
if ($name != '') { |
|
61
|
61
|
$query .= " AND marine_image.name = :name"; |
|
62
|
|
- $query_data = array_merge($query_data,array(':name' => $name)); |
|
|
62
|
+ $query_data = array_merge($query_data, array(':name' => $name)); |
|
63
|
63
|
} |
|
64
|
64
|
$query .= " LIMIT 1"; |
|
65
|
65
|
$sth = $this->db->prepare($query); |
|
@@ -80,9 +80,9 @@ discard block |
|
|
block discarded – undo |
|
80
|
80
|
if (isset($exif['COMPUTED']['copyright'])) $copyright = $exif['COMPUTED']['copyright']; |
|
81
|
81
|
elseif (isset($exif['copyright'])) $copyright = $exif['copyright']; |
|
82
|
82
|
if ($copyright != '') { |
|
83
|
|
- $copyright = str_replace('Copyright ','',$copyright); |
|
84
|
|
- $copyright = str_replace('© ','',$copyright); |
|
85
|
|
- $copyright = str_replace('(c) ','',$copyright); |
|
|
83
|
+ $copyright = str_replace('Copyright ', '', $copyright); |
|
|
84
|
+ $copyright = str_replace('© ', '', $copyright); |
|
|
85
|
+ $copyright = str_replace('(c) ', '', $copyright); |
|
86
|
86
|
} |
|
87
|
87
|
return $copyright; |
|
88
|
88
|
} |
|
@@ -93,25 +93,25 @@ discard block |
|
|
block discarded – undo |
|
93
|
93
|
* @return String either success or error |
|
94
|
94
|
* |
|
95
|
95
|
*/ |
|
96
|
|
- public function addSpotterImage($registration,$aircraft_icao = '', $airline_icao = '') |
|
|
96
|
+ public function addSpotterImage($registration, $aircraft_icao = '', $airline_icao = '') |
|
97
|
97
|
{ |
|
98
|
|
- global $globalDebug,$globalAircraftImageFetch; |
|
|
98
|
+ global $globalDebug, $globalAircraftImageFetch; |
|
99
|
99
|
if (isset($globalAircraftImageFetch) && !$globalAircraftImageFetch) return ''; |
|
100
|
|
- $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
|
100
|
+ $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
101
|
101
|
$registration = trim($registration); |
|
102
|
102
|
//getting the aircraft image |
|
103
|
103
|
if ($globalDebug && $registration != '') echo 'Try to find an aircraft image for '.$registration.'...'; |
|
104
|
104
|
elseif ($globalDebug && $aircraft_icao != '') echo 'Try to find an aircraft image for '.$aircraft_icao.'...'; |
|
105
|
105
|
elseif ($globalDebug && $airline_icao != '') echo 'Try to find an aircraft image for '.$airline_icao.'...'; |
|
106
|
|
- $image_url = $this->findAircraftImage($registration,$aircraft_icao,$airline_icao); |
|
|
106
|
+ $image_url = $this->findAircraftImage($registration, $aircraft_icao, $airline_icao); |
|
107
|
107
|
if ($registration == '' && $aircraft_icao != '') $registration = $aircraft_icao.$airline_icao; |
|
108
|
108
|
if ($image_url['original'] != '') { |
|
109
|
109
|
if ($globalDebug) echo 'Found !'."\n"; |
|
110
|
|
- $query = "INSERT INTO spotter_image (registration, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:registration,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
|
|
110
|
+ $query = "INSERT INTO spotter_image (registration, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:registration,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
|
111
|
111
|
try { |
|
112
|
112
|
$sth = $this->db->prepare($query); |
|
113
|
|
- $sth->execute(array(':registration' => $registration,':image' => $image_url['original'],':image_thumbnail' => $image_url['thumbnail'], ':copyright' => $image_url['copyright'],':source' => $image_url['source'],':source_website' => $image_url['source_website'])); |
|
114
|
|
- } catch(PDOException $e) { |
|
|
113
|
+ $sth->execute(array(':registration' => $registration, ':image' => $image_url['original'], ':image_thumbnail' => $image_url['thumbnail'], ':copyright' => $image_url['copyright'], ':source' => $image_url['source'], ':source_website' => $image_url['source_website'])); |
|
|
114
|
+ } catch (PDOException $e) { |
|
115
|
115
|
echo $e->getMessage()."\n"; |
|
116
|
116
|
return "error"; |
|
117
|
117
|
} |
|
@@ -125,13 +125,13 @@ discard block |
|
|
block discarded – undo |
|
125
|
125
|
* @return String either success or error |
|
126
|
126
|
* |
|
127
|
127
|
*/ |
|
128
|
|
- public function addMarineImage($mmsi,$imo = '',$name = '') |
|
|
128
|
+ public function addMarineImage($mmsi, $imo = '', $name = '') |
|
129
|
129
|
{ |
|
130
|
|
- global $globalDebug,$globalMarineImageFetch; |
|
|
130
|
+ global $globalDebug, $globalMarineImageFetch; |
|
131
|
131
|
if (isset($globalMarineImageFetch) && !$globalMarineImageFetch) return ''; |
|
132
|
|
- $mmsi = filter_var($mmsi,FILTER_SANITIZE_STRING); |
|
133
|
|
- $imo = filter_var($imo,FILTER_SANITIZE_STRING); |
|
134
|
|
- $name = filter_var($name,FILTER_SANITIZE_STRING); |
|
|
132
|
+ $mmsi = filter_var($mmsi, FILTER_SANITIZE_STRING); |
|
|
133
|
+ $imo = filter_var($imo, FILTER_SANITIZE_STRING); |
|
|
134
|
+ $name = filter_var($name, FILTER_SANITIZE_STRING); |
|
135
|
135
|
$name = trim($name); |
|
136
|
136
|
$Marine = new Marine($this->db); |
|
137
|
137
|
if ($imo == '' || $name == '') { |
|
@@ -145,14 +145,14 @@ discard block |
|
|
block discarded – undo |
|
145
|
145
|
|
|
146
|
146
|
//getting the aircraft image |
|
147
|
147
|
if ($globalDebug && $name != '') echo 'Try to find an vessel image for '.$name.'...'; |
|
148
|
|
- $image_url = $this->findMarineImage($mmsi,$imo,$name); |
|
|
148
|
+ $image_url = $this->findMarineImage($mmsi, $imo, $name); |
|
149
|
149
|
if ($image_url['original'] != '') { |
|
150
|
150
|
if ($globalDebug) echo 'Found !'."\n"; |
|
151
|
|
- $query = "INSERT INTO marine_image (mmsi,imo,name, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:mmsi,:imo,:name,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
|
|
151
|
+ $query = "INSERT INTO marine_image (mmsi,imo,name, image, image_thumbnail, image_copyright, image_source,image_source_website) VALUES (:mmsi,:imo,:name,:image,:image_thumbnail,:copyright,:source,:source_website)"; |
|
152
|
152
|
try { |
|
153
|
153
|
$sth = $this->db->prepare($query); |
|
154
|
|
- $sth->execute(array(':mmsi' => $mmsi,':imo' => $imo,':name' => $name,':image' => $image_url['original'],':image_thumbnail' => $image_url['thumbnail'], ':copyright' => $image_url['copyright'],':source' => $image_url['source'],':source_website' => $image_url['source_website'])); |
|
155
|
|
- } catch(PDOException $e) { |
|
|
154
|
+ $sth->execute(array(':mmsi' => $mmsi, ':imo' => $imo, ':name' => $name, ':image' => $image_url['original'], ':image_thumbnail' => $image_url['thumbnail'], ':copyright' => $image_url['copyright'], ':source' => $image_url['source'], ':source_website' => $image_url['source_website'])); |
|
|
155
|
+ } catch (PDOException $e) { |
|
156
|
156
|
echo $e->getMessage()."\n"; |
|
157
|
157
|
return "error"; |
|
158
|
158
|
} |
|
@@ -172,9 +172,9 @@ discard block |
|
|
block discarded – undo |
|
172
|
172
|
global $globalAircraftImageSources, $globalIVAO, $globalAircraftImageCheckICAO, $globalVA; |
|
173
|
173
|
$Spotter = new Spotter($this->db); |
|
174
|
174
|
if (!isset($globalIVAO)) $globalIVAO = FALSE; |
|
175
|
|
- $aircraft_registration = filter_var($aircraft_registration,FILTER_SANITIZE_STRING); |
|
|
175
|
+ $aircraft_registration = filter_var($aircraft_registration, FILTER_SANITIZE_STRING); |
|
176
|
176
|
if ($aircraft_registration != '' && $aircraft_registration != 'NA' && (!isset($globalVA) || $globalVA !== TRUE)) { |
|
177
|
|
- if (strpos($aircraft_registration,'/') !== false) return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
|
|
177
|
+ if (strpos($aircraft_registration, '/') !== false) return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
178
|
178
|
$aircraft_registration = urlencode(trim($aircraft_registration)); |
|
179
|
179
|
$aircraft_info = $Spotter->getAircraftInfoByRegistration($aircraft_registration); |
|
180
|
180
|
if (isset($aircraft_info[0]['aircraft_name'])) $aircraft_name = $aircraft_info[0]['aircraft_name']; |
|
@@ -188,25 +188,25 @@ discard block |
|
|
block discarded – undo |
|
188
|
188
|
if (isset($aircraft_info[0]['type'])) $aircraft_name = $aircraft_info[0]['type']; |
|
189
|
189
|
else $aircraft_name = ''; |
|
190
|
190
|
$aircraft_registration = $aircraft_icao; |
|
191
|
|
- } else return array('thumbnail' => '','original' => '', 'copyright' => '', 'source' => '','source_website' => ''); |
|
|
191
|
+ } else return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
192
|
192
|
unset($Spotter); |
|
193
|
|
- if (!isset($globalAircraftImageSources)) $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
|
193
|
+ if (!isset($globalAircraftImageSources)) $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
194
|
194
|
foreach ($globalAircraftImageSources as $source) { |
|
195
|
195
|
$source = strtolower($source); |
|
196
|
|
- if ($source == 'ivaomtl' && $globalIVAO && $aircraft_icao != '' && $airline_icao != '') $images_array = $this->fromIvaoMtl('aircraft',$aircraft_icao,$airline_icao); |
|
197
|
|
- if ($source == 'planespotters' && !$globalIVAO && extension_loaded('simplexml')) $images_array = $this->fromPlanespotters('aircraft',$aircraft_registration,$aircraft_name); |
|
198
|
|
- if ($source == 'flickr' && extension_loaded('simplexml')) $images_array = $this->fromFlickr('aircraft',$aircraft_registration,$aircraft_name); |
|
199
|
|
- if ($source == 'bing') $images_array = $this->fromBing('aircraft',$aircraft_registration,$aircraft_name); |
|
200
|
|
- if ($source == 'deviantart' && extension_loaded('simplexml')) $images_array = $this->fromDeviantart('aircraft',$aircraft_registration,$aircraft_name); |
|
201
|
|
- if ($source == 'wikimedia') $images_array = $this->fromWikimedia('aircraft',$aircraft_registration,$aircraft_name); |
|
202
|
|
- if ($source == 'jetphotos' && !$globalIVAO && class_exists("DomDocument")) $images_array = $this->fromJetPhotos('aircraft',$aircraft_registration,$aircraft_name); |
|
203
|
|
- if ($source == 'planepictures' && !$globalIVAO && class_exists("DomDocument")) $images_array = $this->fromPlanePictures('aircraft',$aircraft_registration,$aircraft_name); |
|
204
|
|
- if ($source == 'airportdata' && !$globalIVAO) $images_array = $this->fromAirportData('aircraft',$aircraft_registration,$aircraft_name); |
|
205
|
|
- if ($source == 'customsources') $images_array = $this->fromCustomSource('aircraft',$aircraft_registration,$aircraft_name); |
|
|
196
|
+ if ($source == 'ivaomtl' && $globalIVAO && $aircraft_icao != '' && $airline_icao != '') $images_array = $this->fromIvaoMtl('aircraft', $aircraft_icao, $airline_icao); |
|
|
197
|
+ if ($source == 'planespotters' && !$globalIVAO && extension_loaded('simplexml')) $images_array = $this->fromPlanespotters('aircraft', $aircraft_registration, $aircraft_name); |
|
|
198
|
+ if ($source == 'flickr' && extension_loaded('simplexml')) $images_array = $this->fromFlickr('aircraft', $aircraft_registration, $aircraft_name); |
|
|
199
|
+ if ($source == 'bing') $images_array = $this->fromBing('aircraft', $aircraft_registration, $aircraft_name); |
|
|
200
|
+ if ($source == 'deviantart' && extension_loaded('simplexml')) $images_array = $this->fromDeviantart('aircraft', $aircraft_registration, $aircraft_name); |
|
|
201
|
+ if ($source == 'wikimedia') $images_array = $this->fromWikimedia('aircraft', $aircraft_registration, $aircraft_name); |
|
|
202
|
+ if ($source == 'jetphotos' && !$globalIVAO && class_exists("DomDocument")) $images_array = $this->fromJetPhotos('aircraft', $aircraft_registration, $aircraft_name); |
|
|
203
|
+ if ($source == 'planepictures' && !$globalIVAO && class_exists("DomDocument")) $images_array = $this->fromPlanePictures('aircraft', $aircraft_registration, $aircraft_name); |
|
|
204
|
+ if ($source == 'airportdata' && !$globalIVAO) $images_array = $this->fromAirportData('aircraft', $aircraft_registration, $aircraft_name); |
|
|
205
|
+ if ($source == 'customsources') $images_array = $this->fromCustomSource('aircraft', $aircraft_registration, $aircraft_name); |
|
206
|
206
|
if (isset($images_array) && $images_array['original'] != '') return $images_array; |
|
207
|
207
|
} |
|
208
|
208
|
if ((!isset($globalAircraftImageCheckICAO) || $globalAircraftImageCheckICAO === TRUE) && isset($aircraft_icao)) return $this->findAircraftImage($aircraft_icao); |
|
209
|
|
- return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
|
|
209
|
+ return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
210
|
210
|
} |
|
211
|
211
|
|
|
212
|
212
|
/** |
|
@@ -218,14 +218,14 @@ discard block |
|
|
block discarded – undo |
|
218
|
218
|
* @return Array the aircraft thumbnail, orignal url and copyright |
|
219
|
219
|
* |
|
220
|
220
|
*/ |
|
221
|
|
- public function findMarineImage($mmsi,$imo = '',$name = '') |
|
|
221
|
+ public function findMarineImage($mmsi, $imo = '', $name = '') |
|
222
|
222
|
{ |
|
223
|
223
|
global $globalMarineImageSources; |
|
224
|
|
- $mmsi = filter_var($mmsi,FILTER_SANITIZE_STRING); |
|
|
224
|
+ $mmsi = filter_var($mmsi, FILTER_SANITIZE_STRING); |
|
225
|
225
|
//$imo = filter_var($imo,FILTER_SANITIZE_STRING); |
|
226
|
|
- $name = filter_var($name,FILTER_SANITIZE_STRING); |
|
|
226
|
+ $name = filter_var($name, FILTER_SANITIZE_STRING); |
|
227
|
227
|
$name = trim($name); |
|
228
|
|
- if (strlen($name) < 4) return array('thumbnail' => '','original' => '', 'copyright' => '', 'source' => '','source_website' => ''); |
|
|
228
|
+ if (strlen($name) < 4) return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
229
|
229
|
/* |
|
230
|
230
|
$Marine = new Marine($this->db); |
|
231
|
231
|
if ($imo == '' || $name == '') { |
|
@@ -237,17 +237,17 @@ discard block |
|
|
block discarded – undo |
|
237
|
237
|
} |
|
238
|
238
|
unset($Marine); |
|
239
|
239
|
*/ |
|
240
|
|
- if (!isset($globalMarineImageSources)) $globalMarineImageSources = array('wikimedia','deviantart','flickr','bing'); |
|
|
240
|
+ if (!isset($globalMarineImageSources)) $globalMarineImageSources = array('wikimedia', 'deviantart', 'flickr', 'bing'); |
|
241
|
241
|
foreach ($globalMarineImageSources as $source) { |
|
242
|
242
|
$source = strtolower($source); |
|
243
|
|
- if ($source == 'flickr') $images_array = $this->fromFlickr('marine',$mmsi,$name); |
|
244
|
|
- if ($source == 'bing') $images_array = $this->fromBing('marine',$mmsi,$name); |
|
245
|
|
- if ($source == 'deviantart') $images_array = $this->fromDeviantart('marine',$mmsi,$name); |
|
246
|
|
- if ($source == 'wikimedia') $images_array = $this->fromWikimedia('marine',$mmsi,$name); |
|
247
|
|
- if ($source == 'customsources') $images_array = $this->fromCustomSource('marine',$mmsi,$name); |
|
|
243
|
+ if ($source == 'flickr') $images_array = $this->fromFlickr('marine', $mmsi, $name); |
|
|
244
|
+ if ($source == 'bing') $images_array = $this->fromBing('marine', $mmsi, $name); |
|
|
245
|
+ if ($source == 'deviantart') $images_array = $this->fromDeviantart('marine', $mmsi, $name); |
|
|
246
|
+ if ($source == 'wikimedia') $images_array = $this->fromWikimedia('marine', $mmsi, $name); |
|
|
247
|
+ if ($source == 'customsources') $images_array = $this->fromCustomSource('marine', $mmsi, $name); |
|
248
|
248
|
if (isset($images_array) && $images_array['original'] != '') return $images_array; |
|
249
|
249
|
} |
|
250
|
|
- return array('thumbnail' => '','original' => '', 'copyright' => '','source' => '','source_website' => ''); |
|
|
250
|
+ return array('thumbnail' => '', 'original' => '', 'copyright' => '', 'source' => '', 'source_website' => ''); |
|
251
|
251
|
} |
|
252
|
252
|
|
|
253
|
253
|
/** |
|
@@ -258,25 +258,25 @@ discard block |
|
|
block discarded – undo |
|
258
|
258
|
* @return Array the aircraft thumbnail, orignal url and copyright |
|
259
|
259
|
* |
|
260
|
260
|
*/ |
|
261
|
|
- public function fromPlanespotters($type,$aircraft_registration, $aircraft_name='') { |
|
|
261
|
+ public function fromPlanespotters($type, $aircraft_registration, $aircraft_name = '') { |
|
262
|
262
|
$Common = new Common(); |
|
263
|
263
|
// If aircraft registration is only number, also check with aircraft model |
|
264
|
|
- if (preg_match('/^[[:digit]]+$/',$aircraft_registration) && $aircraft_name != '') { |
|
265
|
|
- $url= 'http://www.planespotters.net/Aviation_Photos/search.php?tag='.$aircraft_registration.'&actype=s_'.urlencode($aircraft_name).'&output=rss'; |
|
|
264
|
+ if (preg_match('/^[[:digit]]+$/', $aircraft_registration) && $aircraft_name != '') { |
|
|
265
|
+ $url = 'http://www.planespotters.net/Aviation_Photos/search.php?tag='.$aircraft_registration.'&actype=s_'.urlencode($aircraft_name).'&output=rss'; |
|
266
|
266
|
} else { |
|
267
|
267
|
//$url= 'http://www.planespotters.net/Aviation_Photos/search.php?tag='.$airline_aircraft_type.'&output=rss'; |
|
268
|
|
- $url= 'http://www.planespotters.net/Aviation_Photos/search.php?reg='.$aircraft_registration.'&output=rss'; |
|
|
268
|
+ $url = 'http://www.planespotters.net/Aviation_Photos/search.php?reg='.$aircraft_registration.'&output=rss'; |
|
269
|
269
|
} |
|
270
|
270
|
$data = $Common->getData($url); |
|
271
|
271
|
if (substr($data, 0, 5) != "<?xml") return false; |
|
272
|
272
|
if ($xml = simplexml_load_string($data)) { |
|
273
|
273
|
if (isset($xml->channel->item)) { |
|
274
|
274
|
$image_url = array(); |
|
275
|
|
- $thumbnail_url = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
|
275
|
+ $thumbnail_url = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
276
|
276
|
$image_url['thumbnail'] = $thumbnail_url; |
|
277
|
|
- $image_url['original'] = str_replace('thumbnail','original',$thumbnail_url); |
|
278
|
|
- $image_url['copyright'] = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright); |
|
279
|
|
- $image_url['source_website'] = trim((string)$xml->channel->item->link); |
|
|
277
|
+ $image_url['original'] = str_replace('thumbnail', 'original', $thumbnail_url); |
|
|
278
|
+ $image_url['copyright'] = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright); |
|
|
279
|
+ $image_url['source_website'] = trim((string) $xml->channel->item->link); |
|
280
|
280
|
$image_url['source'] = 'planespotters'; |
|
281
|
281
|
return $image_url; |
|
282
|
282
|
} |
|
@@ -292,31 +292,31 @@ discard block |
|
|
block discarded – undo |
|
292
|
292
|
* @return Array the aircraft thumbnail, orignal url and copyright |
|
293
|
293
|
* |
|
294
|
294
|
*/ |
|
295
|
|
- public function fromDeviantart($type,$registration, $name='') { |
|
|
295
|
+ public function fromDeviantart($type, $registration, $name = '') { |
|
296
|
296
|
$Common = new Common(); |
|
297
|
297
|
if ($type == 'aircraft') { |
|
298
|
298
|
// If aircraft registration is only number, also check with aircraft model |
|
299
|
|
- if (preg_match('/^[[:digit]]+$/',$registration) && $name != '') { |
|
300
|
|
- $url= 'http://backend.deviantart.com/rss.xml?type=deviation&q='.$registration.'%20'.urlencode($name); |
|
|
299
|
+ if (preg_match('/^[[:digit]]+$/', $registration) && $name != '') { |
|
|
300
|
+ $url = 'http://backend.deviantart.com/rss.xml?type=deviation&q='.$registration.'%20'.urlencode($name); |
|
301
|
301
|
} else { |
|
302
|
|
- $url= 'http://backend.deviantart.com/rss.xml?type=deviation&q=aircraft%20'.$registration; |
|
|
302
|
+ $url = 'http://backend.deviantart.com/rss.xml?type=deviation&q=aircraft%20'.$registration; |
|
303
|
303
|
} |
|
304
|
304
|
} elseif ($type == 'marine') { |
|
305
|
|
- $url= 'http://backend.deviantart.com/rss.xml?type=deviation&q=ship%20"'.urlencode($name).'"'; |
|
|
305
|
+ $url = 'http://backend.deviantart.com/rss.xml?type=deviation&q=ship%20"'.urlencode($name).'"'; |
|
306
|
306
|
} else { |
|
307
|
|
- $url= 'http://backend.deviantart.com/rss.xml?type=deviation&q="'.urlencode($name).'"'; |
|
|
307
|
+ $url = 'http://backend.deviantart.com/rss.xml?type=deviation&q="'.urlencode($name).'"'; |
|
308
|
308
|
} |
|
309
|
309
|
$data = $Common->getData($url); |
|
310
|
310
|
if (substr($data, 0, 5) != "<?xml") return false; |
|
311
|
311
|
if ($xml = simplexml_load_string($data)) { |
|
312
|
312
|
if (isset($xml->channel->item->link)) { |
|
313
|
313
|
$image_url = array(); |
|
314
|
|
- $thumbnail_url = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
|
314
|
+ $thumbnail_url = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->thumbnail->attributes()->url); |
|
315
|
315
|
$image_url['thumbnail'] = $thumbnail_url; |
|
316
|
|
- $original_url = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->content->attributes()->url); |
|
|
316
|
+ $original_url = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->content->attributes()->url); |
|
317
|
317
|
$image_url['original'] = $original_url; |
|
318
|
|
- $image_url['copyright'] = str_replace('Copyright ','',trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright)); |
|
319
|
|
- $image_url['source_website'] = trim((string)$xml->channel->item->link); |
|
|
318
|
+ $image_url['copyright'] = str_replace('Copyright ', '', trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->copyright)); |
|
|
319
|
+ $image_url['source_website'] = trim((string) $xml->channel->item->link); |
|
320
|
320
|
$image_url['source'] = 'deviantart'; |
|
321
|
321
|
return $image_url; |
|
322
|
322
|
} |
|
@@ -332,32 +332,32 @@ discard block |
|
|
block discarded – undo |
|
332
|
332
|
* @return Array the aircraft thumbnail, orignal url and copyright |
|
333
|
333
|
* |
|
334
|
334
|
*/ |
|
335
|
|
- public function fromJetPhotos($type,$aircraft_registration, $aircraft_name='') { |
|
|
335
|
+ public function fromJetPhotos($type, $aircraft_registration, $aircraft_name = '') { |
|
336
|
336
|
$Common = new Common(); |
|
337
|
|
- $url= 'http://jetphotos.net/showphotos.php?displaymode=2®search='.$aircraft_registration; |
|
|
337
|
+ $url = 'http://jetphotos.net/showphotos.php?displaymode=2®search='.$aircraft_registration; |
|
338
|
338
|
$data = $Common->getData($url); |
|
339
|
339
|
$dom = new DOMDocument(); |
|
340
|
340
|
@$dom->loadHTML($data); |
|
341
|
341
|
$all_pics = array(); |
|
342
|
|
- foreach($dom->getElementsByTagName('img') as $image) { |
|
|
342
|
+ foreach ($dom->getElementsByTagName('img') as $image) { |
|
343
|
343
|
if ($image->getAttribute('itemprop') == "http://schema.org/image") { |
|
344
|
344
|
$all_pics[] = $image->getAttribute('src'); |
|
345
|
345
|
} |
|
346
|
346
|
} |
|
347
|
347
|
$all_authors = array(); |
|
348
|
|
- foreach($dom->getElementsByTagName('meta') as $author) { |
|
|
348
|
+ foreach ($dom->getElementsByTagName('meta') as $author) { |
|
349
|
349
|
if ($author->getAttribute('itemprop') == "http://schema.org/author") { |
|
350
|
350
|
$all_authors[] = $author->getAttribute('content'); |
|
351
|
351
|
} |
|
352
|
352
|
} |
|
353
|
353
|
$all_ref = array(); |
|
354
|
|
- foreach($dom->getElementsByTagName('a') as $link) { |
|
|
354
|
+ foreach ($dom->getElementsByTagName('a') as $link) { |
|
355
|
355
|
$all_ref[] = $link->getAttribute('href'); |
|
356
|
356
|
} |
|
357
|
357
|
if (isset($all_pics[0])) { |
|
358
|
358
|
$image_url = array(); |
|
359
|
359
|
$image_url['thumbnail'] = $all_pics[0]; |
|
360
|
|
- $image_url['original'] = str_replace('_tb','',$all_pics[0]); |
|
|
360
|
+ $image_url['original'] = str_replace('_tb', '', $all_pics[0]); |
|
361
|
361
|
$image_url['copyright'] = $all_authors[0]; |
|
362
|
362
|
$image_url['source_website'] = 'http://jetphotos.net'.$all_ref[8]; |
|
363
|
363
|
$image_url['source'] = 'JetPhotos'; |
|
@@ -374,24 +374,24 @@ discard block |
|
|
block discarded – undo |
|
374
|
374
|
* @return Array the aircraft thumbnail, orignal url and copyright |
|
375
|
375
|
* |
|
376
|
376
|
*/ |
|
377
|
|
- public function fromPlanePictures($type,$aircraft_registration, $aircraft_name='') { |
|
|
377
|
+ public function fromPlanePictures($type, $aircraft_registration, $aircraft_name = '') { |
|
378
|
378
|
$Common = new Common(); |
|
379
|
|
- $url= 'http://www.planepictures.net/netsearch4.cgi?srch='.$aircraft_registration.'&stype=reg&srng=2'; |
|
|
379
|
+ $url = 'http://www.planepictures.net/netsearch4.cgi?srch='.$aircraft_registration.'&stype=reg&srng=2'; |
|
380
|
380
|
$data = $Common->getData($url); |
|
381
|
381
|
$dom = new DOMDocument(); |
|
382
|
382
|
@$dom->loadHTML($data); |
|
383
|
383
|
$all_pics = array(); |
|
384
|
|
- foreach($dom->getElementsByTagName('img') as $image) { |
|
|
384
|
+ foreach ($dom->getElementsByTagName('img') as $image) { |
|
385
|
385
|
$all_pics[] = $image->getAttribute('src'); |
|
386
|
386
|
} |
|
387
|
387
|
$all_links = array(); |
|
388
|
|
- foreach($dom->getElementsByTagName('a') as $link) { |
|
389
|
|
- $all_links[] = array('text' => $link->textContent,'href' => $link->getAttribute('href')); |
|
|
388
|
+ foreach ($dom->getElementsByTagName('a') as $link) { |
|
|
389
|
+ $all_links[] = array('text' => $link->textContent, 'href' => $link->getAttribute('href')); |
|
390
|
390
|
} |
|
391
|
|
- if (isset($all_pics[1]) && !preg_match('/bit.ly/',$all_pics[1]) && !preg_match('/flagge/',$all_pics[1])) { |
|
|
391
|
+ if (isset($all_pics[1]) && !preg_match('/bit.ly/', $all_pics[1]) && !preg_match('/flagge/', $all_pics[1])) { |
|
392
|
392
|
$image_url = array(); |
|
393
|
393
|
$image_url['thumbnail'] = 'http://www.planepictures.net/'.$all_pics[1]; |
|
394
|
|
- $image_url['original'] = 'http://www.planepictures.net/'.str_replace('_TN','',$all_pics[1]); |
|
|
394
|
+ $image_url['original'] = 'http://www.planepictures.net/'.str_replace('_TN', '', $all_pics[1]); |
|
395
|
395
|
$image_url['copyright'] = $all_links[6]['text']; |
|
396
|
396
|
$image_url['source_website'] = 'http://www.planepictures.net/'.$all_links[2]['href']; |
|
397
|
397
|
$image_url['source'] = 'PlanePictures'; |
|
@@ -408,7 +408,7 @@ discard block |
|
|
block discarded – undo |
|
408
|
408
|
* @return Array the aircraft thumbnail, orignal url and copyright |
|
409
|
409
|
* |
|
410
|
410
|
*/ |
|
411
|
|
- public function fromFlickr($type,$registration,$name='') { |
|
|
411
|
+ public function fromFlickr($type, $registration, $name = '') { |
|
412
|
412
|
$Common = new Common(); |
|
413
|
413
|
if ($type == 'aircraft') { |
|
414
|
414
|
if ($name != '') $url = 'https://api.flickr.com/services/feeds/photos_public.gne?format=rss2&license=1,2,3,4,5,6,7&per_page=1&tags='.$registration.','.urlencode($name); |
|
@@ -421,12 +421,12 @@ discard block |
|
|
block discarded – undo |
|
421
|
421
|
if (substr($data, 0, 5) != "<?xml") return false; |
|
422
|
422
|
if ($xml = simplexml_load_string($data)) { |
|
423
|
423
|
if (isset($xml->channel->item)) { |
|
424
|
|
- $original_url = trim((string)$xml->channel->item->enclosure->attributes()->url); |
|
|
424
|
+ $original_url = trim((string) $xml->channel->item->enclosure->attributes()->url); |
|
425
|
425
|
$image_url = array(); |
|
426
|
426
|
$image_url['thumbnail'] = $original_url; |
|
427
|
427
|
$image_url['original'] = $original_url; |
|
428
|
|
- $image_url['copyright'] = trim((string)$xml->channel->item->children('http://search.yahoo.com/mrss/')->credit); |
|
429
|
|
- $image_url['source_website'] = trim((string)$xml->channel->item->link); |
|
|
428
|
+ $image_url['copyright'] = trim((string) $xml->channel->item->children('http://search.yahoo.com/mrss/')->credit); |
|
|
429
|
+ $image_url['source_website'] = trim((string) $xml->channel->item->link); |
|
430
|
430
|
$image_url['source'] = 'flickr'; |
|
431
|
431
|
return $image_url; |
|
432
|
432
|
} |
|
@@ -434,7 +434,7 @@ discard block |
|
|
block discarded – undo |
|
434
|
434
|
return false; |
|
435
|
435
|
} |
|
436
|
436
|
|
|
437
|
|
- public function fromIvaoMtl($type,$aircraft_icao,$airline_icao) { |
|
|
437
|
+ public function fromIvaoMtl($type, $aircraft_icao, $airline_icao) { |
|
438
|
438
|
$Common = new Common(); |
|
439
|
439
|
//echo "\n".'SEARCH IMAGE : http://mtlcatalog.ivao.aero/images/aircraft/'.$aircraft_icao.$airline_icao.'.jpg'; |
|
440
|
440
|
if ($Common->urlexist('http://mtlcatalog.ivao.aero/images/aircraft/'.$aircraft_icao.$airline_icao.'.jpg')) { |
|
@@ -458,7 +458,7 @@ discard block |
|
|
block discarded – undo |
|
458
|
458
|
* @return Array the aircraft thumbnail, orignal url and copyright |
|
459
|
459
|
* |
|
460
|
460
|
*/ |
|
461
|
|
- public function fromBing($type,$aircraft_registration,$aircraft_name='') { |
|
|
461
|
+ public function fromBing($type, $aircraft_registration, $aircraft_name = '') { |
|
462
|
462
|
global $globalImageBingKey; |
|
463
|
463
|
$Common = new Common(); |
|
464
|
464
|
if (!isset($globalImageBingKey) || $globalImageBingKey == '') return false; |
|
@@ -469,8 +469,8 @@ discard block |
|
|
block discarded – undo |
|
469
|
469
|
if ($aircraft_name != '') $url = 'https://api.datamarket.azure.com/Bing/Search/v1/Image?$format=json&$top=1&Query=%27'.urlencode($aircraft_name).'%20%2Bship%20-site:flickr.com%27'; |
|
470
|
470
|
else $url = 'https://api.datamarket.azure.com/Bing/Search/v1/Image?$format=json&$top=1&Query=%27%2B'.$aircraft_registration.'%20%2Bship%20-site:flickr.com%27'; |
|
471
|
471
|
} |
|
472
|
|
- $headers = array("Authorization: Basic " . base64_encode("ignored:".$globalImageBingKey)); |
|
473
|
|
- $data = $Common->getData($url,'get','',$headers); |
|
|
472
|
+ $headers = array("Authorization: Basic ".base64_encode("ignored:".$globalImageBingKey)); |
|
|
473
|
+ $data = $Common->getData($url, 'get', '', $headers); |
|
474
|
474
|
$result = json_decode($data); |
|
475
|
475
|
if (isset($result->d->results[0]->MediaUrl)) { |
|
476
|
476
|
$image_url = array(); |
|
@@ -495,14 +495,14 @@ discard block |
|
|
block discarded – undo |
|
495
|
495
|
* @return Array the aircraft thumbnail, orignal url and copyright |
|
496
|
496
|
* |
|
497
|
497
|
*/ |
|
498
|
|
- public function fromAirportData($type,$aircraft_registration,$aircraft_name='') { |
|
|
498
|
+ public function fromAirportData($type, $aircraft_registration, $aircraft_name = '') { |
|
499
|
499
|
$Common = new Common(); |
|
500
|
500
|
$url = 'http://www.airport-data.com/api/ac_thumb.json?&n=1&r='.$aircraft_registration; |
|
501
|
501
|
$data = $Common->getData($url); |
|
502
|
502
|
$result = json_decode($data); |
|
503
|
503
|
if (isset($result->count) && $result->count > 0) { |
|
504
|
504
|
$image_url = array(); |
|
505
|
|
- $image_url['original'] = str_replace('thumbnails','large',$result->data[0]->image); |
|
|
505
|
+ $image_url['original'] = str_replace('thumbnails', 'large', $result->data[0]->image); |
|
506
|
506
|
$image_url['source_website'] = $result->data[0]->link; |
|
507
|
507
|
$image_url['thumbnail'] = $result->data[0]->image; |
|
508
|
508
|
$image_url['copyright'] = $result->data[0]->photographer; |
|
@@ -520,7 +520,7 @@ discard block |
|
|
block discarded – undo |
|
520
|
520
|
* @return Array the aircraft thumbnail, orignal url and copyright |
|
521
|
521
|
* |
|
522
|
522
|
*/ |
|
523
|
|
- public function fromWikimedia($type,$registration,$name='') { |
|
|
523
|
+ public function fromWikimedia($type, $registration, $name = '') { |
|
524
|
524
|
$Common = new Common(); |
|
525
|
525
|
if ($type == 'aircraft') { |
|
526
|
526
|
if ($name != '') $url = 'https://commons.wikimedia.org/w/api.php?action=query&list=search&format=json&srlimit=1&srnamespace=6&continue&srsearch="'.$registration.'"%20'.urlencode($name); |
|
@@ -533,7 +533,7 @@ discard block |
|
|
block discarded – undo |
|
533
|
533
|
$result = json_decode($data); |
|
534
|
534
|
if (isset($result->query->search[0]->title)) { |
|
535
|
535
|
$fileo = $result->query->search[0]->title; |
|
536
|
|
- if (substr($fileo,-3) == 'pdf') return false; |
|
|
536
|
+ if (substr($fileo, -3) == 'pdf') return false; |
|
537
|
537
|
$file = urlencode($fileo); |
|
538
|
538
|
$url2 = 'https://commons.wikimedia.org/w/api.php?action=query&format=json&continue&iilimit=500&prop=imageinfo&iiprop=user|url|size|mime|sha1|timestamp&iiurlwidth=200%27&titles='.$file; |
|
539
|
539
|
$data2 = $Common->getData($url2); |
|
@@ -558,11 +558,11 @@ discard block |
|
|
block discarded – undo |
|
558
|
558
|
if (isset($result2->query->pages)) { |
|
559
|
559
|
foreach ($result2->query->pages as $page) { |
|
560
|
560
|
if (isset($page->imageinfo[0]->extmetadata->Artist)) { |
|
561
|
|
- $image_url['copyright'] = preg_replace('/ from(.*)/','',strip_tags($page->imageinfo[0]->extmetadata->Artist->value)); |
|
|
561
|
+ $image_url['copyright'] = preg_replace('/ from(.*)/', '', strip_tags($page->imageinfo[0]->extmetadata->Artist->value)); |
|
562
|
562
|
if (isset($page->imageinfo[0]->extmetadata->License->value)) { |
|
563
|
563
|
$image_url['copyright'] = $image_url['copyright'].' (under '.$page->imageinfo[0]->extmetadata->License->value.')'; |
|
564
|
564
|
} |
|
565
|
|
- $image_url['copyright'] = trim(str_replace('\n','',$image_url['copyright'])); |
|
|
565
|
+ $image_url['copyright'] = trim(str_replace('\n', '', $image_url['copyright'])); |
|
566
|
566
|
return $image_url; |
|
567
|
567
|
} |
|
568
|
568
|
} |
|
@@ -581,7 +581,7 @@ discard block |
|
|
block discarded – undo |
|
581
|
581
|
* @return Array the aircraft thumbnail, orignal url and copyright |
|
582
|
582
|
* |
|
583
|
583
|
*/ |
|
584
|
|
- public function fromCustomSource($type,$registration,$name='') { |
|
|
584
|
+ public function fromCustomSource($type, $registration, $name = '') { |
|
585
|
585
|
global $globalAircraftImageCustomSources, $globalMarineImageCustomSources, $globalDebug; |
|
586
|
586
|
//$globalAircraftImageCustomSource[] = array('thumbnail' => '','original' => '', 'copyright' => '', 'source_website' => '', 'source' => '','exif' => true); |
|
587
|
587
|
if (!empty($globalAircraftImageCustomSources) && $type == 'aircraft') { |
|
@@ -598,15 +598,15 @@ discard block |
|
|
block discarded – undo |
|
598
|
598
|
print_r($source); |
|
599
|
599
|
print_r($customsources); |
|
600
|
600
|
} |
|
601
|
|
- $url = str_replace('{registration}',$registration,$source['original']); |
|
602
|
|
- $url_thumbnail = str_replace('{registration}',$registration,$source['thumbnail']); |
|
|
601
|
+ $url = str_replace('{registration}', $registration, $source['original']); |
|
|
602
|
+ $url_thumbnail = str_replace('{registration}', $registration, $source['thumbnail']); |
|
603
|
603
|
if ($Common->urlexist($url)) { |
|
604
|
604
|
$image_url = array(); |
|
605
|
605
|
$image_url['thumbnail'] = $url_thumbnail; |
|
606
|
606
|
$image_url['original'] = $url; |
|
607
|
607
|
if ($source['exif'] && exif_imagetype($url) == IMAGETYPE_JPEG) $exifCopyright = $this->getExifCopyright($url); |
|
608
|
608
|
else $exifCopyright = ''; |
|
609
|
|
- if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
|
609
|
+ if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
610
|
610
|
elseif (isset($source['copyright'])) $image_url['copyright'] = $source['copyright']; |
|
611
|
611
|
else $image_url['copyright'] = $source['source_website']; |
|
612
|
612
|
$image_url['source_website'] = $source['source_website']; |
|
@@ -630,19 +630,19 @@ discard block |
|
|
block discarded – undo |
|
630
|
630
|
print_r($source); |
|
631
|
631
|
print_r($customsources); |
|
632
|
632
|
} |
|
633
|
|
- $url = str_replace('{registration}',$registration,$source['original']); |
|
634
|
|
- $url = str_replace('{mmsi}',$registration,$url); |
|
635
|
|
- $url = str_replace('{name}',$name,$url); |
|
636
|
|
- $url_thumbnail = str_replace('{registration}',$registration,$source['thumbnail']); |
|
637
|
|
- $url_thumbnail = str_replace('{mmsi}',$registration,$url_thumbnail); |
|
638
|
|
- $url_thumbnail = str_replace('{name}',$name,$url_thumbnail); |
|
|
633
|
+ $url = str_replace('{registration}', $registration, $source['original']); |
|
|
634
|
+ $url = str_replace('{mmsi}', $registration, $url); |
|
|
635
|
+ $url = str_replace('{name}', $name, $url); |
|
|
636
|
+ $url_thumbnail = str_replace('{registration}', $registration, $source['thumbnail']); |
|
|
637
|
+ $url_thumbnail = str_replace('{mmsi}', $registration, $url_thumbnail); |
|
|
638
|
+ $url_thumbnail = str_replace('{name}', $name, $url_thumbnail); |
|
639
|
639
|
if ($Common->urlexist($url)) { |
|
640
|
640
|
$image_url = array(); |
|
641
|
641
|
$image_url['thumbnail'] = $url_thumbnail; |
|
642
|
642
|
$image_url['original'] = $url; |
|
643
|
643
|
if ($source['exif'] && exif_imagetype($url) == IMAGETYPE_JPEG) $exifCopyright = $this->getExifCopyright($url); |
|
644
|
644
|
else $exifCopyright = ''; |
|
645
|
|
- if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
|
645
|
+ if ($exifCopyright != '') $image_url['copyright'] = $exifCopyright; |
|
646
|
646
|
elseif (isset($source['copyright'])) $image_url['copyright'] = $source['copyright']; |
|
647
|
647
|
else $image_url['copyright'] = $source['source_website']; |
|
648
|
648
|
$image_url['source_website'] = $source['source_website']; |