A live bird collage card for your Home Assistant dashboard.
adding new BirdNET-Pi.com subdomain request form
mcguirepr89c48c53fa172c
diff --git a/scripts/advanced.php b/scripts/advanced.phpindex d6c0b3ca..48ad9dbd 100644--- a/scripts/advanced.php+++ b/scripts/advanced.php@@ -146,6 +146,8 @@ if(isset($_POST['submit'])) {</style></head><div class="settings">+<iframe src="https://github.com/sponsors/mcguirepr89/button" title="Sponsor mcguirepr89" style="height:35px;width:116px;border:0;"></iframe>+<?phpif (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {$newconfig = parse_ini_file('/home/pi/BirdNET-Pi/thisrun.txt');@@ -196,6 +198,7 @@ foreach($formats as $format){<label for="caddy_pwd">Webpage: </label><input name="caddy_pwd" type="text" value="<?php print($newconfig['CADDY_PWD']);?>" /><br><h3>Custom URL</h3>+ <p><a href="mailto:[email protected]?subject=Request%20BirdNET-Pi%20Subdomain&body=<?php include('birdnetpi_request.php'); ?>" target="_blank">Email Me</a> if you would like a BirdNETPi.com subdomain. This would be, https://YourLocation.birdnetpi.com</p><p>When you update the URL below, the web server will reload, so be sure to wait at least 30 seconds and then go to your new URL.</p><label for="birdnetpi_url">BirdNET-Pi URL: </label><input name="birdnetpi_url" type="url" value="<?php print($newconfig['BIRDNETPI_URL']);?>" /><br>diff --git a/scripts/birdnetpi_request.php b/scripts/birdnetpi_request.phpnew file mode 100644index 00000000..acb87697--- /dev/null+++ b/scripts/birdnetpi_request.php@@ -0,0 +1,15 @@+<?php+if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {+ $config = parse_ini_file('/home/pi/BirdNET-Pi/thisrun.txt');+} elseif (file_exists('/home/pi/BirdNET-Pi/firstrun.ini')) {+ $config = parse_ini_file('/home/pi/BirdNET-Pi/firstrun.ini');+}+$template = file_get_contents("scripts/email_template2");++foreach($config as $key => $value)+{+ $template = str_replace('{{ '.$key.' }}', $value, $template);+}+echo $template;+?>+diff --git a/scripts/config.php b/scripts/config.phpindex 24decd95..4c07b90c 100644--- a/scripts/config.php+++ b/scripts/config.php@@ -42,6 +42,7 @@ if ($language != "none"){</style></head><div class="settings">+<iframe src="https://github.com/sponsors/mcguirepr89/button" title="Sponsor mcguirepr89" style="height:35px;width:116px;border:0;"></iframe><h2>Basic Settings</h2><form action="" method="POST"><?phpdiff --git a/scripts/email_template2 b/scripts/email_template2new file mode 100644index 00000000..8d52757f--- /dev/null+++ b/scripts/email_template2@@ -0,0 +1,10 @@+Hi, Patrick, I'm a new BirdNET-Pi user and am interested in a subdomain.+%0A%0A+Location= [ Create a location name ]%0A+%0A%0A+An automated best regards!%0A+[ Your Name Here ]+%0A%0A+Acknowledgement: By requesting this BirdNETPi.com subdomain, I acknowledge that+my installation and its data will be made public. I also acknowledge that it is+my responsibility to keep the installation secure.