Changeset 597354
- Timestamp:
- 09/11/2012 06:43:31 AM (13 years ago)
- Location:
- wordpress-amazon-associate/trunk
- Files:
-
- 10 added
- 9 edited
-
AmazonProduct.php (modified) (1 diff)
-
WPAA.php (modified) (5 diffs)
-
WPAA/CacheHandler.php (modified) (2 diffs)
-
WPAA/Module/IP2Nation.php (modified) (2 diffs)
-
WPAA/Module/Template.php (added)
-
WPAA/Module/Widget.php (modified) (5 diffs)
-
WPAA/ShortCodeHandler.php (modified) (4 diffs)
-
WPAA/Template (added)
-
WPAA/Template.php (added)
-
WPAA/Template/DataWrapper.php (added)
-
WPAA/Template/Table.php (added)
-
Widget/Amazon/Template.php (added)
-
imgs/no_image_large.png (added)
-
imgs/no_image_medium.png (added)
-
imgs/no_image_small.png (added)
-
readme.txt (modified) (4 diffs)
-
servlet/admin.php (added)
-
servlet/preview.php (modified) (1 diff)
-
wordpress_amazon_associate.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-amazon-associate/trunk/AmazonProduct.php
r539584 r597354 97 97 $output_str = $options['content']; 98 98 if (!is_null($options['id'])) { 99 $response_group = AmazonProduct_ResponseGroup::ITEM_ATTRIBUTES .", " . AmazonProduct_ResponseGroup::IMAGES;99 $response_group = AmazonProduct_ResponseGroup::ITEM_ATTRIBUTES ."," . AmazonProduct_ResponseGroup::IMAGES; 100 100 $result = $wpaa->getCacheHandler()->getProduct( $options['id'], $options['locale'], $options['type'], $response_group ); 101 101 if ($result->isSuccess() && isset($result->Items[0])) { -
wordpress-amazon-associate/trunk/WPAA.php
r539584 r597354 1 1 <?php 2 2 /* 3 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com3 * copyright (c) 2010,2011,2012 MDBitz - Matthew John Denton - mdbitz.com 4 4 * 5 5 * This file is part of WordPress Amazon Associate Plugin. … … 84 84 85 85 /** 86 * Templates 87 */ 88 const MODULE_TEMPLATE = 'WPAA Templates'; 89 90 /** 86 91 * SourceCode Handler 87 92 * @var WPAA_ShortCodeHandler … … 256 261 //init Cache module 257 262 $this->modules[self::MODULE_CACHE] = new WPAA_Module_Cache( $this->config_hook, $this->version, $this->last_updated ); 263 //init Template Module 264 $this->modules[self::MODULE_TEMPLATE] = new WPAA_Module_Template( $this->config_hook, $this->version, $this->last_updated ); 258 265 if( $this->isValidCredentials() ) { // load if Valid Credentials 259 266 // init Quick Links module … … 630 637 631 638 return $associate_id; 639 } 640 641 642 643 /** 644 * get Array of Enabled Locales 645 * @param String $locale Amazon Locale 646 * @return boolean 647 */ 648 public function getEnabledLocales( $empty = false ) { 649 $locales = array(); 650 if( $empty ) { 651 $locales[""] = ""; 652 } 653 foreach( $this->enabled_locales as $locale => $flag ) { 654 if( $flag ) { 655 $locales[$locale] = $locale; 656 } 657 } 658 return $locales; 632 659 } 633 660 … … 1128 1155 jQuery( "#accessError" ).hide(); 1129 1156 } else { 1130 jQuery( "#accessError" ).html( '<p><b>Code:</b> ' + data.Errors[0].Code + '<br/><br/><b>Message:</b><br/>' + data.Errors[0].Message + '</p>' ).show(); 1157 var errorString = '<b>Code:</b> ' + data.Errors[0].Code + '<br/><br/><b>Message:</b><br/>' + data.Errors[0].Message; 1158 if( data.Errors[0].Code == 'InternalError' ) { 1159 errorString += '<br/><br/>You may not have accepted the API Agreement please sign-in to the <a href="https://affiliate-program.amazon.com/gp/flex/advertising/api/sign-in.html" target="_blank">Amazon Product Advertising API</a> and then re-validate.'; 1160 } else if ( data.Errors[0].Code == 'InvalidClientTokenId' ) { 1161 errorString += "<br/><br/>Amazon has rejected your AWS Access Key, please confirm your access and secret key are correct and that they don't contain extra spaces"; 1162 } 1163 jQuery( "#accessError" ).html( '<p>' + errorString + '</p>' ).show(); 1131 1164 jQuery( "#accessMessage" ).html( '<span style="color:red;" >InValid</span>' ); 1132 1165 } -
wordpress-amazon-associate/trunk/WPAA/CacheHandler.php
r539584 r597354 85 85 global $wpdb; 86 86 $locale = $wpaa->getGeoLocale( $locale ); 87 87 if( is_array( $responseGroup) ) { 88 $responseGroup = implode( ",", $responseGroup ); 89 } 90 88 91 if( $this->_enabled ) { // cache is enabled 89 92 $cache_index = $locale . $id . $type . $responseGroup; … … 99 102 $sql = $wpdb->prepare( "Select data, updated_ts FROM `$this->_table` WHERE id='%s' AND locale='%s' AND type='%s' AND response_group='%s';", $id, $locale, $type, $responseGroup ); 100 103 $result = $wpdb->get_row( $sql ); 101 102 104 //product not in cache 103 105 if( is_null( $result ) ) { -
wordpress-amazon-associate/trunk/WPAA/Module/IP2Nation.php
r410533 r597354 69 69 */ 70 70 protected $db_remote_file = array( 71 "http://www.ip2nation.com/ip2nation.zip", 72 "http://labs.mdbitz.com/ext/ip2nation.zip" 71 "http://www.ip2nation.com/ip2nation.zip" 73 72 ); 74 73 … … 192 191 case 'lu': // Luxembourg 193 192 $locale = 'FR'; 193 break; 194 // ES 195 case 'es': // Spain 196 case 'pt': // Portugal 197 $locale = "ES"; 194 198 break; 195 199 // JP -
wordpress-amazon-associate/trunk/WPAA/Module/Widget.php
r410533 r597354 70 70 "AmazonOmakaseWidget" => true, 71 71 "AmazonProductCloudWidget" => true, 72 "AmazonSearchWidget" => true 72 "AmazonSearchWidget" => true, 73 "AmazonTemplateWidget" => true 73 74 ); 74 75 … … 143 144 register_widget("Widget_Amazon_ProductCloud"); 144 145 } 146 if ($this->options['AmazonTemplateWidget']) { 147 register_widget("Widget_Amazon_Template"); 148 } 145 149 } 146 150 … … 204 208 $this->options['AmazonProductCloudWidget'] = false; 205 209 } 210 //update AmazonTemplateWidget 211 if (isset($_POST['AmazonTemplateWidget'])) { 212 $this->options['AmazonTemplateWidget'] = true; 213 } else { 214 $this->options['AmazonTemplateWidget'] = false; 215 } 206 216 update_option($this->options_name, $this->options); 207 217 … … 238 248 if (isset($newOptions['AmazonProductCloudWidget'])) { 239 249 $this->options['AmazonProductCloudWidget'] = $newOptions['AmazonProductCloudWidget']; 250 } 251 //update AmazonTemplateWidget 252 if (isset($newOptions['AmazonTemplateWidget'])) { 253 $this->options['AmazonTemplateWidget'] = $newOptions['AmazonTemplateWidget']; 240 254 } 241 255 update_option($this->options_name, $this->options); … … 303 317 $content .= '<tr><td><strong>' . __('Amazon Product Cloud:','wpaa') . '</strong></td><td>' . $this->checkbox("AmazonProductCloudWidget", $this->options["AmazonProductCloudWidget"]) . '</td></tr>'; 304 318 $content .= '<tr><td><strong>' . __('Amazon Search:','wpaa') . '</strong></td><td>' . $this->checkbox("AmazonSearchWidget", $this->options["AmazonSearchWidget"]) . '</td></tr>'; 319 $content .= '<tr><td><strong>' . __('Amazon Template:','wpaa') . '</strong></td><td>' . $this->checkbox("AmazonTemplateWidget", $this->options["AmazonTemplateWidget"]) . '</td></tr>'; 305 320 $content .= '</table>'; 306 321 $content .= '<br/><div class="alignright"><input class="button-primary" type="submit" name="submit" value="' . __('Update Settings','wpaa') . ' »" /></div>'; -
wordpress-amazon-associate/trunk/WPAA/ShortCodeHandler.php
r425427 r597354 1 1 <?php 2 2 /* 3 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com3 * copyright (c) 2010,2011,2012 MDBitz - Matthew John Denton - mdbitz.com 4 4 * 5 5 * This file is part of WordPress Amazon Associate Plugin. … … 50 50 add_shortcode('amazon_omakase', array(&$this,'amazonOmakaseHandler')); 51 51 add_shortcode('amazon_product_cloud', array(&$this,'amazonProductCloudHandler')); 52 add_shortcode('amazon_template', array(&$this,'amazonTemplateHandler')); 52 53 if( $mappings != null ) { 53 54 foreach( $mappings as $mapping) { … … 60 61 61 62 /** 63 * Amazon Template Short Code Handler 64 * @param array $atts 65 * @param string $content 66 * @param string $code 67 */ 68 public function amazonTemplateHandler( $atts, $content=null, $code="" ) { 69 $atts['content'] = $content; 70 $atts['echo'] = false; 71 return WPAA_Template::toHTML( $atts ); 72 } 73 74 /** 62 75 * Amazon Link Short Code Handler 63 76 * @param array $atts … … 192 205 return shortcode_atts( $defaultArgs, $atts ); 193 206 } 194 207 195 208 /** 196 209 * Append Container, class and style if enabled -
wordpress-amazon-associate/trunk/readme.txt
r539584 r597354 3 3 Donate Link: http://labs.mdbitz.com/donate/ 4 4 Tags: amazon, associate, affiliate, carousel, widget, filter, search, short code, ip2nation, localization, omakase, my favorites, mp3 clips, multi-user, multi-author, product cloud 5 Requires at least: 3. 0.06 Tested up to: 3. 3.25 Requires at least: 3.2.1 6 Tested up to: 3.4.1 7 7 Stable tag: trunk 8 8 … … 46 46 47 47 1. **Amazon Product Preview** 48 49 1. **New Product Template Support** 48 50 49 51 1. **Amazon Link & Widget Geo-Localization** … … 177 179 178 180 The full project changelogs can be found at [http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/changelog](http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/changelog/?utm_source=wordpress&utm_medium=plugin-readme&utm_campaign=plugin) 181 182 = 2.0.0 = 09/01/2012 = 183 * Basic Template Support and Administration 184 * ip2nation update logic fix 185 * Enhanced Messages to direct users on how to resolve validation errors 179 186 180 187 = 1.8.0 = 05/03/2012 = … … 342 349 * `[amazon_search]` 343 350 351 = Template = 352 353 * `[amazon_template template="1" id="0451463471" ]Content that will display if template not found, inactive or error during rendering[/amazon_template] 354 * `[amazon_template template="Basic Ad" type="ASIN List" id="0451463471,0756407125]Content[/amazon_template]` 355 344 356 = Product Link = 345 357 -
wordpress-amazon-associate/trunk/servlet/preview.php
r425427 r597354 80 80 AmazonWidget::ProductCloud($_GET); 81 81 break; 82 case "Template": 83 WPAA_Template::toHTML($_GET); 84 break; 85 case "TemplatePreview": 86 $template = new stdClass(); 87 $template->CONTENT = urldecode($_REQUEST['CONTENT']); 88 $template->CSS = urldecode($_REQUEST['CSS']); 89 WPAA_Template::preview( $template, $_REQUEST['ID'] ); 90 break; 82 91 } 83 92 ?> -
wordpress-amazon-associate/trunk/wordpress_amazon_associate.php
r539584 r597354 5 5 Description: Quickly and eaily monetize your webiste through the integration of Amazon products and widgets tagged with your associate id. 6 6 Author: MDBitz - Matthew John Denton 7 Version: 1.8.08 Requires at least: 3. 0.07 Version: 2.0.0 8 Requires at least: 3.2.1 9 9 Author URI: http://labs.mdbitz.com 10 10 License: GPL v3 … … 12 12 13 13 /* 14 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com14 * copyright (c) 2010,2011,2012 MDBitz - Matthew John Denton - mdbitz.com 15 15 * 16 16 * This file is part of WordPress Amazon Associate Plugin. … … 44 44 global $wpaa_version; 45 45 global $wpaa_update_date; 46 $wpaa_version = " 1.8.0";47 $wpaa_update_date = "0 5-03-2011";46 $wpaa_version = "2.0.0"; 47 $wpaa_update_date = "09-11-2012"; 48 48 49 49 // load Admin Class
Note: See TracChangeset
for help on using the changeset viewer.