diff --git a/admin/css/lbry-admin.css b/admin/css/lbry-admin.css index 5fea468..6419836 100644 --- a/admin/css/lbry-admin.css +++ b/admin/css/lbry-admin.css @@ -1,82 +1,47 @@ /** - * Stylesheet for the admin pages LBRYPress uses + * Stylesheet for the admin options page * @package LBRYPress */ -.wallet-icon-lbc { - height: 1.8em; - margin-right: .5em; - margin-bottom: -.5em; -} + .wallet-icon-lbc { + height: 1.8em; + margin-right: .5em; + margin-bottom: -.5em; + } + + .bid-icon-lbc { + height: 1.2em; + margin-bottom: -.2em; + } -.bid-icon-lbc { - height: 1.2em; - margin-bottom: -.2em; -} + .lbry-pub-metabox { + margin: 0 0 0 -.2em; + padding: 0 .2em 0 0 ; + } + .meta-icon-lbry { + height: 1.55em; + margin-bottom: -.4em; + padding-left: .1em; + } + .lbry-meta-checkbox-wrapper { + padding: .5em .8em .6em; + } + + .lbry-meta-checkbox-wrapper-last { + padding: .5em .8em 1.5em; + } + .lbry-meta-label { + padding-left: .3em; + padding-right: .6em; + } -.lbry-pub-metabox { - margin: 0 0 0 -.2em; - padding: 0 .2em 0 0 ; -} -.meta-icon-lbry { - height: 1.55em; - margin-bottom: -.4em; - padding-left: .1em; -} -.lbry-meta-checkbox-wrapper { - padding: .5em .8em .6em; -} + .lbry-meta-bx-label { + margin: .5em .8em .6em; + } -.lbry-meta-wrapper-last { - padding: 0em .8em 1.2em; -} - -.lbry-meta-label { - padding: .3em .6em .6em .1em; - /* padding-left: .3em; - padding-right: .6em; - padding-bottom: .5em; */ -} - -.lbry-meta-bx-label { - margin: .5em .8em .6em; -} - -.lbry-meta-bx-option { - padding: .5em .8em .6em; -} - -.lbry-meta-bx-option-last { - padding: .5em .8em 1.5em; -} - -.lbry-hr-meta { - margin-left: 1em; - margin-right: 1em; -} -.post-lbry-display-before { - color: darkgreen; -} -.post-lbry-display { - color: green; -} - -.lbry-pub-metabox { - margin: 0; - font-size: 1em; -} - -.lbry-claim-id-metabox { - margin: 0; - padding-top: .3em; - font-size: .85em; - line-height: 1em; -} - -.lbry-meta-bx-content { - padding: .2em .8em .6em .1em; -} - -.lbry-meta-bx-content-last { - padding: .2em .8em 1em .1em; -} \ No newline at end of file + .lbry-meta-bx-option { + padding: .5em .8em .6em; + } + .lbry-meta-bx-option-last { + padding: .5em .8em 1.5em; + } diff --git a/admin/images/speech-tab.jpg b/admin/images/speech-tab.jpg deleted file mode 100644 index fb62d8a..0000000 Binary files a/admin/images/speech-tab.jpg and /dev/null differ diff --git a/classes/LBRYPress.php b/classes/LBRYPress.php index 3924077..2220953 100644 --- a/classes/LBRYPress.php +++ b/classes/LBRYPress.php @@ -108,7 +108,7 @@ class LBRYPress $this->define('LBRY_VERSION', $this->version); // Library Options Names - //$this->define('LBRY_SETTINGS_GROUP', 'lbry_settings_group'); + $this->define('LBRY_SETTINGS_GROUP', 'lbry_settings_group'); $this->define('LBRY_SETTINGS', 'lbry_settings'); $this->define('LBRY_SETTINGS_SECTION_GENERAL', 'lbry_settings_section_general'); $this->define('LBRY_ADMIN_PAGE', 'lbrypress'); diff --git a/classes/LBRY_Admin.php b/classes/LBRY_Admin.php index e4a7fcb..51abfdf 100644 --- a/classes/LBRY_Admin.php +++ b/classes/LBRY_Admin.php @@ -208,7 +208,7 @@ class LBRY_Admin $license_array = LBRY()->licenses; if ( isset( $input[LBRY_LICENSE] ) && ( in_array( $input[LBRY_LICENSE], $license_array ) ) ) { $new_input[LBRY_LICENSE] = sanitize_text_field( $input[LBRY_LICENSE] ); - } + } if ( isset( $input[LBRY_LBC_PUBLISH] ) ) { $new_input[LBRY_LBC_PUBLISH] = number_format( floatval( $input[LBRY_LBC_PUBLISH] ), 3, '.', '' ); } @@ -290,6 +290,7 @@ class LBRY_Admin ); } + /** * Checkbox to default to always allow publish on LBRY */ @@ -304,6 +305,7 @@ class LBRY_Admin '
Set Default to always Publish to LBRY, this can be adjusted when publishing a New Post.
', 'lbry_default_publish_setting', LBRY_SETTINGS, + ); } @@ -363,6 +365,7 @@ class LBRY_Admin $options ); } + /** * Prints LBC per publish input @@ -421,9 +424,9 @@ class LBRY_Admin '', LBRY_SPEECH_PW, LBRY_SPEECH_SETTINGS, - ); + ); } - + /** * Handles new channel form submission */ diff --git a/classes/LBRY_Daemon.php b/classes/LBRY_Daemon.php index 92e6966..26fd78e 100644 --- a/classes/LBRY_Daemon.php +++ b/classes/LBRY_Daemon.php @@ -33,7 +33,8 @@ class LBRY_Daemon * https://lbry.tech/api/sdk#address_unused * @return string Unused wallet address in base58 */ - public function wallet_unused_address() { + public function wallet_unused_address() + { try { $result = $this->request( 'address_unused' ); return $result->result; @@ -66,30 +67,6 @@ class LBRY_Daemon } } - /** - * Returns the info about a claim can get supports and initial bid amount when claim created among other information about a claim. - * TODO Can be build out later to accept more params - * @param string $claim_id - * @return object $result - */ - public function claim_search( $claim_id ) - { - $params = array( - 'claim_id' => $claim_id, - // 'name' => $norm_name, - // 'claim_type' => $claim_type, - ); - try { - $result = $this->request( 'claim_search', $params ); - $this->logger->log( 'Claim Search Results: ' . print_r( $result->result, true ) ); - return $result->result; - } catch ( LBRYDaemonException $e ) { - $this->logger->log( 'claim_search error', $e->getMessage() . ' | Code: ' . $e->getCode() ); - LBRY()->notice->set_notice( 'error', 'Issue getting claim search info' ); - return; - } - } - /** * Returns the available balance of a current LBRY account * https://lbry.tech/api/sdk#wallet_balance @@ -145,12 +122,12 @@ class LBRY_Daemon if ( strpos( $channel_name, '@' ) ) { throw new \Exception( 'Illegal character "@" in channel name', 1 ); } - + // No white space allowed if ( strpos( $channel_name, ' ' ) ) { throw new \Exception( "No spaces allowed in channel name", 1 ); } - + $channel_name = '@' . $channel_name; try { diff --git a/classes/LBRY_Network.php b/classes/LBRY_Network.php index b64481b..789d56a 100644 --- a/classes/LBRY_Network.php +++ b/classes/LBRY_Network.php @@ -39,7 +39,6 @@ class LBRY_Network // Save the post meta on 'save_post' hook add_action( 'wp_insert_post', array( $this, 'save_post_meta' ), 11, 2 ); - // Checkbox inside the WordPres meta box near "Publish" button add_action( 'post_submitbox_misc_actions', array( $this, 'publish_to_lbry_checkbox' ) ); } @@ -120,27 +119,11 @@ class LBRY_Network public function publish_to_lbry_checkbox( $post ) { + $post_id = $post->ID; + if ( get_post_type( $post_id ) != 'post' ) { return $post; } - $post_id = $post->ID; - $lbry_claim_id = get_post_meta( $post_id, '_lbry_claim_id', true ); - if ( $_GET['action'] === 'edit' ) { - if ( get_post_meta( $post_id, '_lbry_canonical_url', true ) == null || empty( get_post_meta( $post_id, '_lbry_canonical_url', true ) ) ) { - $canonical_url = LBRY()->daemon->canonical_url( $lbry_claim_id ); - update_post_meta( $post_id, '_lbry_canonical_url', $canonical_url ); - } - } - if ( ( get_post_meta( $post_id, '_lbry_will_publish', true ) == true ) && (isset( $lbry_claim_id ) ) ) { - update_post_meta( $post_id, '_lbry_is_published', true ); - } - $lbry_published = get_post_meta( $post_id, '_lbry_is_published', true ); - $lbry_url = ( get_post_meta( $post_id, '_lbry_canonical_url', true ) ); - - if ($lbry_url) { - $open_url = str_replace('lbry://', 'open.lbry.com/', $lbry_url ); - } - $default_value = get_option( LBRY_SETTINGS )['lbry_default_publish_setting']; $new_value = get_post_meta( $post_id, LBRY_WILL_PUBLISH, true ); if ( ( $new_value ) ? $new_value : $new_value = $default_value ); @@ -148,38 +131,17 @@ class LBRY_Network if ( ( $value ) ? $value : 0 ); // nonce set on page meta-box.php - if ( ( $lbry_published ) && ( ( $lbry_url) || ( $lbry_claim_id ) ) ) { - printf( - '