Changeset 2060649
- Timestamp:
- 04/01/2019 12:58:27 AM (7 years ago)
- Location:
- wpbooklist/trunk
- Files:
-
- 7 edited
-
includes/class-wpbooklist-general-functions.php (modified) (3 diffs)
-
includes/classes/book/class-wpbooklist-book-form.php (modified) (4 diffs)
-
includes/classes/class-wpbooklist-show-book-in-colorbox.php (modified) (2 diffs)
-
includes/ui/class-wpbooklist-frontend-library-list-ui.php (modified) (1 diff)
-
includes/ui/class-wpbooklist-frontend-library-ui.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
wpbooklist.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpbooklist/trunk/includes/class-wpbooklist-general-functions.php
r2051000 r2060649 1577 1577 1578 1578 // Removing my Affiliate ID, as it's only needed for initial API calls when Adding/Editing/Searching for books. 1579 if ( ' wpbooklistid-20'=== $options_row->amazonaff ) {1580 $options_row->amazonaff = ' ';1579 if ( '' === $options_row->amazonaff || null === $options_row->amazonaff ) { 1580 $options_row->amazonaff = 'wpbooklistid-20'; 1581 1581 } 1582 1582 … … 1607 1607 // Removing my Affiliate ID, as it's only needed for initial API calls when Adding/Editing/Searching for books. 1608 1608 if ( false !== stripos( $book_row->amazon_detail_page, 'tag=wpbooklistid-20' ) ) { 1609 $book_row->amazon_detail_page = str_replace( 'tag=wpbooklistid-20', '', $book_row->amazon_detail_page );1609 //$book_row->amazon_detail_page = str_replace( 'tag=wpbooklistid-20', '', $book_row->amazon_detail_page ); 1610 1610 } 1611 1611 … … 1781 1781 // Replace with user's affiliate id, if available. 1782 1782 $amazonaff = $options_results->amazonaff; 1783 $link = str_replace( 'wpbooklistid-20', $amazonaff, $link ); 1783 if ( '' !== $amazonaff && null !== $amazonaff ) { 1784 $link = str_replace( 'wpbooklistid-20', $amazonaff, $link ); 1785 } 1784 1786 1785 1787 $amazoncountryinfo = $options_results->amazoncountryinfo; -
wpbooklist/trunk/includes/classes/book/class-wpbooklist-book-form.php
r2046363 r2060649 159 159 * Outputs the form for adding or editing a book. 160 160 */ 161 public function output_book_form( ) {161 public function output_book_form( $bypass_auth = false ) { 162 162 163 163 global $wpdb; … … 165 165 // Set the current WordPress user. 166 166 $currentwpuser = wp_get_current_user(); 167 167 168 168 169 // Now we'll determine access, and stop all execution if user isn't allowed in. … … 171 172 $this->currentwpbluser = $this->access->wpbooklist_accesscheck( $currentwpuser->ID, 'addbook' ); 172 173 173 // If we received false from accesscheck class, display permissions message and stop all further execution. 174 if ( false === $this->currentwpbluser ) { 175 176 // Outputs the 'No Permission!' message. 177 $this->initial_output = $this->access->wpbooklist_accesscheck_no_permission_message(); 178 return $this->initial_output; 174 // If we want to bypass the authorization check, for example, in the case of outputting the 'Add a Book' form to the frontend in the Submissions Extension. 175 if ( ! $bypass_auth ) { 176 // If we received false from accesscheck class, display permissions message and stop all further execution. 177 if ( false === $this->currentwpbluser ) { 178 179 // Outputs the 'No Permission!' message. 180 $this->initial_output = $this->access->wpbooklist_accesscheck_no_permission_message(); 181 return $this->initial_output; 182 } 179 183 } 180 184 … … 190 194 $query = 'SELECT * FROM ' . $settings_table_name . " WHERE wpuserid = " . $currentwpuser->ID; 191 195 $this->wpbl_user = $transients->create_transient( $transient_name, 'wpdb->get_row', $query, MONTH_IN_SECONDS ); 196 } 197 198 // If the user isn't logged into WordPress (thus $this->wpbl_user is null) and is trying to use this form from the front-end, create the $this->wpbl_user object, and set the 'Libraries' value to 'alllibraries'. This is mainly required for the Submissions Extension. 199 if ( null === $this->wpbl_user ) { 200 $this->wpbl_user = new \stdClass(); 201 $this->wpbl_user->libraries = 'alllibraries'; 192 202 } 193 203 -
wpbooklist/trunk/includes/classes/class-wpbooklist-show-book-in-colorbox.php
r2012881 r2060649 550 550 551 551 // Removing my Affiliate ID with the user's, if set. 552 $this->amazon_detail_page = str_replace( 'wpbooklistid-20', $this->amazonaff, $this->amazon_detail_page ); 553 552 if ( '' !== $this->amazonaff && null !== $this->amazonaff ) { 553 $this->amazon_detail_page = str_replace( 'wpbooklistid-20', $this->amazonaff, $this->amazon_detail_page ); 554 } 555 556 /* 554 557 // Removing my Affiliate ID, as it's only needed for initial API calls when Adding/Editing/Searching for books. 555 558 if ( 'wpbooklistid-20' === $this->amazonaff ) { … … 561 564 $this->amazon_detail_page = str_replace( 'tag=wpbooklistid-20', '', $this->amazon_detail_page ); 562 565 } 566 */ 563 567 } 564 568 -
wpbooklist/trunk/includes/ui/class-wpbooklist-frontend-library-list-ui.php
r2046363 r2060649 1438 1438 // Replace default tag if the user has provided their own - 5.5.3. 1439 1439 if ( strpos( $book->amazon_detail_page, 'wpbooklistid-20' ) ) { 1440 if ( '' !== $this->display_options_actual->amazonaff && null !== $this->display_options_actual->amazonaff ) {1440 if ( '' !== $this->display_options_actual->amazonaff && null !== $this->display_options_actual->amazonaff && 'wpbooklistid-20' !== $this->display_options_actual->amazonaff ) { 1441 1441 $book->amazon_detail_page = str_replace( 'wpbooklistid-20', $this->display_options_actual->amazonaff, $book->amazon_detail_page ); 1442 1442 } -
wpbooklist/trunk/includes/ui/class-wpbooklist-frontend-library-ui.php
r2046363 r2060649 1434 1434 // Replace default tag if the user has provided their own - 5.5.3. 1435 1435 if ( strpos( $book->amazon_detail_page, 'wpbooklistid-20' ) ) { 1436 if ( '' !== $this->display_options_actual->amazonaff && null !== $this->display_options_actual->amazonaff ) {1436 if ( '' !== $this->display_options_actual->amazonaff && null !== $this->display_options_actual->amazonaff && 'wpbooklistid-20' !== $this->display_options_actual->amazonaff ) { 1437 1437 $book->amazon_detail_page = str_replace( 'wpbooklistid-20', $this->display_options_actual->amazonaff, $book->amazon_detail_page ); 1438 1438 } -
wpbooklist/trunk/readme.txt
r2051000 r2060649 5 5 Requires at least: 3.0.1 6 6 Tested up to: 5.0 7 Stable tag: 6.1. 77 Stable tag: 6.1.8 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 290 290 **6.1.7** - Prevented the Pagination tools from appearing on the front-end if multiple pages of books do not exist (Github Issue #75). Introduced check in class-wpbooklist-frontend-library-ui.php file, lines 1387-1392, that prevents attempting to grab a quote using an undefined array index key. Also modified the quotation display to not have the closing quotation mark bolded. (Github Issue #98). Added in translations for the new Submissions Extension (Github Issue #100). Modify the IDs of the field values in the 'Book Form' HTML (Github Issue #101). Modified the 'Class-book.php' file to suite the Submissions Extension (Github Issue #102). Modified the "wpbooklist_dashboard_add_book_action_callback" function to return found book info for the Submissions Extension (Github Issue #103). Added in Advertisment for the new E-Books Extension on the Extensions Menu Page (Github Issue #104). Added in some translations for the WPBookList Search Extension (Github Issue #105). 291 291 292 **6.1.8** - Made change to Amazon API calls to reflect the new Product API Guidelines. Amazon has removed current access to their Product Advertising API for WPBookList, as sufficient revenue wasn't being generated. 293 292 294 293 295 == Upgrade Notice == … … 405 407 =6.1.7= - Prevented the Pagination tools from appearing on the front-end if multiple pages of books do not exist (Github Issue #75). Introduced check in class-wpbooklist-frontend-library-ui.php file, lines 1387-1392, that prevents attempting to grab a quote using an undefined array index key. Also modified the quotation display to not have the closing quotation mark bolded. (Github Issue #98). Added in translations for the new Submissions Extension (Github Issue #100). Modify the IDs of the field values in the 'Book Form' HTML (Github Issue #101). Modified the 'Class-book.php' file to suite the Submissions Extension (Github Issue #102). Modified the "wpbooklist_dashboard_add_book_action_callback" function to return found book info for the Submissions Extension (Github Issue #103). Added in Advertisment for the new E-Books Extension on the Extensions Menu Page (Github Issue #104). Added in some translations for the WPBookList Search Extension (Github Issue #105). 406 408 409 =6.1.8= 410 Made change to Amazon API calls to reflect the new Product API Guidelines. Amazon has removed current access to their Product Advertising API for WPBookList, as sufficient revenue wasn't being generated. 411 -
wpbooklist/trunk/wpbooklist.php
r2046363 r2060649 12 12 * Plugin URI: https://www.jakerevans.com 13 13 * Description: For authors, publishers, librarians, and book-lovers alike - use it to sell your books, record and catalog your library, and more! 14 * Version: 6.1. 714 * Version: 6.1.8 15 15 * Author: Jake Evans 16 16 * Text Domain: wpbooklist … … 36 36 // Root plugin folder directory. 37 37 if ( ! defined( 'WPBOOKLIST_VERSION_NUM' ) ) { 38 define( 'WPBOOKLIST_VERSION_NUM', '6.1. 7' );38 define( 'WPBOOKLIST_VERSION_NUM', '6.1.8' ); 39 39 } 40 40 … … 378 378 add_action( 'wp_ajax_wpbooklist_dashboard_add_book_action', array( $wp_book_list_ajax_functions, 'wpbooklist_dashboard_add_book_action_callback' ) ); 379 379 380 // For adding a book from the frontend, or anywhere else a user could access the 'Add a Book' form while not being logged in. 381 add_action( 'wp_ajax_nopriv_wpbooklist_dashboard_add_book_action', array( $wp_book_list_ajax_functions, 'wpbooklist_dashboard_add_book_action_callback' ) ); 382 380 383 // For creating a WordPress User. 381 384 add_action( 'wp_ajax_wpbooklist_dashboard_create_wp_user_action', array( $wp_book_list_ajax_functions, 'wpbooklist_dashboard_create_wp_user_action_callback' ) );
Note: See TracChangeset
for help on using the changeset viewer.