Skip to content

Commit

Permalink
Error Message @ Export 0 Tweets
Browse files Browse the repository at this point in the history
  • Loading branch information
circuscode committed Apr 11, 2018
1 parent 54db600 commit 536ec77
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions mathilda_export.php
Expand Up @@ -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
*/
Expand Down
13 changes: 10 additions & 3 deletions mathilda_tools.php
Expand Up @@ -149,9 +149,16 @@ function mathilda_tools() {
if($_GET['exportcsv']=='true')
{
$result=mathilda_export_csv();
echo '<div class="updated fade">
<p><strong>'.$result.'</strong></p>
</div>';
if(strpos($result, 'Error')===0) {
echo '<div class="notice notice-warning is-dismissible">
<p><strong>'.$result.'</strong></p>
</div>';
}
else {
echo '<div class="updated fade">
<p><strong>'.$result.'</strong></p>
</div>';
}
}
}

Expand Down

0 comments on commit 536ec77

Please sign in to comment.