From 536ec77dadb39e37b5beb2dc8f485411259c4cf5 Mon Sep 17 00:00:00 2001 From: circuscode Date: Wed, 11 Apr 2018 21:35:29 +0200 Subject: [PATCH] Error Message @ Export 0 Tweets --- mathilda_export.php | 5 +++++ mathilda_tools.php | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/mathilda_export.php b/mathilda_export.php index 79577e2..537cb9c 100644 --- a/mathilda_export.php +++ b/mathilda_export.php @@ -8,6 +8,11 @@ function mathilda_export_csv() { +$amount_of_tweets=mathilda_tweets_count(); +if($amount_of_tweets==0) { + return 'Error! No Tweets for Export available.'; +} + /* File */ diff --git a/mathilda_tools.php b/mathilda_tools.php index a4d75e9..07b48b3 100644 --- a/mathilda_tools.php +++ b/mathilda_tools.php @@ -149,9 +149,16 @@ function mathilda_tools() { if($_GET['exportcsv']=='true') { $result=mathilda_export_csv(); - echo '
-

'.$result.'

-
'; + if(strpos($result, 'Error')===0) { + echo '
+

'.$result.'

+
'; + } + else { + echo '
+

'.$result.'

+
'; + } } }