From 8d93b03f507befb10d49510a36e92e42eb832f30 Mon Sep 17 00:00:00 2001 From: maximest-pierre Date: Tue, 20 Mar 2018 23:29:45 -0400 Subject: [PATCH] Cleanup of LBRY api calls --- .../action/AcquisitionActions.class.php | 10 +++++++++ view/template/acquisition/youtube.php | 22 ++++++++++++++----- view/template/acquisition/youtube_edit.php | 2 +- view/template/acquisition/youtube_status.php | 4 ++-- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/controller/action/AcquisitionActions.class.php b/controller/action/AcquisitionActions.class.php index 21ff67f7..2660b34a 100644 --- a/controller/action/AcquisitionActions.class.php +++ b/controller/action/AcquisitionActions.class.php @@ -114,4 +114,14 @@ class AcquisitionActions extends Actions return false; } } + + public static function actionGetLBRYReward() + { + return LBRY::youtubeReward(); + } + + public static function actionGetYoutubeStatus($status_token) + { + return LBRY::statusYoutube($status_token); + } } diff --git a/view/template/acquisition/youtube.php b/view/template/acquisition/youtube.php index 412cf7ca..098c59ae 100644 --- a/view/template/acquisition/youtube.php +++ b/view/template/acquisition/youtube.php @@ -6,7 +6,7 @@ Response::addJsAsset('/js/yt2/app.js'); Response::addJsAsset('/js/yt2/FormValidation.js'); Response::addJsAsset('/js/yt2/SyncStatus.js'); Response::addJsAsset('/js/yt2/youtube_video.js'); -$reward = LBRY::youtubeReward(); +$reward = AcquisitionActions::actionGetLBRYReward(); Response::setMetaTitle("LBRY YouTube Partner Program"); Response::setMetaDescription("Put your content on the blockchain, experience true content freedom, and earn rewards."); ?> @@ -44,7 +44,7 @@ Response::setMetaDescription("Put your content on the blockchain, experience tru
" . "The following error occurred: ". $_GET['error_message'] . " For support please send an email to hello@lbry.io" . "
"; + if (isset($_GET['error']) && $_GET['error_message']): echo "
" . "The following error occurred: ". $_GET['error_message'] . " For support please send an email to hello@lbry.io" . "
"; endif;?>

Create on a stable platform. For real this time.

@@ -139,13 +139,23 @@ Response::setMetaDescription("Put your content on the blockchain, experience tru

Sync & Earn

LBRY offers a single-click sync process
for existing YouTubers

-
- + +
+
+ +
+
I want to sync my content. -
- Sync now +
+
+ +
+ + + +
By syncing, you agree to mirror your content to the LBRY network for 1 year, and acknowledge these terms.
diff --git a/view/template/acquisition/youtube_edit.php b/view/template/acquisition/youtube_edit.php index 39825ff7..2dfae603 100644 --- a/view/template/acquisition/youtube_edit.php +++ b/view/template/acquisition/youtube_edit.php @@ -4,7 +4,7 @@ $channel_name = $_POST['new_preferred_channel']; $email = $_POST['new_email']; $sync_consent = isset($_POST['sync_consent']); -$current_value = LBRY::statusYoutube($status_token); +$current_value = AcquisitionActions::actionGetYoutubeStatus($status_token); if(!preg_match("/@[A-Za-z0-9_-]+$/", $channel_name)){ $channel_name = "@" . $channel_name; diff --git a/view/template/acquisition/youtube_status.php b/view/template/acquisition/youtube_status.php index f1278126..01be9ec7 100644 --- a/view/template/acquisition/youtube_status.php +++ b/view/template/acquisition/youtube_status.php @@ -4,7 +4,7 @@ - + @@ -79,7 +79,7 @@
" . "The following error occurred: ". $_GET['error_message'] . " For support please send an email to hello@lbry.io" . ""; + if (isset($_GET['error']) && isset($_GET['error_message'])): echo "
" . "The following error occurred: ". $_GET['error_message'] . " For support please send an email to hello@lbry.io" . "
"; endif;?>