silencing errors if no Flickr API Key
This commit is contained in:
@@ -173,6 +173,7 @@ while($results=$result3->fetchArray(SQLITE3_ASSOC)){
|
|||||||
} elseif (file_exists('./scripts/firstrun.ini')) {
|
} elseif (file_exists('./scripts/firstrun.ini')) {
|
||||||
$config = parse_ini_file('./scripts/firstrun.ini');
|
$config = parse_ini_file('./scripts/firstrun.ini');
|
||||||
}
|
}
|
||||||
|
if (! empty($config["FLICKR_API_KEY"])) {
|
||||||
$flickrjson = json_decode(file_get_contents("https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=".$config["FLICKR_API_KEY"]."&text=\"".str_replace('_', '+', $comname)."\"&license=2%2C3%2C4%2C5%2C6%2C9&sort=relevance&per_page=15&format=json&nojsoncallback=1"), true)["photos"]["photo"];
|
$flickrjson = json_decode(file_get_contents("https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=".$config["FLICKR_API_KEY"]."&text=\"".str_replace('_', '+', $comname)."\"&license=2%2C3%2C4%2C5%2C6%2C9&sort=relevance&per_page=15&format=json&nojsoncallback=1"), true)["photos"]["photo"];
|
||||||
|
|
||||||
foreach ($flickrjson as $val) {
|
foreach ($flickrjson as $val) {
|
||||||
@@ -184,6 +185,7 @@ while($results=$result3->fetchArray(SQLITE3_ASSOC)){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<br><br><br>
|
<br><br><br>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user