diff --git a/README.md b/README.md index d554e9c..c965614 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,6 @@ Check out birds from around the world - [Vienna, Virginia, United States](https://viennava.birdnetpi.com) - [Grevenbroich, Elsen, Germany](https://grevenbroich-elsen.birdnetpi.com) - [Occoquan, Virginia, United States](https://occoquanva.birdnetpi.com) -- [Westmoreland, Pennsylvania, United States](https://westmorelandbnc.birdnetpi.com) -- [Latrobe, Pennsylvania, United States](https://stvincentcollege.birdnetpi.com) - [Cambridge, Massachusetts, United States](https://cambridgema.birdnetpi.com) [Share your installation!!](https://github.com/mcguirepr89/BirdNET-Pi/wiki/Sharing-Your-BirdNET-Pi) diff --git a/homepage/views.php b/homepage/views.php index f37426a..3bc74f1 100644 --- a/homepage/views.php +++ b/homepage/views.php @@ -104,6 +104,7 @@ if(isset($_GET['view'])){ if($_GET['view'] == "View Log"){echo "";} if($_GET['view'] == "Overview"){include('overview.php');} if($_GET['view'] == "Today's Detections"){include('todays_detections.php');} + if($_GET['view'] == "Kiosk"){$kiosk = true;include('todays_detections.php');} if($_GET['view'] == "Species Stats"){include('stats.php');} if($_GET['view'] == "Weekly Report"){include('weekly_report.php');} if($_GET['view'] == "Streamlit"){echo "";} diff --git a/scripts/overview.php b/scripts/overview.php index e434795..db6f745 100644 --- a/scripts/overview.php +++ b/scripts/overview.php @@ -262,7 +262,7 @@ body::-webkit-scrollbar {

+

$site_name


"; + } + $db = new SQLite3('./scripts/birds.db', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE); if($db == False){ echo "Database is busy"; @@ -63,6 +80,53 @@ $user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd"); $home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd"); $home = trim($home); +// from https://stackoverflow.com/questions/2690504/php-producing-relative-date-time-from-timestamps +function relativeTime($ts) +{ + if(!ctype_digit($ts)) + $ts = strtotime($ts); + + $diff = time() - $ts; + if($diff == 0) + return 'now'; + elseif($diff > 0) + { + $day_diff = floor($diff / 86400); + if($day_diff == 0) + { + if($diff < 60) return 'just now'; + if($diff < 120) return '1 minute ago'; + if($diff < 3600) return floor($diff / 60) . ' minutes ago'; + if($diff < 7200) return '1 hour ago'; + if($diff < 86400) return floor($diff / 3600) . ' hours ago'; + } + if($day_diff == 1) return 'Yesterday'; + if($day_diff < 7) return $day_diff . ' days ago'; + if($day_diff < 31) return ceil($day_diff / 7) . ' weeks ago'; + if($day_diff < 60) return 'last month'; + return date('F Y', $ts); + } + else + { + $diff = abs($diff); + $day_diff = floor($diff / 86400); + if($day_diff == 0) + { + if($diff < 120) return 'in a minute'; + if($diff < 3600) return 'in ' . floor($diff / 60) . ' minutes'; + if($diff < 7200) return 'in an hour'; + if($diff < 86400) return 'in ' . floor($diff / 3600) . ' hours'; + } + if($day_diff == 1) return 'Tomorrow'; + if($day_diff < 4) return date('l', $ts); + if($day_diff < 7 + (7 - date('w'))) return 'next week'; + if(ceil($day_diff / 7) < 4) return 'in ' . ceil($day_diff / 7) . ' weeks'; + if(date('n', $ts) == date('n') + 1) return 'next month'; + return date('F Y', $ts); + } +} + + if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) { if(isset($_GET['searchterm'])) { if(strtolower(explode(" ", $_GET['searchterm'])[0]) == "not") { @@ -110,6 +174,8 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) { $config = parse_ini_file('./scripts/firstrun.ini'); } + + while($todaytable=$result0->fetchArray(SQLITE3_ASSOC)) { $iterations++; @@ -120,8 +186,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) { $sciname = preg_replace('/ /', '_', $todaytable['Sci_Name']); $args = "&license=2%2C3%2C4%2C5%2C6%2C9&orientation=square,portrait"; $comnameprefix = "%20bird"; - - if (!empty($config["FLICKR_API_KEY"]) && (isset($_GET['display_limit']) || isset($_GET['hard_limit']))) { + if (!empty($config["FLICKR_API_KEY"]) && (isset($_GET['display_limit']) || isset($_GET['hard_limit']) || $_GET['kiosk'] == true) ) { if(!empty($config["FLICKR_FILTER_EMAIL"])) { if(!isset($_SESSION["FLICKR_FILTER_EMAIL"])) { @@ -179,16 +244,16 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) { -
+
- 0) { ?> + 0) { ?>
-
-
+ href="https://allaboutbirds.org/guide/" target="top">
+ href="https://wikipedia.org/wiki/" target="top">
Confidence:
@@ -231,7 +296,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {

- +
@@ -264,31 +333,48 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {
- +
- +
- +
-

Today's Detections —

+ +

Today's Detections

Loading...

+ + + + + + +