A live bird collage card for your Home Assistant dashboard.
Ensure ' used for minigraphs
Alexandre535444f7521a
diff --git a/scripts/overview.php b/scripts/overview.phpindex a88d2f61..343c55ba 100644--- a/scripts/overview.php+++ b/scripts/overview.php@@ -67,6 +67,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" && issewhile($mostrecent = $result4->fetchArray(SQLITE3_ASSOC)) {$comname = preg_replace('/ /', '_', $mostrecent['Com_Name']);$sciname = preg_replace('/ /', '_', $mostrecent['Sci_Name']);+ $comnamegraph = preg_replace('/\'/', '__', $comname);$comname = preg_replace('/\'/', '', $comname);$filename = "By_Date/".$mostrecent['Date']."/".$comname."/".$mostrecent['File_Name'];@@ -133,7 +134,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" && isse<a href="<?php $info_url = get_info_url($mostrecent['Sci_Name']); $url = $info_url['URL']; echo $url ?>" target="_blank"><img style="width: unset !important; display: inline; height: 1em; cursor: pointer;" title="Info" src="images/info.png" width="25"></a><a href="https://wikipedia.org/wiki/<?php echo $sciname;?>" target="_blank"><img style="width: unset !important; display: inline; height: 1em; cursor: pointer;" title="Wikipedia" src="images/wiki.png" width="25"></a>- <img style="width: unset !important;display: inline;height: 1em;cursor:pointer" title="View species stats" onclick="generateMiniGraph(this, '<?php echo $comname; ?>')" width=25 src="images/chart.svg">+ <img style="width: unset !important;display: inline;height: 1em;cursor:pointer" title="View species stats" onclick="generateMiniGraph(this, '<?php echo $comnamegraph; ?>')" width=25 src="images/chart.svg"><br>Confidence: <?php echo $percent = round((float)round($mostrecent['Confidence'],2) * 100 ) . '%';?><br></div><br><video style="margin-top:10px" onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster="<?php echo $filename.".png";?>" preload="none" title="<?php echo $filename;?>"><source src="<?php echo $filename;?>"></video></td></form>diff --git a/scripts/todays_detections.php b/scripts/todays_detections.phpindex 89caf543..6cef1423 100644--- a/scripts/todays_detections.php+++ b/scripts/todays_detections.php@@ -58,6 +58,7 @@ $totalspeciestally = $result6->fetchArray(SQLITE3_ASSOC);if(isset($_GET['comname'])) {$birdName = $_GET['comname'];+ $birdName = str_replace("__", "'", $birdName);$birdName = str_replace("_", " ", $birdName);@@ -192,6 +193,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {$iterations++;$comname = preg_replace('/ /', '_', $todaytable['Com_Name']);+ $comnamegraph = preg_replace('/\'/', '__', $comname);$comname = preg_replace('/\'/', '', $comname);$filename = "/By_Date/".date('Y-m-d')."/".$comname."/".$todaytable['File_Name'];$filename_formatted = $todaytable['Date']."/".$comname."/".$todaytable['File_Name'];@@ -240,7 +242,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {<i><?php echo $todaytable['Sci_Name'];?></i><a href="<?php echo $url;?>" target="_blank"><img style="cursor:pointer;float:unset;display:inline" title=<?php echo $url_title;?> src="images/info.png" width="20"></a><a href="https://wikipedia.org/wiki/<?php echo $sciname;?>" target="_blank"><img style=";cursor:pointer;float:unset;display:inline" title="Wikipedia" src="images/wiki.png" width="20"></a>- <img style=";cursor:pointer;float:unset;display:inline" title="View species stats" onclick="generateMiniGraph(this, '<?php echo $comname; ?>')" width=20 src="images/chart.svg"><br>+ <img style=";cursor:pointer;float:unset;display:inline" title="View species stats" onclick="generateMiniGraph(this, '<?php echo $comnamegraph; ?>')" width=20 src="images/chart.svg"><br><b>Confidence:</b> <?php echo round((float)round($todaytable['Confidence'],2) * 100 ) . '%';?><br></div><br><video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster="<?php echo $filename.".png";?>" preload="none" title="<?php echo $filename;?>"><source preload="none" src="<?php echo $filename;?>"></video></td>@@ -264,7 +266,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {<a href="<?php echo $url;?>" target="_blank"><img style="height: 1em;cursor:pointer;float:unset;display:inline" title=<?php echo $url_title;?> src="images/info.png" width="25"></a><?php if($_GET['kiosk'] == false){?><a href="https://wikipedia.org/wiki/<?php echo $sciname;?>" target="_blank"><img style="height: 1em;cursor:pointer;float:unset;display:inline" title="Wikipedia" src="images/wiki.png" width="25"></a>- <img style="height: 1em;cursor:pointer;float:unset;display:inline" title="View species stats" onclick="generateMiniGraph(this, '<?php echo $comname; ?>')" width=25 src="images/chart.svg">+ <img style="height: 1em;cursor:pointer;float:unset;display:inline" title="View species stats" onclick="generateMiniGraph(this, '<?php echo $comnamegraph; ?>')" width=25 src="images/chart.svg"><a target="_blank" href="index.php?filename=<?php echo $todaytable['File_Name']; ?>"><img style="height: 1em;cursor:pointer;float:unset;display:inline" class="copyimage-mobile" title="Open in new tab" width=16 src="images/copy.png"></a><?php } ?></i><br>