adding full species list editor

This commit is contained in:
mcguirepr89
2022-01-31 12:10:11 -05:00
parent 70c9f9a14f
commit eb218030e5
7 changed files with 169 additions and 1 deletions
+6 -1
View File
@@ -3,7 +3,7 @@ error_reporting(E_ALL);
ini_set('display_errors',1);
$file='/home/pi/BirdNET-Pi/include_species_list.txt';
$str=file_get_contents("$file");
$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);
$str = preg_replace('/^\h*\v+/m', '', $str);
file_put_contents("$file", "$str");
if (isset($_POST['species']))
@@ -12,6 +12,11 @@ $content = file_get_contents("/home/pi/BirdNET-Pi/include_species_list.txt");
$newcontent = str_replace($selectedOption, "", "$content");
file_put_contents("/home/pi/BirdNET-Pi/include_species_list.txt", "$newcontent");
}
$file='/home/pi/BirdNET-Pi/include_species_list.txt';
$str=file_get_contents("$file");
//$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);
$str = preg_replace('/^\h*\v+/m', '', $str);
file_put_contents("$file", "$str");
header("Location: {$_SERVER['HTTP_REFERER']}");
exit;
?>