From 92b6dea25d0f7259fcc2d3362aa8d6ea676b5dfd Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 11 Jan 2018 11:05:47 -0500 Subject: [PATCH] updating last updated flight data message if no data currently displaying epoch date if no flight data, changing to use a message instead --- class_flight.php | 13 +++++++++---- header.php | 2 +- style.css | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/class_flight.php b/class_flight.php index 1c659b3..87a6af0 100644 --- a/class_flight.php +++ b/class_flight.php @@ -107,10 +107,15 @@ include_once($_SERVER['DOCUMENT_ROOT'].'/wp-config.php' ); if ($row['airline'] == "EXPRESS AIRLINES 1, INC.") $this->dep_data[$key]['airline'] = 'Delta Airlines'; } } - rsort($update_times); - // get UTC offset for current date/time - $TimeDiff = 5+date("I"); - $this->last_updated = '

 

Last updated: '.date("n/j/Y g:i a",$update_times[0]-($TimeDiff*60*60)).'

'; + if( !empty( $update_times ) ){ + rsort($update_times); + // get UTC offset for current date/time + $TimeDiff = 5+date("I"); + $this->last_updated = '

 

Last updated: '.date("n/j/Y g:i a",$update_times[0]-($TimeDiff*60*60)).'

'; + } else { + $this->last_updated = '

 

Last updated: No flight data available

'; + } + // $query = "SELECT msg_dtm FROM glm_flight // ORDER BY msg_dtm DESC // LIMIT 1;"; diff --git a/header.php b/header.php index 5b735c9..63d5720 100644 --- a/header.php +++ b/header.php @@ -4,7 +4,7 @@ <?php wp_title(); ?> - + diff --git a/style.css b/style.css index b366a24..7912947 100644 --- a/style.css +++ b/style.css @@ -3,5 +3,5 @@ Theme Name: ChippewaCountyInternationAirport Author: Gaslight Media Author URI: http://www.gaslightmedia.com Description: A theme for ChippewaCountyInternationAirport -Version: 1.0.0 +Version: 1.0.8 */ -- 2.17.1