Plugin Directory

Changeset 597354


Ignore:
Timestamp:
09/11/2012 06:43:31 AM (13 years ago)
Author:
mdbitz
Message:

Version 2.0.0

Location:
wordpress-amazon-associate/trunk
Files:
10 added
9 edited

Legend:

Unmodified
Added
Removed
  • wordpress-amazon-associate/trunk/AmazonProduct.php

    r539584 r597354  
    9797        $output_str = $options['content'];
    9898        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;
    100100            $result = $wpaa->getCacheHandler()->getProduct( $options['id'], $options['locale'], $options['type'], $response_group );
    101101            if ($result->isSuccess() && isset($result->Items[0])) {
  • wordpress-amazon-associate/trunk/WPAA.php

    r539584 r597354  
    11<?php
    22/*
    3  * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com
     3 * copyright (c) 2010,2011,2012 MDBitz - Matthew John Denton - mdbitz.com
    44 *
    55 * This file is part of WordPress Amazon Associate Plugin.
     
    8484
    8585    /**
     86     * Templates
     87     */
     88    const MODULE_TEMPLATE = 'WPAA Templates';
     89
     90    /**
    8691     * SourceCode Handler
    8792     * @var WPAA_ShortCodeHandler
     
    256261        //init Cache module
    257262        $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 );
    258265        if( $this->isValidCredentials() ) { // load if Valid Credentials
    259266            // init Quick Links module
     
    630637
    631638        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;
    632659    }
    633660
     
    11281155                        jQuery( "#accessError" ).hide();
    11291156                    } 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();
    11311164                        jQuery( "#accessMessage" ).html( '<span style="color:red;" >InValid</span>' );
    11321165                    }
  • wordpress-amazon-associate/trunk/WPAA/CacheHandler.php

    r539584 r597354  
    8585        global $wpdb;
    8686        $locale = $wpaa->getGeoLocale( $locale );
    87 
     87        if( is_array( $responseGroup) ) {
     88           $responseGroup = implode( ",", $responseGroup );
     89        }
     90       
    8891        if( $this->_enabled ) { // cache is enabled
    8992            $cache_index = $locale . $id . $type . $responseGroup;
     
    99102                $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 );
    100103                $result = $wpdb->get_row( $sql );
    101 
    102104                //product not in cache
    103105                if( is_null( $result ) ) {
  • wordpress-amazon-associate/trunk/WPAA/Module/IP2Nation.php

    r410533 r597354  
    6969     */
    7070    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"
    7372    );
    7473
     
    192191            case 'lu':  // Luxembourg
    193192                $locale = 'FR';
     193                break;
     194            // ES
     195            case 'es':  // Spain
     196            case 'pt':  // Portugal
     197                $locale = "ES";
    194198                break;
    195199            // JP
  • wordpress-amazon-associate/trunk/WPAA/Module/Widget.php

    r410533 r597354  
    7070                "AmazonOmakaseWidget" => true,
    7171                "AmazonProductCloudWidget" => true,
    72                 "AmazonSearchWidget" => true
     72                "AmazonSearchWidget" => true,
     73                "AmazonTemplateWidget" => true
    7374        );
    7475
     
    143144            register_widget("Widget_Amazon_ProductCloud");
    144145        }
     146        if ($this->options['AmazonTemplateWidget']) {
     147            register_widget("Widget_Amazon_Template");
     148        }
    145149    }
    146150
     
    204208                    $this->options['AmazonProductCloudWidget'] = false;
    205209                }
     210                //update AmazonTemplateWidget
     211                if (isset($_POST['AmazonTemplateWidget'])) {
     212                    $this->options['AmazonTemplateWidget'] = true;
     213                } else {
     214                    $this->options['AmazonTemplateWidget'] = false;
     215                }
    206216                update_option($this->options_name, $this->options);
    207217
     
    238248        if (isset($newOptions['AmazonProductCloudWidget'])) {
    239249            $this->options['AmazonProductCloudWidget'] = $newOptions['AmazonProductCloudWidget'];
     250        }
     251        //update AmazonTemplateWidget
     252        if (isset($newOptions['AmazonTemplateWidget'])) {
     253            $this->options['AmazonTemplateWidget'] = $newOptions['AmazonTemplateWidget'];
    240254        }
    241255        update_option($this->options_name, $this->options);
     
    303317                            $content .= '<tr><td><strong>' . __('Amazon Product Cloud:','wpaa') . '</strong></td><td>' . $this->checkbox("AmazonProductCloudWidget", $this->options["AmazonProductCloudWidget"]) . '</td></tr>';
    304318                            $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>';
    305320                            $content .= '</table>';
    306321                            $content .= '<br/><div class="alignright"><input class="button-primary" type="submit" name="submit" value="' . __('Update Settings','wpaa') . ' &raquo;" /></div>';
  • wordpress-amazon-associate/trunk/WPAA/ShortCodeHandler.php

    r425427 r597354  
    11<?php
    22/*
    3  * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com
     3 * copyright (c) 2010,2011,2012 MDBitz - Matthew John Denton - mdbitz.com
    44 *
    55 * This file is part of WordPress Amazon Associate Plugin.
     
    5050        add_shortcode('amazon_omakase', array(&$this,'amazonOmakaseHandler'));
    5151        add_shortcode('amazon_product_cloud', array(&$this,'amazonProductCloudHandler'));
     52        add_shortcode('amazon_template', array(&$this,'amazonTemplateHandler'));
    5253        if( $mappings != null ) {
    5354            foreach( $mappings as $mapping) {
     
    6061
    6162    /**
     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    /**
    6275     * Amazon Link Short Code Handler
    6376     * @param array $atts
     
    192205        return shortcode_atts( $defaultArgs, $atts );
    193206    }
    194    
     207
    195208    /**
    196209     * Append Container, class and style if enabled
  • wordpress-amazon-associate/trunk/readme.txt

    r539584 r597354  
    33Donate Link: http://labs.mdbitz.com/donate/
    44Tags: 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.0
    6 Tested up to: 3.3.2
     5Requires at least: 3.2.1
     6Tested up to: 3.4.1
    77Stable tag: trunk
    88
     
    4646
    47471. **Amazon Product Preview**
     48
     491. **New Product Template Support**
    4850
    49511. **Amazon Link & Widget Geo-Localization**
     
    177179
    178180The 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
    179186
    180187= 1.8.0 = 05/03/2012 =
     
    342349* `[amazon_search]`
    343350
     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
    344356= Product Link =
    345357
  • wordpress-amazon-associate/trunk/servlet/preview.php

    r425427 r597354  
    8080                    AmazonWidget::ProductCloud($_GET);
    8181                    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;
    8291            }
    8392            ?>
  • wordpress-amazon-associate/trunk/wordpress_amazon_associate.php

    r539584 r597354  
    55  Description: Quickly and eaily monetize your webiste through the integration of Amazon products and widgets tagged with your associate id.
    66  Author: MDBitz - Matthew John Denton
    7   Version: 1.8.0
    8   Requires at least: 3.0.0
     7  Version: 2.0.0
     8  Requires at least: 3.2.1
    99  Author URI: http://labs.mdbitz.com
    1010  License: GPL v3
     
    1212
    1313/*
    14  * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com
     14 * copyright (c) 2010,2011,2012 MDBitz - Matthew John Denton - mdbitz.com
    1515 *
    1616 * This file is part of WordPress Amazon Associate Plugin.
     
    4444global $wpaa_version;
    4545global $wpaa_update_date;
    46 $wpaa_version = "1.8.0";
    47 $wpaa_update_date = "05-03-2011";
     46$wpaa_version = "2.0.0";
     47$wpaa_update_date = "09-11-2012";
    4848
    4949// load Admin Class
Note: See TracChangeset for help on using the changeset viewer.