From 136c1826dd64d9d7ed368004312b4f5fcd7f2ed9 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Wed, 1 Aug 2018 19:20:53 -0700 Subject: better error messages --- controllers/controllers.php | 24 ------------------------ views/email.php | 9 +-------- views/event.php | 4 ++-- views/new-bookmark.php | 4 ++-- views/new-code.php | 4 ++-- views/new-favorite.php | 4 ++-- views/new-flight.php | 4 ++-- views/new-itinerary.php | 4 ++-- views/new-post.php | 20 ++++++++------------ views/new-repost.php | 4 ++-- views/review.php | 6 +++--- 11 files changed, 26 insertions(+), 61 deletions(-) diff --git a/controllers/controllers.php b/controllers/controllers.php index 228f6fb..2cbe56e 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -63,17 +63,6 @@ $app->get('/new', function() use($app) { if(array_key_exists('reply', $params)) $in_reply_to = $params['reply']; - $test_response = ''; - if($user->last_micropub_response) { - try { - if(@json_decode($user->last_micropub_response)) { - $d = json_decode($user->last_micropub_response); - $test_response = $d->response; - } - } catch(Exception $e) { - } - } - render('new-post', array( 'title' => 'New Post', 'in_reply_to' => $in_reply_to, @@ -83,7 +72,6 @@ $app->get('/new', function() use($app) { 'micropub_access_token' => $user->micropub_access_token, 'response_date' => $user->last_micropub_response_date, 'syndication_targets' => json_decode($user->syndication_targets, true), - 'test_response' => $test_response, 'location_enabled' => $user->location_enabled, 'user' => $user, 'authorizing' => false @@ -452,17 +440,6 @@ $app->get('/add-to-home', function() use($app) { $app->get('/email', function() use($app) { if($user=require_login($app)) { - $test_response = ''; - if($user->last_micropub_response) { - try { - if(@json_decode($user->last_micropub_response)) { - $d = json_decode($user->last_micropub_response); - $test_response = $d->response; - } - } catch(Exception $e) { - } - } - if(!$user->email_username) { $host = parse_url($user->url, PHP_URL_HOST); $user->email_username = $host . '.' . rand(100000,999999); @@ -472,7 +449,6 @@ $app->get('/email', function() use($app) { render('email', array( 'title' => 'Post-by-Email', 'micropub_endpoint' => $user->micropub_endpoint, - 'test_response' => $test_response, 'user' => $user )); } diff --git a/views/email.php b/views/email.php index 1f97905..e3464f6 100644 --- a/views/email.php +++ b/views/email.php @@ -19,11 +19,4 @@

If you attach a photo to your email or MMS, it will be sent to your Micropub endpoint. (Only one photo is currently supported.)

-
- test_response): ?> -

Last response from your Micropub endpoint

-
test_response) ?>
- -
- - \ No newline at end of file + diff --git a/views/event.php b/views/event.php index 3c26f73..81742d8 100644 --- a/views/event.php +++ b/views/event.php @@ -2,8 +2,8 @@
- - + +
diff --git a/views/new-bookmark.php b/views/new-bookmark.php index 0181dae..f50801a 100644 --- a/views/new-bookmark.php +++ b/views/new-bookmark.php @@ -6,8 +6,8 @@
- - + +
diff --git a/views/new-code.php b/views/new-code.php index 96a93d3..4201816 100644 --- a/views/new-code.php +++ b/views/new-code.php @@ -2,8 +2,8 @@
- - + +
diff --git a/views/new-favorite.php b/views/new-favorite.php index 72de412..f457e3b 100644 --- a/views/new-favorite.php +++ b/views/new-favorite.php @@ -2,8 +2,8 @@
- - + +
diff --git a/views/new-flight.php b/views/new-flight.php index 031b86f..da3f6bf 100644 --- a/views/new-flight.php +++ b/views/new-flight.php @@ -2,8 +2,8 @@
- - + +
diff --git a/views/new-itinerary.php b/views/new-itinerary.php index 14deb65..e40ec2a 100644 --- a/views/new-itinerary.php +++ b/views/new-itinerary.php @@ -2,8 +2,8 @@
- - + +
diff --git a/views/new-post.php b/views/new-post.php index ec74b28..3455644 100644 --- a/views/new-post.php +++ b/views/new-post.php @@ -117,20 +117,15 @@
- - + + - -