A live bird collage card for your Home Assistant dashboard.
fix: the picture url for the big modal image was generated incorrectly
frederik25f2c531c037
diff --git a/scripts/common.php b/scripts/common.phpindex b2434685..784da53e 100644--- a/scripts/common.php+++ b/scripts/common.php@@ -190,6 +190,8 @@ class Flickr {$this->get_from_flickr($sci_name);$image = $this->get_image_from_db($sci_name);}+ $photos_url = str_replace('/people/', '/photos/', $image['author_url'].'/'.$image['id']);+ $image['photos_url'] = $photos_url;return $image;}diff --git a/scripts/overview.php b/scripts/overview.phpindex 918d8321..1ce88962 100644--- a/scripts/overview.php+++ b/scripts/overview.php@@ -94,8 +94,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" && isse$image = $_SESSION['images'][$key];} else {$flickr_cache = $flickr->get_image($mostrecent['Sci_Name']);- $modaltext = $flickr_cache["author_url"] . "/" . $flickr_cache["id"];- array_push($_SESSION["images"], array($comname, $flickr_cache["image_url"], $flickr_cache["title"], $modaltext, $flickr_cache["author_url"], $flickr_cache["license_url"]));+ array_push($_SESSION["images"], array($comname, $flickr_cache["image_url"], $flickr_cache["title"], $flickr_cache["photos_url"], $flickr_cache["author_url"], $flickr_cache["license_url"]));$image = $_SESSION['images'][count($_SESSION['images']) - 1];}}diff --git a/scripts/todays_detections.php b/scripts/todays_detections.phpindex 5f74e1b7..3974f9b8 100644--- a/scripts/todays_detections.php+++ b/scripts/todays_detections.php@@ -217,8 +217,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {$image = $_SESSION['images'][$key];} else {$flickr_cache = $flickr->get_image($todaytable['Sci_Name']);- $modaltext = $flickr_cache["author_url"] . "/" . $flickr_cache["id"];- array_push($_SESSION["images"], array($comname, $flickr_cache["image_url"], $flickr_cache["title"], $modaltext, $flickr_cache["author_url"], $flickr_cache["license_url"]));+ array_push($_SESSION["images"], array($comname, $flickr_cache["image_url"], $flickr_cache["title"], $flickr_cache["photos_url"], $flickr_cache["author_url"], $flickr_cache["license_url"]));$image = $_SESSION['images'][count($_SESSION['images']) - 1];}}