add IMAGE_PROVIDER config

This commit is contained in:
frederik
2025-08-17 09:59:12 +02:00
committed by Nachtzuster
parent ae72399c43
commit a5154c38ed
3 changed files with 25 additions and 2 deletions
+11 -2
View File
@@ -59,6 +59,7 @@ if(isset($_GET["latitude"])){
$apprise_notification_title = $_GET['apprise_notification_title'];
$apprise_notification_body = $_GET['apprise_notification_body'];
$minimum_time_limit = $_GET['minimum_time_limit'];
$image_provider = $_GET["image_provider"];
$flickr_api_key = $_GET['flickr_api_key'];
$flickr_filter_email = $_GET["flickr_filter_email"];
$language = $_GET["language"];
@@ -142,6 +143,7 @@ if(isset($_GET["latitude"])){
$contents = preg_replace("/APPRISE_NOTIFY_NEW_SPECIES=.*/", "APPRISE_NOTIFY_NEW_SPECIES=$apprise_notify_new_species", $contents);
$contents = preg_replace("/APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=.*/", "APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=$apprise_notify_new_species_each_day", $contents);
$contents = preg_replace("/APPRISE_WEEKLY_REPORT=.*/", "APPRISE_WEEKLY_REPORT=$apprise_weekly_report", $contents);
$contents = preg_replace("/IMAGE_PROVIDER=.*/", "IMAGE_PROVIDER=$image_provider", $contents);
$contents = preg_replace("/FLICKR_API_KEY=.*/", "FLICKR_API_KEY=$flickr_api_key", $contents);
if(strlen($language) == 2){
$contents = preg_replace("/DATABASE_LANG=.*/", "DATABASE_LANG=$language", $contents);
@@ -553,12 +555,19 @@ https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken}
<span id="testsuccessmsg"></span>
</td></tr></table><br>
<table class="settingstable"><tr><td>
<h2>Bird Photos from Flickr</h2>
<h2>Bird Photo Source</h2>
<label for="image_provider">Image Provider: </label>
<select name="image_provider" class="testbtn">
<option value="" <?php if(empty($config['IMAGE_PROVIDER'])) { echo 'selected'; } ?>>None</option>
<option value="WIKIPEDIA" <?php if($config['IMAGE_PROVIDER'] == 'WIKIPEDIA') { echo 'selected'; } ?>>Wikipedia</option>
<option value="FLICKR" <?php if(empty($config['FLICKR_API_KEY'])) { echo 'disabled'; } else if($config['IMAGE_PROVIDER'] == 'FLICKR') { echo 'selected'; } ?>>Flickr</option>
</select>
<hr>
<p>Set your Flickr API key to enable the display of bird images next to detections. <a target="_blank" href="https://www.flickr.com/services/api/misc.api_keys.html">Get your key here.</a></p>
<label for="flickr_api_key">Flickr API Key: </label>
<input name="flickr_api_key" type="text" size="32" value="<?php print($config['FLICKR_API_KEY']);?>"/><br>
<label for="flickr_filter_email">Only search photos from this Flickr user: </label>
<input name="flickr_filter_email" type="email" size="24" placeholder="myflickraccount@gmail.com" value="<?php print($config['FLICKR_FILTER_EMAIL']);?>"/><br>
<p>Set your Flickr API key to enable the display of bird images next to detections. <a target="_blank" href="https://www.flickr.com/services/api/misc.api_keys.html">Get your free key here.</a></p>
</td></tr></table><br>
<table class="settingstable"><tr><td>
<h2>Localization</h2>