From 7668c3725aa99e96bc3c6741b63654448888c441 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Wed, 16 Feb 2022 13:45:09 -0500 Subject: [PATCH] added output buffer flushing to stats --- scripts/stats.php | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/scripts/stats.php b/scripts/stats.php index 21ecad6..98cd4a5 100644 --- a/scripts/stats.php +++ b/scripts/stats.php @@ -227,7 +227,8 @@ while($rows=$stats ->fetch_assoc()) ";echo $_POST['species'];echo " + $species = $_POST['species']; + $str = "

$species

@@ -236,22 +237,33 @@ while($rows=$stats ->fetch_assoc()) "; + echo str_pad($str, 4096); + ob_flush(); + flush(); + while($rows = $specificstats->fetch_assoc()) { + $count = $rows['COUNT(*)']; + $maxconf = $rows['MAX(Confidence)']; + $name = $rows['Com_Name']; + $sciname = $rows['Sci_Name']; $dbname = preg_replace('/ /', '_', $rows['Com_Name']); $dbname = preg_replace('/\'/', '', $dbname); $dbsciname = preg_replace('/ /', '_', $rows['Sci_Name']); $imagelink = shell_exec("/home/pi/BirdNET-Pi/scripts/get_image.sh $dbsciname"); $imagecitation = shell_exec("/home/pi/BirdNET-Pi/scripts/get_citation.sh $dbsciname"); - echo " - - - - + $str= " + + + + -
Common NameHighest Confidence Score Links
";echo "";echo $rows['Com_Name']; echo "";echo "";echo $rows['Sci_Name']; echo "";echo $rows['COUNT(*)'];echo "";echo $rows['MAX(Confidence)'];echo "
$name$sciname$count$maxconf Wikipedia, All About Birds
- -
";echo $imagecitation;echo "
+ "; + echo str_pad($str, 4096); + ob_flush(); + flush(); + echo " +
$imagecitation
";