Changeset 410533
- Timestamp:
- 07/16/2011 03:28:38 AM (15 years ago)
- Location:
- wordpress-amazon-associate/trunk
- Files:
-
- 3 added
- 21 edited
-
AmazonProduct.php (modified) (9 diffs)
-
AmazonWidget.php (modified) (7 diffs)
-
AmazonWidget/Omakase.php (modified) (2 diffs)
-
MDBitz/Plugin.php (modified) (2 diffs)
-
WPAA.php (modified) (40 diffs)
-
WPAA/CacheHandler.php (modified) (3 diffs)
-
WPAA/Module/Cache.php (modified) (7 diffs)
-
WPAA/Module/Compliance.php (modified) (2 diffs)
-
WPAA/Module/IP2Nation.php (modified) (7 diffs)
-
WPAA/Module/MultiUser.php (modified) (3 diffs)
-
WPAA/Module/QuickLinks.php (modified) (4 diffs)
-
WPAA/Module/Widget.php (added)
-
WPAA/ShortCodeHandler.php (modified) (12 diffs)
-
WPAA/URIHandler.php (added)
-
Widget/Amazon/Carousel.php (modified) (1 diff)
-
Widget/Amazon/MP3Clips.php (modified) (1 diff)
-
Widget/Amazon/MyFavorites.php (modified) (1 diff)
-
Widget/Amazon/Omakase.php (modified) (1 diff)
-
Widget/Amazon/ProductCloud.php (modified) (1 diff)
-
Widget/Amazon/Search.php (modified) (1 diff)
-
readme.txt (modified) (11 diffs)
-
servlet/index.php (modified) (2 diffs)
-
tinymce/amazon/editor_plugin.js.php (added)
-
wordpress_amazon_associate.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-amazon-associate/trunk/AmazonProduct.php
r386477 r410533 2 2 3 3 /* 4 * copyright (c) 2010 MDBitz - Matthew John Denton - mdbitz.com4 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com 5 5 * 6 6 * This file is part of WordPress Amazon Associate Plugin. … … 48 48 * @param string $target link target 49 49 */ 50 public static function link($content, $id, $locale = null, $type = "ASIN", 51 $target = "_blank", $rel = "nofollow", $container = null, 52 $container_class = null, $title = null ) { 50 public static function link( $options ) { 53 51 global $wpaa; 54 $output_str = $content; 55 if (!is_null($id)) { 56 $result = $wpaa->getCacheHandler()->getProduct( $id, $locale, $type ); 52 // set Default Values 53 $options = shortcode_atts( array( 'content'=>null, 'id'=>null, 54 'locale'=> null, 'type' => 'ASIN', 'target' => '_blank', 55 'rel' => "nofollow", 'container' => null, 'container_class' => null, 56 'container_style' => null, 'title' => null, 'echo' => true ), 57 $options ); 58 // Generate Link 59 $output_str = $options['content']; 60 if (!is_null($options['id'])) { 61 $result = $wpaa->getCacheHandler()->getProduct( $options['id'], $options['locale'], $options['type'] ); 57 62 if ($result->isSuccess() && isset($result->Items[0])) { 58 $output_str = '<a href="' . urldecode($result->Items[0]->DetailPageURL) . '" target="' . $ target . '" rel="' . $rel . '" title="' . (is_null($title) ? '' : $title) . '" >' . $content. '</a>';63 $output_str = '<a href="' . urldecode($result->Items[0]->DetailPageURL) . '" target="' . $options['target'] . '" rel="' . $options['rel'] . '" title="' . (is_null($options['title']) ? '' : $options['title']) . '" >' . $options['content'] . '</a>'; 59 64 } 60 65 } 61 if( ! empty($container) ) { 62 if( ! empty($container_class) ) { 63 $output_str = '<' . $container . ' class="' . $container_class . '" >' . $output_str . '</' . $container . '>'; 64 } else { 65 $output_str = '<' . $container . ' >' . $output_str . '</' . $container . '>'; 66 } 67 } 68 return $output_str; 66 // Generate Response 67 if( $options['echo'] ) { 68 echo WPAA_ShortCodeHandler::doStyle($options, $output_str ); 69 } else { 70 return WPAA_ShortCodeHandler::doStyle( $options, $output_str ); 71 } 69 72 } 70 73 … … 82 85 * @param string $target link target 83 86 */ 84 public static function image($content, $id, $size="medium", $link = false, 85 $locale = null, $type = "ASIN", $target = "_blank", 86 $rel = "nofollow", $class = null, $container = null, 87 $container_class = null, $alt = null, $title = null ) { 87 public static function image($options ) { 88 88 global $wpaa; 89 $output_str = $content; 90 if (!is_null($id)) { 89 // set default values 90 $options = shortcode_atts( array( 'content' => null, 'id'=>null, 91 'locale'=>null, 'size'=>'medium', 'type' => 'ASIN', 'link' => false, 92 'target' => '_blank', 'rel' => "nofollow", 'class'=> null, 93 'container'=>null, 'container_class' => null, 94 'container_style' => null, 'alt' => null, 'title' => null, 95 'echo' => true ), $options ); 96 // Genrate Image 97 $output_str = $options['content']; 98 if (!is_null($options['id'])) { 91 99 $response_group = AmazonProduct_ResponseGroup::ITEM_ATTRIBUTES .", " . AmazonProduct_ResponseGroup::IMAGES; 92 $result = $wpaa->getCacheHandler()->getProduct( $ id, $locale, $type, $response_group );100 $result = $wpaa->getCacheHandler()->getProduct( $options['id'], $options['locale'], $options['type'], $response_group ); 93 101 if ($result->isSuccess() && isset($result->Items[0])) { 94 $ size = strtolower($size);102 $options['size'] = strtolower($options['size']); 95 103 $image = null; 96 switch ($ size) {104 switch ($options['size']) { 97 105 case "small": 98 106 $image = $result->Items[0]->SmallImage; … … 105 113 break; 106 114 } 107 if( ! is_null($ class) ) {108 $image->set( "class", $ class);109 } 110 if( ! is_null($ rel) ) {111 $image->set( "rel", $ rel);112 } 113 if( ! is_null($ title) ) {114 $image->set("title", $ title);115 if( ! is_null($options['class']) ) { 116 $image->set( "class", $options['class'] ); 117 } 118 if( ! is_null($options['rel']) ) { 119 $image->set( "rel", $options['rel'] ); 120 } 121 if( ! is_null($options['title']) ) { 122 $image->set("title", $options['title'] ); 115 123 } else { 116 $image->set("title", $ content);117 } 118 if( ! is_null($ alt) ) {119 $image->set("alt", $ alt);124 $image->set("title", $options['content'] ); 125 } 126 if( ! is_null($options['alt']) ) { 127 $image->set("alt", $options['alt'] ); 120 128 } 121 129 $output_str = ''; 122 if ($ link) {123 $output_str = '<a href="' . urldecode($result->Items[0]->DetailPageURL) . '" target="' . $ target. '">';130 if ($options['link']) { 131 $output_str = '<a href="' . urldecode($result->Items[0]->DetailPageURL) . '" target="' . $options['target'] . '">'; 124 132 } 125 133 if (!is_null($image)) { 126 134 $output_str .= $image->toHTML(); 127 135 } else { 128 $output_str .= $ content;129 } 130 if ($ link) {136 $output_str .= $options['content']; 137 } 138 if ($options['link']) { 131 139 $output_str .= '</a>'; 132 140 } 133 141 } 134 142 } 135 if( ! empty($container) ) { 136 if( ! empty($container_class) ) { 137 $output_str = '<' . $container . ' class="' . $container_class . '" >' . $output_str . '</' . $container . '>'; 138 } else { 139 $output_str = '<' . $container . ' >' . $output_str . '</' . $container . '>'; 140 } 141 } 142 return $output_str; 143 // Generate Response 144 if( $options['echo'] ) { 145 echo WPAA_ShortCodeHandler::doStyle($options, $output_str ); 146 } else { 147 return WPAA_ShortCodeHandler::doStyle( $options, $output_str ); 148 } 143 149 } 144 150 … … 151 157 * @param string $locale Locale 152 158 */ 153 public static function enhanced($asin, $locale = null, $new_window = true, 154 $show_border = true, $larger_image = true, $price = "All", 155 $background_color = "FFFFFF", $text_color="000000", 156 $link_color="0000FF", $container = null, $container_class = null ) { 159 public static function enhanced($options ) { 157 160 global $wpaa; 161 // set defaults 162 $options = shortcode_atts( array( 'content' => null, 'asin' => null, 163 'locale' => null, 'new_window' => true, 'show_border' => true, 164 'larger_image' => true, 'price' => "All", 165 'background_color' => "FFFFFF", 'text_color' => "000000", 166 'link_color' => "0000FF", 'container' => null, 167 'container_class' => null, 'container_style' => null, 168 'echo' => true), $options ); 169 158 170 $outputStr = '<iframe src="'; 159 171 // get Locale 160 $locale = $wpaa->getGeoLocale( $ locale);172 $locale = $wpaa->getGeoLocale( $options['locale'] ); 161 173 // Append service url 162 $outputStr .= self::getURL( $locale ) . '?';174 $outputStr .= WPAA_URIHandler::getRemoteContentURI( $locale ) . '?'; 163 175 // Append Link Target 164 if( $ new_window=== true ) {176 if( $options['new_window'] === true ) { 165 177 $outputStr .= 'lt1=_blank&'; 166 178 } else { … … 168 180 } 169 181 // Append Show Border 170 if( $ show_border=== true ) {182 if( $options['show_border'] === true ) { 171 183 $outputStr .= 'bc1=000000&'; 172 184 } else { … … 174 186 } 175 187 // Append Image Size 176 if( $ larger_image=== true ) {188 if( $options['larger_image'] === true ) { 177 189 $outputStr .= 'IS2=1&'; 178 190 } else { … … 180 192 } 181 193 // Append Pricing Options 182 if( $ price== "New" ) {194 if( $options['price'] == "New" ) { 183 195 $outputStr .= 'nou=1&'; 184 } else if ( $ price== "Hide" ) {196 } else if ( $options['price'] == "Hide" ) { 185 197 $outputStr .= 'npa=1&'; 186 198 } 187 199 // Append Style Options 188 $outputStr .= 'bg1=' . $ background_color. '&';189 $outputStr .= 'fc1=' . $ text_color. '&';190 $outputStr .= 'lc1=' . $ link_color. '&';200 $outputStr .= 'bg1=' . $options['background_color'] . '&'; 201 $outputStr .= 'fc1=' . $options['text_color'] . '&'; 202 $outputStr .= 'lc1=' . $options['link_color'] . '&'; 191 203 // Append Associate Tag 192 204 global $post; … … 200 212 $outputStr .= 'p=8&l=as1&m=amazon&f=ifr&'; 201 213 // Append ASIN ID 202 $outputStr .= 'asins=' . $ asin;214 $outputStr .= 'asins=' . $options['asin']; 203 215 // Close IFrame 204 216 $outputStr .= '" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>'; 205 if( ! empty($container) ) { 206 if( ! empty($container_class) ) { 207 $outputStr = '<' . $container . ' class="' . $container_class . '" >' . $outputStr . '</' . $container . '>'; 208 } else { 209 $outputStr = '<' . $container . ' >' . $outputStr . '</' . $container . '>'; 210 } 211 } 212 return $outputStr; 213 } 214 215 /** 216 * get the service URL for desired locale 217 * 218 * @param string $locale 219 * @return string 220 */ 221 public static function getURL( $locale ) { 222 switch( $locale ) { 223 case "UK": 224 return "http://rcm-uk.amazon.co.uk/e/cm"; 225 break; 226 case "CA": 227 return "http://rcm-ca.amazon.ca/e/cm"; 228 break; 229 case "CN": 230 return "http://rcm-cn.amazon.cn/e/cm"; 231 break; 232 case "DE": 233 return "http://rcm-de.amazon.de/e/cm"; 234 break; 235 case "FR": 236 return "http://rcm-fr.amazon.fr/e/cm"; 237 break; 238 case "JP": 239 return "http://rcm-jp.amazon.co.jp/e/cm"; 240 break; 241 case "IT": 242 return "http://rcm-it.amazon.it/e/cm"; 243 break; 244 default: 245 return "http://rcm.amazon.com/e/cm"; 246 break; 217 218 // Generate Response 219 if( $options['echo'] ) { 220 echo WPAA_ShortCodeHandler::doStyle($options, $outputStr ); 221 } else { 222 return WPAA_ShortCodeHandler::doStyle( $options, $outputStr ); 247 223 } 248 224 } -
wordpress-amazon-associate/trunk/AmazonWidget.php
r353979 r410533 2 2 3 3 /* 4 * copyright (c) 2010 MDBitz - Matthew John Denton - mdbitz.com4 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com 5 5 * 6 6 * This file is part of WordPress Amazon Associate Plugin. … … 43 43 public static function Carousel( $args ) { 44 44 $widget = new AmazonWidget_Carousel( $args ); 45 echo $widget->toHTML();45 echo WPAA_ShortCodeHandler::doStyle( $args, $widget->toHTML() ); 46 46 } 47 47 … … 52 52 public static function MP3Clips( $args ) { 53 53 $widget = new AmazonWidget_MP3Clips( $args ); 54 echo $widget->toHTML();54 echo WPAA_ShortCodeHandler::doStyle( $args, $widget->toHTML() ); 55 55 } 56 56 … … 61 61 public static function MyFavorites( $args ) { 62 62 $widget = new AmazonWidget_MyFavorites( $args ); 63 echo $widget->toHTML();63 echo WPAA_ShortCodeHandler::doStyle( $args, $widget->toHTML() ); 64 64 } 65 65 … … 70 70 public static function Search( $args ) { 71 71 $widget = new AmazonWidget_Search( $args ); 72 echo $widget->toHTML();72 echo WPAA_ShortCodeHandler::doStyle( $args, $widget->toHTML() ); 73 73 } 74 74 … … 79 79 public static function Omakase( $args ) { 80 80 $widget = new AmazonWidget_Omakase( $args ); 81 echo $widget->toHTML();81 echo WPAA_ShortCodeHandler::doStyle( $args, $widget->toHTML() ); 82 82 } 83 83 … … 88 88 public static function ProductCloud( $args ) { 89 89 $widget = new AmazonWidget_ProductCloud( $args ); 90 echo $widget->toHTML();90 echo WPAA_ShortCodeHandler::doStyle( $args, $widget->toHTML() ); 91 91 } 92 92 -
wordpress-amazon-associate/trunk/AmazonWidget/Omakase.php
r321609 r410533 170 170 $output .= ' 171 171 //--></script>'; 172 $output .= '<script type="text/javascript" src="http://www.assoc-amazon.' . self::getDomain( $locale ) . $this->_script_url . '"></script>';172 $output .= '<script type="text/javascript" src="http://www.assoc-amazon.' . WPAA_URIHandler::getDomain( $locale ) . $this->_script_url . '"></script>'; 173 173 return $output; 174 174 } … … 291 291 } 292 292 293 /**294 * return Associative Array of available Markets295 *296 * @return array297 */298 public static function getDomain($locale) {299 switch( $locale ) {300 case "CA":301 return "ca";302 break;303 case "DE":304 return "de";305 break;306 case "FR":307 return "fr";308 break;309 case "JP":310 return "jp";311 break;312 case "UK":313 return "co.uk";314 break;315 default:316 return "com";317 break;318 };319 }320 321 293 322 294 /** -
wordpress-amazon-associate/trunk/MDBitz/Plugin.php
r313769 r410533 36 36 */ 37 37 abstract class MDBitz_Plugin { 38 39 /** 40 * Plugin Version 41 * @var String 42 */ 43 protected $version = '-'; 44 45 /** 46 * Plugin Last Updated 47 * @var String 48 */ 49 protected $last_updated = '-'; 38 50 39 51 /** … … 119 131 } 120 132 133 /** 134 * Output Admin SideBar 135 */ 136 function doAdminSideBar($source) { 137 ?> 138 <div class="postbox-container" style="width:300px;" > 139 <div class="metabox-holder"> 140 <div class="meta-box-sortables"> 141 <?php 142 $content = '<div class="admin_config_box">'; 143 $content .= '<strong>' . __('Author:','wpaa') . '</strong> <a href="http://mdbitz.com/" target="_blank">MDBitz- Matthew Denton</a><br/><br/>'; 144 $content .= '<strong>' . __('Project Website:','wpaa') . '</strong> <a href="http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/?utm_source=' . $source . '&utm_medium=about-us&utm_campaign=plugin" target="_blank">labs.mdbitz.com</a><br/><br/>'; 145 $content .= '<strong>' . __('Version:','wpaa') . '</strong> ' . $this->version . '<br/><br/>'; 146 $content .= '<strong>' . __('Last Updated:','wpaa') . '</strong> ' . $this->last_updated; 147 $content .= '</div>'; 148 $this->postbox("about", __("About this Plugin",'wpaa'), $content); 149 150 $content = '<div class="admin_config_box">'; 151 $content .= '<a href="http://wordpress.org/extend/plugins/wordpress-amazon-associate/" target="_blank">' . __('Rate this plugin','wpaa') . '</a> ' . __('on WordPress') . '<br/><br/>'; 152 $content .= '<a href="http://wordpress.org/extend/plugins/wordpress-amazon-associate/" target="_blank">' . __('Notify','wpaa') . '</a> ' . __('WordPress users this plugin works with your WordPress version','wpaa') . '<br/><br/>'; 153 $content .= '<strong>Share this plugin with others</strong><br/><br/>'; 154 //facebook 155 $content .= '<a href="http://www.facebook.com/sharer.php?u=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/&t=Awesome%20WordPress%20Plugin:%20%20WordPress%20Amazon%20Associate" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/fb.png" alt="Facebook" /></a>'; 156 //digg 157 $content .= ' <a href="http://digg.com/submit?url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/digg.gif" alt="Digg" /></a>'; 158 //stubmleupon 159 $content .= ' <a href="http://www.stumbleupon.com/badge/?url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/stumbleupon.gif" alt="Stumble Upon" /></a>'; 160 //delicious 161 $content .= ' <a href="http://delicious.com/save?v=5&noui&jump=close&url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/deli.gif" alt="Delicous" /></a>'; 162 //twitter 163 $content .= ' <a href="http://twitter.com/home/?status=WordPress+Amazon+Associate+%2C+the+all-in-one+Amazon+Associate+WordPress+Plugin+http://tinyurl.com/wpaaplugin" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/twitter.gif" alt="Twitter" /></a>'; 164 $content .= '</div>'; 165 $this->postbox("feedback", __("User Feedback",'wpaa'), $content); 166 167 $content = '<div class="admin_center" >'; 168 $content .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 169 <input type="hidden" name="cmd" value="_s-xclick"> 170 <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHJwYJKoZIhvcNAQcEoIIHGDCCBxQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBepXKuhGkfHqDUGSYPR+SJftezcmMEcE3Oae/juECySBhVweLZpnK7jJwVBthO7euizPhg3lP0KQy/ea14lxn2HH1e1NxE0B/iyD55Z3N6ly0/uDBQVI9gDpL0Esyva1fPjGyYbFDLpauG6gZQlcaCpVXVNu8XjP424HKvxv3e6DELMAkGBSsOAwIaBQAwgaQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIy1Yt8ma1h2yAgYAPJ/DDalqI9KnesGiJnjXHqyDU7gWj5yVlFSsY3wyT1DqGd7HXmYGtbyuRwSOuFvreuk2zn+h3wzGi4CMoAIGQTBrYeaIexZHO2flnwQT5WG99qiMFOXMd+LMnHiRuYmCgIc7vjAk82bZdHsmxThEwMcuFYyHBaJ/ljLCLorOHaqCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDV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QIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEwMTAyMjExNTY1M1owIwYJKoZIhvcNAQkEMRYEFG9XjtXvii5csRnOJ5DPr67owUaMMA0GCSqGSIb3DQEBAQUABIGApAZcp9yNC9Kq7dyJ1b+ndpu9dAAjXSKFZlR9qvhpurUIcnn3QivTsIKR/AaBgK0O62794omrrKG2jlxFjiHTwb0hgFbShBg4AJd2dpjF9AJ5WFa1V5SGYoscmNYrHnRoaYZIc5SPbd7Fto0vuIK1Z1Jq8x3rZ2ex85I3WLLusKg=-----END PKCS7----- 171 "> 172 <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 173 <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 174 </form>'; 175 $content .= '</div>'; 176 $this->postbox("donate", __("Show your support!",'wpaa'), $content); 177 ?> 178 </div> 179 </div> 180 </div> 181 <?php 182 } 183 121 184 } 122 185 -
wordpress-amazon-associate/trunk/WPAA.php
r400955 r410533 1 1 <?php 2 2 /* 3 * copyright (c) 2010 MDBitz - Matthew John Denton - mdbitz.com3 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com 4 4 * 5 5 * This file is part of WordPress Amazon Associate Plugin. … … 74 74 75 75 /** 76 * Amazon Banners 77 */ 78 const MODULE_AMAZON_BANNER = 'Amazon Banners'; 79 80 /** 81 * Amazon Widgets 82 */ 83 const MODULE_AMAZON_WIDGETS = 'Amazon Widgets'; 84 85 /** 76 86 * SourceCode Handler 77 87 * @var WPAA_ShortCodeHandler … … 99 109 "JP" => "wp-amazon-associate-22" 100 110 ); 101 111 102 112 /** 103 113 * Amazon Associate Ids … … 116 126 * @var Array 117 127 */ 118 protected $enabled_locales = array( 119 "US" => true, 120 "UK" => true, 128 protected $enabled_locales = array( 129 "US" => true, 130 "UK" => true, 121 131 "CA" => true, 122 "CN" => true,123 132 "DE" => true, 124 "IT" => true,125 133 "FR" => true, 126 134 "JP" => true … … 176 184 "SecretKey" => null, 177 185 "AssociateSupport" => "0", 186 "AdminSupport" => "0", 178 187 "ProductPreview" => false, 179 188 "ProductPreviewNoConflict" => false, 180 "AmazonCarouselWidget" => true,181 "AmazonMyFavoritesWidget" => true,182 "AmazonMP3ClipsWidget" => true,183 "AmazonOmakaseWidget" => true,184 "AmazonProductCloudWidget" => true,185 "AmazonSearchWidget" => true,186 189 "FilterAssociateTag" => false, 187 "MultiUser" => false 190 "MultiUser" => false, 191 "AWSValid" => null, 192 "Version" => null, 193 "CVEnabled" => false, 194 "CVLocale" => "" 188 195 ); 189 196 … … 198 205 * @var String 199 206 */ 200 protected $version = '1. 6.1';207 protected $version = '1.7.0'; 201 208 202 209 /** … … 204 211 * @var String 205 212 */ 206 protected $last_updated = '0 6-24-2011';213 protected $last_updated = '07-15-2011'; 207 214 208 215 /** … … 211 218 function __construct() { 212 219 parent::__construct(); 213 add_action('admin_head', array(&$this, 'configPageHead')); 214 add_action('admin_print_scripts', array(&$this, 'configPageScripts')); 215 add_action('admin_print_styles', array(&$this, 'configPageStyles')); 216 add_action('admin_notices', array(&$this, 'displayErrorMessage')); 220 add_action('admin_head', array(&$this, 'doPageHead')); 221 add_action('admin_print_scripts', array(&$this, 'doPageScripts')); 222 add_action('admin_print_styles', array(&$this, 'doPageStyles')); 217 223 add_action('admin_init', array(&$this, 'saveSettings')); 218 224 add_action('init', array(&$this, 'init')); 219 add_action('widgets_init', array(&$this, 'init_widgets'));220 225 $this->loadOptions(); 221 226 $this->loadModules(); 227 $this->upgrade(); 222 228 // init I18n 223 229 load_plugin_textdomain('wpaa', false, dirname( plugin_basename(__FILE__) ) . '/languages'); … … 228 234 */ 229 235 public function loadModules() { 230 // init compliance module 231 $this->modules[self::MODULE_COMPLIANCE] = new WPAA_Module_Compliance( $this->config_hook, $this->version, $this->last_updated ); 232 // init ip2nation module 233 $this->modules[self::MODULE_IP2NATION] = new WPAA_Module_IP2Nation( $this->config_hook, $this->version, $this->last_updated ); 234 // init ip2nation module 235 $this->modules[self::MODULE_QUICK_LINKS] = new WPAA_Module_QuickLinks( $this->config_hook, $this->version, $this->last_updated ); 236 // init MultiUser 236 // init Multi User Support 237 237 if( $this->options['MultiUser'] ) { 238 238 // init multi user module 239 239 $this->modules[self::MODULE_MULTI_USER] = new WPAA_Module_MultiUser( $this->config_hook, $this->version, $this->last_updated ); 240 240 } 241 //init cache module 241 // init Widget module 242 $this->modules[self::MODULE_AMAZON_WIDGETS] = new WPAA_Module_Widget( $this->config_hook, $this->version, $this->last_updated ); 243 // init Compliance module 244 $this->modules[self::MODULE_COMPLIANCE] = new WPAA_Module_Compliance( $this->config_hook, $this->version, $this->last_updated ); 245 //init Amazon Banner 246 //$this->modules[self::MODULE_AMAZON_BANNER] = new WPAA_Module_Banner( $this->config_hook, $this->version, $this->last_updated ); 247 // init ip2nation module 248 $this->modules[self::MODULE_IP2NATION] = new WPAA_Module_IP2Nation( $this->config_hook, $this->version, $this->last_updated ); 249 //init Cache module 242 250 $this->modules[self::MODULE_CACHE] = new WPAA_Module_Cache( $this->config_hook, $this->version, $this->last_updated ); 251 if( $this->isValidCredentials() ) { // load if Valid Credentials 252 // init Quick Links module 253 $this->modules[self::MODULE_QUICK_LINKS] = new WPAA_Module_QuickLinks( $this->config_hook, $this->version, $this->last_updated ); 254 } 243 255 // init ShortCode Handler 244 256 $this->scHandler = new WPAA_ShortCodeHandler($this->modules[self::MODULE_COMPLIANCE]->getCompliantShortCodeMappings()); … … 266 278 // add amazon filter if enabled 267 279 if( $this->options['FilterAssociateTag'] === true ) { 268 add_filter('the_content', array(&$this,'filter_amazon_associate_tag') );269 add_filter('comment_text', array(&$this,'filter_amazon_associate_tag') );280 add_filter('the_content', array(&$this,'filter_amazon_associate_tag'), 25); 281 add_filter('comment_text', array(&$this,'filter_amazon_associate_tag'), 25); 270 282 } 271 283 // insert product preview code if enabled … … 281 293 */ 282 294 public function append_product_preview() { 295 global $post; 296 $author_id = null; 297 if( !is_null( $post ) && isset( $post->post_author ) ) { 298 $author_id = $post->post_author; 299 } 283 300 $content = ""; 284 $content .= '<script type="text/javascript" src="http://www.assoc-amazon.com/s/link-enhancer?tag=' . $this->getAssociateId( $this->getGeoLocale()) . '&o=' . $this->locale_o[$this->getGeoLocale()] . '"></script>';285 $content .= '<noscript><img src="http://www.assoc-amazon.com/s/noscript?tag=' . $this->getAssociateId( $this->getGeoLocale()) . '" alt="" /></noscript>';301 $content .= '<script type="text/javascript" src="http://www.assoc-amazon.com/s/link-enhancer?tag=' . $this->getAssociateId( $this->getGeoLocale(), $author_id ) . '&o=' . $this->locale_o[$this->getGeoLocale()] . '"></script>'; 302 $content .= '<noscript><img src="http://www.assoc-amazon.com/s/noscript?tag=' . $this->getAssociateId( $this->getGeoLocale(), $author_id ) . '" alt="" /></noscript>'; 286 303 if( $this->options['ProductPreviewNoConflict'] === true ) { 287 304 $content = '<script type="text/javascript">var dom = {};dom.query = jQuery.noConflict(true);</script>' . $content . '<script type="text/javascript">$=dom.query;</script>'; … … 314 331 return $content; 315 332 } 316 317 public function localize_static_tag( $orig_str ) { 318 $locale = $this->getGeoLocale(); 319 $new_str = $orig_str; 320 $replacement = 'amazon.com'; 321 switch ( $locale ) { 322 case "US" : 323 $replacement = 'amazon.com'; 324 break; 325 case "UK" : 326 $replacement = 'amazon.co.uk'; 327 break; 328 case "DE" : 329 $replacement = "amazon.de"; 330 break; 331 case "CA" : 332 $replacement = "amazon.ca"; 333 break; 334 case "JP" : 335 $replacement = "amazon.co.jp"; 336 break; 337 case "FR" : 338 $replacement = "amazon.fr"; 339 break; 340 case "CN" : 341 $replacement = "amazon.cn"; 342 break; 343 case "IT" : 344 $replacement = "amazon.it"; 345 break; 346 } 347 $new_str = str_replace( 'amazon.com', $replacement, $new_str ); 348 $new_str = str_replace( 'amazon.co.uk', $replacement, $new_str ); 349 $new_str = str_replace( 'amazon.co.jp', $replacement, $new_str ); 350 $new_str = str_replace( 'amazon.de', $replacement, $new_str ); 351 $new_str = str_replace( 'amazon.ca', $replacement, $new_str ); 352 $new_str = str_replace( 'amazon.fr', $replacement, $new_str ); 353 $new_str = str_replace( 'amazon.cn', $replacement, $new_str ); 354 $new_str = str_replace( 'amazon.it', $replacement, $new_str ); 355 $handle = curl_init($new_str); 356 if (false === $handle) { 357 return $orig_str; 358 } 359 curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE); 360 curl_setopt($handle, CURLOPT_NOBODY, true); 361 $response = curl_exec($handle); 362 $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); 363 curl_close($handle); 364 if($httpCode == 404) { 365 return $orig_str; 366 } else { 367 return $new_str; 368 } 369 } 333 334 /** 335 * Are AWS Credentials Valid 336 * @return boolan 337 */ 338 public function isValidCredentials() { 339 if( is_null($this->options['AWSValid']) ) { 340 return $this->validateCredentials(); 341 } else { 342 return $this->options['AWSValid']; 343 } 344 } 345 346 /** 347 * Validate AWS Credentials 348 * @return boolean 349 */ 350 public function validateCredentials() { 351 if( ! empty($this->options['AccessKey']) && ! empty($this->options['SecretKey'])) { 352 353 $api = $this->getAPI(); 354 $result = null; 355 switch( $this->getGeoLocale() ) { 356 case 'US': 357 $result = $api->browseNodeLookup("1000"); 358 break; 359 case "UK": 360 $result = $api->browseNodeLookup("1025612"); 361 break; 362 case "CA": 363 $result = $api->browseNodeLookup("927726"); 364 break; 365 case "DE": 366 $result = $api->browseNodeLookup("541686"); 367 break; 368 case "FR": 369 $result = $api->browseNodeLookup("468256"); 370 break; 371 case "JP": 372 $result = $api->browseNodeLookup("465610"); 373 break; 374 } 375 if( $result != null && $result->isSuccess() ) { 376 return true; 377 } 378 } 379 return false; 380 } 381 382 /** 383 * Localize Static Tags 384 * @param String $orig_str Amazon Product URL 385 * @return String localized link 386 */ 387 public function localize_static_tag( $orig_str ) { 388 $locale = $this->getGeoLocale(); 389 $new_str = $orig_str; 390 $replacement = 'amazon.com'; 391 switch ( $locale ) { 392 case "US" : 393 $replacement = 'amazon.com'; 394 break; 395 case "UK" : 396 $replacement = 'amazon.co.uk'; 397 break; 398 case "DE" : 399 $replacement = "amazon.de"; 400 break; 401 case "CA" : 402 $replacement = "amazon.ca"; 403 break; 404 case "JP" : 405 $replacement = "amazon.co.jp"; 406 break; 407 case "FR" : 408 $replacement = "amazon.fr"; 409 break; 410 case "CN" : 411 $replacement = "amazon.cn"; 412 break; 413 case "IT" : 414 $replacement = "amazon.it"; 415 break; 416 } 417 $new_str = str_replace( 'amazon.com', $replacement, $new_str ); 418 $new_str = str_replace( 'amazon.co.uk', $replacement, $new_str ); 419 $new_str = str_replace( 'amazon.co.jp', $replacement, $new_str ); 420 $new_str = str_replace( 'amazon.de', $replacement, $new_str ); 421 $new_str = str_replace( 'amazon.ca', $replacement, $new_str ); 422 $new_str = str_replace( 'amazon.fr', $replacement, $new_str ); 423 $new_str = str_replace( 'amazon.cn', $replacement, $new_str ); 424 $new_str = str_replace( 'amazon.it', $replacement, $new_str ); 425 $handle = curl_init($new_str); 426 if (false === $handle) { 427 return $orig_str; 428 } 429 curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE); 430 curl_setopt($handle, CURLOPT_NOBODY, true); 431 $response = curl_exec($handle); 432 $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); 433 curl_close($handle); 434 if($httpCode == 404 || $httpCode == 405) { 435 return $orig_str; 436 } else { 437 return $new_str; 438 } 439 } 370 440 371 441 /** … … 413 483 414 484 /** 415 * enable Plugin Widgets416 */417 public function init_widgets() {418 if ($this->options['AmazonCarouselWidget']) {419 register_widget("Widget_Amazon_Carousel");420 }421 if ($this->options['AmazonMyFavoritesWidget']) {422 register_widget("Widget_Amazon_MyFavorites");423 }424 if ($this->options['AmazonMP3ClipsWidget']) {425 register_widget("Widget_Amazon_MP3Clips");426 }427 if ($this->options['AmazonSearchWidget']) {428 register_widget("Widget_Amazon_Search");429 }430 if ($this->options['AmazonOmakaseWidget']) {431 register_widget("Widget_Amazon_Omakase");432 }433 if ($this->options['AmazonProductCloudWidget']) {434 register_widget("Widget_Amazon_ProductCloud");435 }436 }437 438 /**439 485 * Register Amazon Button 440 486 * @param array $buttons … … 452 498 */ 453 499 public function register_amazon_tinymce_plugin($plugin_array) { 454 $plugin_array['amazonproductlink'] = get_bloginfo('wpurl') . '/' . PLUGINDIR . '/wordpress-amazon-associate/tinymce/amazon/editor_plugin.js'; 500 $url = get_bloginfo('wpurl') . '/' . PLUGINDIR . '/wordpress-amazon-associate/tinymce/amazon/editor_plugin.js.php'; 501 $params = "?product=" . $this->isValidCredentials(); 502 $widgetModule = $this->getModule(self::MODULE_AMAZON_WIDGETS); 503 if( $widgetModule->isEnabled( 'AmazonCarouselWidget' ) ) { 504 $params .= "&carousel=true"; 505 } 506 if( $widgetModule->isEnabled( 'AmazonMyFavoritesWidget') ) { 507 $params .= "&my-favorites=true"; 508 } 509 if( $widgetModule->isEnabled( 'AmazonMP3ClipsWidget') ) { 510 $params .= "&mp3-clips=true"; 511 } 512 if( $widgetModule->isEnabled( 'AmazonOmakaseWidget') ) { 513 $params .= "&omakase=true"; 514 } 515 if( $widgetModule->isEnabled( 'AmazonProductCloudWidget') ) { 516 $params .= "&product-cloud=true"; 517 } 518 if( $widgetModule->isEnabled( 'AmazonSearchWidget') ) { 519 $params .= "&search=true"; 520 } 521 $plugin_array['amazonproductlink'] = $url . $params; 455 522 return $plugin_array; 456 523 } … … 463 530 $apapi = new AmazonProductAPI(); 464 531 $locale = $this->getGeoLocale( $locale ); 465 if( $locale == "CN" || $locale == "IT" ) { // China and IT are invalid locales 466 $apapi->setLocale( $this->getLocale() ); 467 } else { 468 $apapi->setLocale( $locale ); 469 } 470 global $post; 532 $apapi->setLocale( $locale ); 533 global $post; 471 534 $author_id = null; 472 535 if( !is_null( $post ) && isset( $post->post_author ) ) { … … 497 560 $associate_id = $this->associate_tags[$locale]; 498 561 } 499 562 500 563 // Check if should use our associate tag 501 564 if( empty( $associate_id ) ) { 502 565 // no associate tag 503 $associate_id =$this->our_associate_tags[$locale];566 return $this->our_associate_tags[$locale]; 504 567 } else { 505 568 // set to our Associate Tag if enabled … … 507 570 if ($supportThreshold != 0) { 508 571 if (rand(1, 100) <= $supportThreshold) { 509 $associate_id = $this->our_associate_tags[$locale]; 572 return $this->our_associate_tags[$locale]; 573 } 574 } 575 // set to Admin Associate Tag if enabled 576 $supportThreshold = intval($this->options['AdminSupport']); 577 if( $supportThreshold != 0 ) { 578 if( rand(1,100) <= $supportThreshold ) { 579 return $this->associate_tags[$locale]; 510 580 } 511 581 } … … 513 583 514 584 return $associate_id; 585 } 586 587 /** 588 * is Locale Enabled 589 * @param String $locale Amazon Locale 590 * @return boolean 591 */ 592 public function isLocaleEnabled( $locale ) { 593 if( $this->enabled_locales[$locale] === false ) { 594 return false; 595 } else { 596 return true; 597 } 515 598 } 516 599 … … 521 604 public function getGeoLocale( $locale = null) { 522 605 if( is_null( $locale ) || empty( $locale ) ) { 606 // Admin Localization 607 if ( current_user_can('manage_options') ) { 608 if( $this->options['CVEnabled'] && $this->options['CVLocale'] != '' ) { 609 return $this->options['CVLocale']; 610 } 611 } 523 612 // Get Geo Locale if enabled 524 if( $this->modules[self::MODULE_IP2NATION]->isInstalled() && $this->options['LocaleByGeoIP'] ) {613 if( $this->modules[self::MODULE_IP2NATION]->isInstalled() && $this->options['LocaleByGeoIP'] ) { 525 614 $locale = $this->modules[self::MODULE_IP2NATION]->getGeoLocale(); 526 615 // Set to default locale if not supported … … 542 631 return $this->options['Locale']; 543 632 } 544 633 545 634 /** 546 635 * get cache handler … … 584 673 $this->options['SecretKey'] = $_POST['SecretKey']; 585 674 } 675 586 676 //update Locale 587 677 if (isset($_POST['Locale'])) { … … 598 688 $this->options['AssociateSupport'] = $_POST['AssociateSupport']; 599 689 } 690 //update AdminSupport 691 if (isset($_POST['AdminSupport'])) { 692 $this->options['AdminSupport'] = $_POST['AdminSupport']; 693 } 600 694 //update ProductPreview 601 695 if (isset($_POST['ProductPreview'])) { … … 616 710 $this->options['FilterAssociateTag'] = false; 617 711 } 618 //update AmazonCarouselWidget619 if (isset($_POST['AmazonCarouselWidget'])) {620 $this->options['AmazonCarouselWidget'] = true;621 } else {622 $this->options['AmazonCarouselWidget'] = false;623 }624 //update AmazonMyFavoritesWidget625 if (isset($_POST['AmazonMyFavoritesWidget'])) {626 $this->options['AmazonMyFavoritesWidget'] = true;627 } else {628 $this->options['AmazonMyFavoritesWidget'] = false;629 }630 //update AmazonMP3ClipsWidget631 if (isset($_POST['AmazonMP3ClipsWidget'])) {632 $this->options['AmazonMP3ClipsWidget'] = true;633 } else {634 $this->options['AmazonMP3ClipsWidget'] = false;635 }636 //update AmazonSearchWidget637 if (isset($_POST['AmazonSearchWidget'])) {638 $this->options['AmazonSearchWidget'] = true;639 } else {640 $this->options['AmazonSearchWidget'] = false;641 }642 //update AmazonOmakaseWidget643 if (isset($_POST['AmazonOmakaseWidget'])) {644 $this->options['AmazonOmakaseWidget'] = true;645 } else {646 $this->options['AmazonOmakaseWidget'] = false;647 }648 //update AmazonProductCloudWidget649 if (isset($_POST['AmazonProductCloudWidget'])) {650 $this->options['AmazonProductCloudWidget'] = true;651 } else {652 $this->options['AmazonProductCloudWidget'] = false;653 }654 712 //update MultiUser 655 713 if (isset($_POST['MultiUser'])) { … … 658 716 $this->options['MultiUser'] = false; 659 717 } 718 // update CVEnabled 719 if (isset($_POST['CVEnabled'])) { 720 $this->options['CVEnabled'] = true; 721 } else { 722 $this->options['CVEnabled'] = false; 723 } 724 // update CVLocale 725 if (isset($_POST['CVLocale'])) { 726 $this->options['CVLocale'] = $_POST['CVLocale']; 727 } 728 // Validate Credentials 729 $this->options['AWSValid'] = $this->validateCredentials(); 660 730 update_option($this->config_options_name, $this->options); 661 731 … … 713 783 $this->enabled_locales['FR'] = false; 714 784 } 785 if (isset($_POST['Locale-JP'])) { 786 $this->enabled_locales['JP'] = true; 787 } else { 788 $this->enabled_locales['JP'] = false; 789 } 790 if (isset($_POST['Locale-UK'])) { 791 $this->enabled_locales['UK'] = true; 792 } else { 793 $this->enabled_locales['UK'] = false; 794 } 795 if (isset($_POST['Locale-CA'])) { 796 $this->enabled_locales['CA'] = true; 797 } else { 798 $this->enabled_locales['CA'] = false; 799 } 715 800 if (isset($_POST['Locale-IT'])) { 716 801 $this->enabled_locales['IT'] = true; … … 718 803 $this->enabled_locales['IT'] = false; 719 804 } 720 if (isset($_POST['Locale-JP'])) {721 $this->enabled_locales['JP'] = true;722 } else {723 $this->enabled_locales['JP'] = false;724 }725 if (isset($_POST['Locale-UK'])) {726 $this->enabled_locales['UK'] = true;727 } else {728 $this->enabled_locales['UK'] = false;729 }730 805 update_option($this->locales_options_name, $this->enabled_locales ); 731 806 … … 736 811 737 812 /** 738 * Output error messages739 */740 public function displayErrorMessage() {741 if (empty($this->options['AccessKey']) || empty($this->options['SecretKey'])) {742 $admin_url = admin_url('admin.php?page=' . $this->config_hook);743 echo '<div class="updated fade">WordPress Amazon Associate: ' . __('Plugin is not configured! Please correct in the', 'wpaa') . ' <a href="' . $admin_url . '" target="_self">' . __('settings page', 'wpaa') . '</a></div>';744 }745 }746 747 /**748 813 * @see MDBitz_WP_Plugin::registerAdminMenu 749 814 */ 750 815 public function registerAdminMenu() { 751 add_menu_page("WP - Amazon", "WP - Amazon", $this->config_options_lvl, $this->config_hook, array(&$this, ' configPage'));752 add_submenu_page($this->config_hook, "Settings", "Settings", $this->config_options_lvl, $this->config_hook, array(&$this, ' configPage'));816 add_menu_page("WP - Amazon", "WP - Amazon", $this->config_options_lvl, $this->config_hook, array(&$this, 'doPage')); 817 add_submenu_page($this->config_hook, "Settings", "Settings", $this->config_options_lvl, $this->config_hook, array(&$this, 'doPage')); 753 818 754 819 } … … 785 850 } 786 851 787 // removal of AssociateId ToDO : remove in Version 2.0 <<---------- 852 } 853 854 /** 855 * Version Upgrade :: update plugin options 856 */ 857 private function upgrade() { 858 859 // removal of AssociateId :: Version < 1.1 Upgrade 788 860 if( isset( $this->options["AssociateId"] ) ) { 789 861 $this->associate_tags[$this->options["Locale"]] = $this->options["AssociateId"]; … … 792 864 update_option($this->tags_options_name, $this->associate_tags); 793 865 } 866 867 // migration of Widgets Enabled :: Version < 2.0.0 Upgrade 868 if( isset( $this->options['AmazonCarouselWidget'])) { 869 $this->modules[self::MODULE_AMAZON_WIDGETS]->updateSettings( $this->options ); 870 unset( $this->options['AmazonCarouselWidget'] ); 871 unset( $this->options['AmazonMyFavoritesWidget'] ); 872 unset( $this->options['AmazonMP3ClipsWidget'] ); 873 unset( $this->options['AmazonSearchWidget'] ); 874 unset( $this->options['AmazonOmakaseWidget'] ); 875 unset( $this->options['AmazonProductCloudWidget'] ); 876 update_option($this->config_options_name, $this->options ); 877 } 878 879 // update AWSValid with current settings :: Version < 2.0.0 Upgrade 880 if( is_null( $this->options['AWSValid'] ) ) { 881 $this->options['AWSValid'] = $this->validateCredentials(); 882 update_option($this->config_options_name, $this->options ); 883 } 884 885 // update Saved Version plugin 886 if( is_null( $this->options['Version'] ) || $this->options['Version'] != $this->version ) { 887 $this->options['Version'] = $this->version; 888 update_option($this->config_options_name, $this->options); 889 // send site installation information 890 // Information Sent: 891 // APP -> WPAA (WordPress-Amazon-Associate) 892 // Version -> (Plugin Version) 893 // site -> WebSite URL 894 if( function_exists('curl_init') ) { 895 $handle = curl_init('http://mdbitz.com/installs.php?app=WPAA&version=' . $this->version . '&site=' . site_url() ); 896 if (false === $handle) { 897 return; 898 } 899 curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE); 900 curl_setopt($handle, CURLOPT_NOBODY, true); 901 $response = curl_exec($handle); 902 curl_close($handle); 903 } 904 } 794 905 } 795 906 … … 807 918 * Output Admin Page header scripts 808 919 */ 809 public function configPageHead() {920 public function doPageHead() { 810 921 if (isset($_GET['page']) && $_GET['page'] == $this->config_hook) { 811 922 wp_enqueue_script('jquery'); … … 816 927 * Output Config Page Styles 817 928 */ 818 function configPageStyles() {929 function doPageStyles() { 819 930 if (isset($_GET['page']) && $_GET['page'] == $this->config_hook) { 820 931 wp_enqueue_style('dashboard'); … … 825 936 } else if( is_admin() ) { 826 937 wp_enqueue_style('thickbox'); 827 wp_enqueue_style(' wpaa-fancybox-css', WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/js/fancybox/jquery.fancybox-1.3.4.css' );938 wp_enqueue_style('fancybox', WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/js/fancybox/jquery.fancybox-1.3.4.css' ); 828 939 wp_enqueue_style('wpaa-widget-css', WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/css/widget.css'); 829 940 } … … 833 944 * Output Page Scripts 834 945 */ 835 function configPageScripts() {946 function doPageScripts() { 836 947 if (isset($_GET['page']) && $_GET['page'] == $this->config_hook) { 837 948 wp_enqueue_script('postbox'); … … 841 952 } else if( is_admin() ){ 842 953 wp_enqueue_script('thickbox'); 843 wp_enqueue_script(' wpaa-fancybox-js', WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/js/fancybox/jquery.fancybox-1.3.4.js' );954 wp_enqueue_script('fancybox', WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/js/fancybox/jquery.fancybox-1.3.4.js' ); 844 955 } 845 956 } … … 848 959 * output Main Settings Page 849 960 */ 850 public function configPage() { 961 public function doPage() { 962 // output message if set 963 if( ! empty( $this->message ) ) { 964 echo '<div class="updated fade">' . $this->message . '</div>'; 965 } 966 if( ! $this->isValidCredentials() ) { 967 echo '<div class="error">' . __('<strong>Warning</strong>: Quick Links and Product Searches are disabled. To enable please enter your valid AWS Access and Secret Keys', 'wpaa' ) . '</div>'; 968 } 851 969 ?> 852 970 <div class="wrap"> … … 862 980 $content .= '<table border="0" class="admin_table">'; 863 981 $content .= '<tr><th>' . __('Primary', 'wpaa') . '</th><th>' . __('Amazon Locale', 'wpaa') . '</th><th>' . __('Associate Tag', 'wpaa') . '</th><th>' . __( 'Active', 'wpaa') . '</th></tr>'; 864 $content .= '<tr><td>' . $this->radio( "Locale", "US", (($this->options['Locale'] == "US" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_us.gif') . '" /> <a href="https://affiliate-program.amazon.com/" target="_blank">' . __('United States', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-US', $this->associate_tags['US'] ) . '</td><td>' . $this->checkbox( 'Locale-US', $this->enabled_locales['US'] ) . '</td></tr>';865 $content .= '<tr><td>' . $this->radio( "Locale", "CA", (($this->options['Locale'] == "CA" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_ca.gif') . '" /> <a href="https://associates.amazon.ca/" target="_blank">' . __('Canada', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-CA', $this->associate_tags['CA'] ) . '</td><td>' . $this->checkbox( 'Locale-CA', $this->enabled_locales['CA'] ) . '</td></tr>';866 $content .= '<tr><td></td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_cn.gif') . '" /> <a href="https://associates.amazon.cn/" target="_blank">' . __('China', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-CN', $this->associate_tags['CN'] ) . '</td><td>' . $this->checkbox( 'Locale-CN', $this->enabled_locales['CN'] ) . '</td></tr>';867 $content .= '<tr><td>' . $this->radio( "Locale", "DE", (($this->options['Locale'] == "DE" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_de.gif') . '" /> <a href="https://partnernet.amazon.de/" target="_blank">' . __('Germany', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-DE', $this->associate_tags['DE'] ) . '</td><td>' . $this->checkbox( 'Locale-DE', $this->enabled_locales['DE'] ) . '</td></tr>';868 $content .= '<tr><td>' . $this->radio( "Locale", "FR", (($this->options['Locale'] == "FR" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_fr.gif') . '" /> <a href="https://partenaires.amazon.fr/" target="_blank">' . __('France', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-FR', $this->associate_tags['FR'] ) . '</td><td>' . $this->checkbox( 'Locale-FR', $this->enabled_locales['FR'] ) . '</td></tr>';869 $content .= '<tr><td></td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_it.gif') . '" /> <a href="https://programma-affiliazione.amazon.it/" target="_blank">' . __('Italy', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-IT', $this->associate_tags['IT'] ) . '</td><td>' . $this->checkbox( 'Locale-IT', $this->enabled_locales['IT'] ) . '</td></tr>';870 $content .= '<tr><td>' . $this->radio( "Locale", "JP", (($this->options['Locale'] == "JP" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_jp.gif') . '" /> <a href="https://affiliate.amazon.co.jp/" target="_blank">' . __('Japan', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-JP', $this->associate_tags['JP'] ) . '</td><td>' . $this->checkbox( 'Locale-JP', $this->enabled_locales['JP'] ) . '</td></tr>';871 $content .= '<tr><td>' . $this->radio( "Locale", "UK", (($this->options['Locale'] == "UK" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_uk.gif') . '" /> <a href="https://affiliate-program.amazon.co.uk/" target="_blank">' . __('United Kingdom', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-UK', $this->associate_tags['UK'] ) . '</td><td>' . $this->checkbox( 'Locale-UK', $this->enabled_locales['UK'] ) . '</td></tr>';982 $content .= '<tr><td>' . $this->radio( "Locale", "US", (($this->options['Locale'] == "US" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_us.gif') . '" /> <a href="https://affiliate-program.amazon.com/" target="_blank">' . __('United States', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-US', $this->associate_tags['US'] == $this->our_associate_tags['US'] ? "" : $this->associate_tags['US']) . '</td><td>' . $this->checkbox( 'Locale-US', $this->enabled_locales['US'] ) . '</td></tr>'; 983 $content .= '<tr><td>' . $this->radio( "Locale", "CA", (($this->options['Locale'] == "CA" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_ca.gif') . '" /> <a href="https://associates.amazon.ca/" target="_blank">' . __('Canada', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-CA', $this->associate_tags['CA'] == $this->our_associate_tags['CA'] ? "" : $this->associate_tags['CA']) . '</td><td>' . $this->checkbox( 'Locale-CA', $this->enabled_locales['CA'] ) . '</td></tr>'; 984 $content .= '<tr><td></td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_cn.gif') . '" /> <a href="https://associates.amazon.cn/" target="_blank">' . __('China', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-CN', $this->associate_tags['CN'] == $this->our_associate_tags['CN'] ? "" : $this->associate_tags['CN']) . '</td><td>' . $this->checkbox( 'Locale-CN', $this->enabled_locales['CN'] ) . '</td></tr>'; 985 $content .= '<tr><td>' . $this->radio( "Locale", "DE", (($this->options['Locale'] == "DE" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_de.gif') . '" /> <a href="https://partnernet.amazon.de/" target="_blank">' . __('Germany', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-DE', $this->associate_tags['DE'] == $this->our_associate_tags['DE'] ? "" : $this->associate_tags['DE']) . '</td><td>' . $this->checkbox( 'Locale-DE', $this->enabled_locales['DE'] ) . '</td></tr>'; 986 $content .= '<tr><td>' . $this->radio( "Locale", "FR", (($this->options['Locale'] == "FR" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_fr.gif') . '" /> <a href="https://partenaires.amazon.fr/" target="_blank">' . __('France', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-FR', $this->associate_tags['FR'] == $this->our_associate_tags['FR'] ? "" : $this->associate_tags['FR']) . '</td><td>' . $this->checkbox( 'Locale-FR', $this->enabled_locales['FR'] ) . '</td></tr>'; 987 $content .= '<tr><td></td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_it.gif') . '" /> <a href="https://programma-affiliazione.amazon.it/" target="_blank">' . __('Italy', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-IT', $this->associate_tags['IT'] == $this->our_associate_tags['IT'] ? "" : $this->associate_tags['IT']) . '</td><td>' . $this->checkbox( 'Locale-IT', $this->enabled_locales['IT'] ) . '</td></tr>'; 988 $content .= '<tr><td>' . $this->radio( "Locale", "JP", (($this->options['Locale'] == "JP" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_jp.gif') . '" /> <a href="https://affiliate.amazon.co.jp/" target="_blank">' . __('Japan', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-JP', $this->associate_tags['JP'] == $this->our_associate_tags['JP'] ? "" : $this->associate_tags['JP']) . '</td><td>' . $this->checkbox( 'Locale-JP', $this->enabled_locales['JP'] ) . '</td></tr>'; 989 $content .= '<tr><td>' . $this->radio( "Locale", "UK", (($this->options['Locale'] == "UK" )? true: false) ) . '</td><td><img width="18" height="11" src="' . $this->getPluginPath( '/imgs/flag_uk.gif') . '" /> <a href="https://affiliate-program.amazon.co.uk/" target="_blank">' . __('United Kingdom', 'wpaa') . '</a></td><td>' . $this->textinput( 'AssociateTag-UK', $this->associate_tags['UK'] == $this->our_associate_tags['UK'] ? "" : $this->associate_tags['UK']) . '</td><td>' . $this->checkbox( 'Locale-UK', $this->enabled_locales['UK'] ) . '</td></tr>'; 872 990 $content .= '</table><br/>'; 873 991 $content .= '<table border="0" class="admin_table">'; 874 $content .= '<tr><td width="350"><strong>' . __("Enable use of Author specific Associate Tags?", "wpaa" ) . "</strong></td><td>" . $this->checkbox( 'MultiUser', $this->options['MultiUser'] ) . '</td></tr>';875 992 $content .= '<tr><td width="350"><strong>' . __("Enable Geo Localization?", "wpaa") . '</strong></td><td>'; 876 993 if( $this->modules[self::MODULE_IP2NATION]->isInstalled() ) { … … 879 996 $content .= '<small><a href="' . admin_url('admin.php?page=' . $this->modules[self::MODULE_IP2NATION]->getHook() ) . '">ip2nation</a> ' . __('is required for Geo Localization', 'wpaa') . "</small>"; 880 997 } 881 $content .= '</td></tr>'; 882 $content .= '</tr><td width="350">Please note that you need to enable the Associate Filter to localize static links</td></tr>'; 883 $content .= '</table>'; 884 $content .= '<strong>' . __('Support Us, use our Associate id for', 'wpaa') . $this->select("AssociateSupport", array("0" =>"0", "5"=>"5", "10"=>"10", "25"=>"25", "50"=>"50"), $this->options["AssociateSupport"]) . '% ' . __('of links', 'wpaa') . '</strong>'; 998 $content .= '</td></tr>'; $content .= '</table>'; 999 $content .= '<strong>' . __('Support Us, use our Associate id for', 'wpaa') . $this->select("AssociateSupport", array("0" =>"0", "5"=>"5", "10"=>"10", "15"=>"15", "20"=>"20", "25"=>"25","30"=>"30", "40"=>"40", "50"=>"50"), $this->options["AssociateSupport"]) . '% ' . __('of links', 'wpaa') . '</strong>'; 885 1000 $content .= '<br/><div class="alignright"><input class="button-primary" type="submit" name="submit" value="' . __('Update Settings', 'wpaa') . ' »" /></div>'; 886 1001 $content .= '<div class="clear"></div>'; … … 903 1018 $content = '<div class="admin_config_box">'; 904 1019 $content .= '<table border="0" class="admin_table">'; 1020 $content .= '<tr><td><strong>' . __('Enable Author Specific Assoicate Tags?','wpaa') . '</strong></td><td>' . $this->checkbox( 'MultiUser', $this->options['MultiUser'] ) . '</td></tr>'; 1021 $content .= '</table>'; 1022 $content .= '<strong>' . __('Use Admin Associate Id for ', 'wpaa') . $this->select("AdminSupport", array("0" =>"0", "5"=>"5", "10"=>"10", "15"=>"15", "20"=>"20", "25"=>"25","30"=>"30", "40"=>"40", "50"=>"50"), $this->options["AdminSupport"]) . '% ' . __('of Author Links', 'wpaa') . '</strong>'; 1023 $content .= '<br/><div class="alignright"><input class="button-primary" type="submit" name="submit" value="' . __('Update Settings','wpaa') . ' »" /></div>'; 1024 $content .= '<div class="clear"></div>'; 1025 $content .= '</div>'; 1026 $this->postbox("amazon_multi_author_settings", __("Multi-Author Website Settings",'wpaa'), $content); 1027 1028 $content = '<div class="admin_config_box">'; 1029 $content .= '<table border="0" class="admin_table">'; 905 1030 $content .= '<tr><td><strong>' . __('Enable Product Previews:','wpaa') . '</strong></td><td>' . $this->checkbox("ProductPreview", $this->options["ProductPreview"]) . '</td></tr>'; 906 1031 $content .= '</table>'; … … 914 1039 $content = '<div class="admin_config_box">'; 915 1040 $content .= '<table border="0" class="admin_table">'; 916 $content .= '<tr><td><strong>' . __('Amazon Carousel:','wpaa') . '</strong></td><td>' . $this->checkbox("AmazonCarouselWidget", $this->options["AmazonCarouselWidget"]) . '</td></tr>';917 $content .= '<tr><td><strong>' . __('Amazon MP3 Clips:','wpaa') . '</strong></td><td>' . $this->checkbox("AmazonMP3ClipsWidget", $this->options["AmazonMP3ClipsWidget"]) . '</td></tr>';918 $content .= '<tr><td><strong>' . __('Amazon My Favorites:','wpaa') . '</strong></td><td>' . $this->checkbox("AmazonMyFavoritesWidget", $this->options["AmazonMyFavoritesWidget"]) . '</td></tr>';919 $content .= '<tr><td><strong>' . __('Amazon Omakase:','wpaa') . '</strong></td><td>' . $this->checkbox("AmazonOmakaseWidget", $this->options["AmazonOmakaseWidget"]) . '</td></tr>';920 $content .= '<tr><td><strong>' . __('Amazon Product Cloud:','wpaa') . '</strong></td><td>' . $this->checkbox("AmazonProductCloudWidget", $this->options["AmazonProductCloudWidget"]) . '</td></tr>';921 $content .= '<tr><td><strong>' . __('Amazon Search:','wpaa') . '</strong></td><td>' . $this->checkbox("AmazonSearchWidget", $this->options["AmazonSearchWidget"]) . '</td></tr>';922 $content .= '</table>';923 $content .= '<br/><div class="alignright"><input class="button-primary" type="submit" name="submit" value="' . __('Update Settings','wpaa') . ' »" /></div>';924 $content .= '<div class="clear"></div>';925 $content .= "<p>" . __("Don't need a provided widget? Then feel free to disable it here so your Widget menu is a little less cluttered.",'wpaa') . "</p>";926 $content .= '</div>';927 $this->postbox("amazon_widget_settings", __("Amazon Widget Settings",'wpaa'), $content);928 929 $content = '<div class="admin_config_box">';930 $content .= '<table border="0" class="admin_table">';931 1041 $content .= '<tr><td><strong>' . __('Enable Associate Filter:','wpaa') . '</strong></td><td>' . $this->checkbox("FilterAssociateTag", $this->options["FilterAssociateTag"]) . '</td></tr>'; 932 1042 $content .= '</table>'; 933 1043 $content .= '<div class="alignright"><input class="button-primary" type="submit" name="submit" value="' . __('Update Settings','wpaa') . ' »" /></div>'; 934 1044 $content .= '<div class="clear"></div>'; 935 $content .= "<p>" . __('The Associate Filter will enable replacement of static Amazon links Associate Tags with your specified associate id. If Geo Localization is enabled it will also modify product links to the user\'s local amazon if the product exists in that locale.','wpaa') . "</p>";1045 $content .= "<p>" . __('The Associate Filter will enable replacement of static Amazon links Associate Tags with your specified associate id.','wpaa') . "</p>"; 936 1046 $content .= '</div>'; 937 1047 $this->postbox("amazon_associate_filter_settings", __("Amazon Associate Filter Settings",'wpaa'), $content); 1048 1049 $content = '<div class="admin_config_box">'; 1050 $content .= '<table border="0" class="admin_table">'; 1051 $content .= '<tr><td><strong>' . __('Enable Locale Viewing for Administrators:','wpaa') . '</strong></td><td>' . $this->checkbox("CVEnabled", $this->options["CVEnabled"]) . '</td></tr>'; 1052 $lOptions = array( " " => "" ); 1053 foreach( $this->enabled_locales as $localeKey => $localeValue ) { 1054 if( $localeValue ) { 1055 $lOptions[$localeKey] = $localeKey; 1056 } 1057 } 1058 $content .= '<tr><td><strong>' . __('Locale to view content as:','wpaa') . '</strong></td><td>' . $this->select("CVLocale", $lOptions, $this->options['CVLocale'] ) . '</td></tr>'; 1059 $content .= '</table>'; 1060 $content .= '<div class="alignright"><input class="button-primary" type="submit" name="submit" value="' . __('Update Settings','wpaa') . ' »" /></div>'; 1061 $content .= '<div class="clear"></div>'; 1062 $content .= "<p>" . __('This option allows administrators to view the website content with links localized to a specific Amazon Locale for verification of content displayed to website visitors from different geographic locations.','wpaa') . "</p>"; 1063 $content .= '</div>'; 1064 $this->postbox("amazon_associate_content_viewer_settings", __("Admin Localization Settings",'wpaa'), $content); 938 1065 ?> 939 1066 </form> … … 964 1091 validateAccess(); 965 1092 </script> 966 <div class="postbox-container" style="width:300px;" > 967 <div class="metabox-holder"> 968 <div class="meta-box-sortables"> 969 <?php 970 $content = '<div class="admin_config_box">'; 971 $content .= '<strong>' . __('Author:','wpaa') . '</strong> <a href="http://mdbitz.com/" target="_blank">MDBitz- Matthew Denton</a><br/><br/>'; 972 $content .= '<strong>' . __('Project Website:','wpaa') . '</strong> <a href="http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/?utm_source=plugin-admin&utm_medium=about-us&utm_campaign=plugin" target="_blank">labs.mdbitz.com</a><br/><br/>'; 973 $content .= '<strong>' . __('Version:','wpaa') . '</strong> ' . $this->version . '<br/><br/>'; 974 $content .= '<strong>' . __('Last Updated:','wpaa') . '</strong> ' . $this->last_updated; 975 $content .= '</div>'; 976 $this->postbox("about", __("About this Plugin",'wpaa'), $content); 977 978 $content = '<div class="admin_config_box">'; 979 $content .= '<a href="http://wordpress.org/extend/plugins/wordpress-amazon-associate/" target="_blank">' . __('Rate this plugin','wpaa') . '</a> ' . __('on WordPress') . '<br/><br/>'; 980 $content .= '<a href="http://wordpress.org/extend/plugins/wordpress-amazon-associate/" target="_blank">' . __('Notify','wpaa') . '</a> ' . __('WordPress users this plugin works with your WordPress version','wpaa') . '<br/><br/>'; 981 $content .= '<strong>Share this plugin with others</strong><br/><br/>'; 982 //facebook 983 $content .= '<a href="http://www.facebook.com/sharer.php?u=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/&t=Awesome%20WordPress%20Plugin:%20%20WordPress%20Amazon%20Associate" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/fb.png" alt="Facebook" /></a>'; 984 //digg 985 $content .= ' <a href="http://digg.com/submit?url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/digg.gif" alt="Digg" /></a>'; 986 //stubmleupon 987 $content .= ' <a href="http://www.stumbleupon.com/badge/?url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/stumbleupon.gif" alt="Stumble Upon" /></a>'; 988 //delicious 989 $content .= ' <a href="http://delicious.com/save?v=5&noui&jump=close&url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/deli.gif" alt="Delicous" /></a>'; 990 //twitter 991 $content .= ' <a href="http://twitter.com/home/?status=WordPress+Amazon+Associate+%2C+the+all-in-one+Amazon+Associate+WordPress+Plugin+http://tinyurl.com/wpaaplugin" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/twitter.gif" alt="Twitter" /></a>'; 992 $content .= '</div>'; 993 $this->postbox("feedback", __("User Feedback",'wpaa'), $content); 994 995 $content = '<div class="admin_center" >'; 996 $content .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 997 <input type="hidden" name="cmd" value="_s-xclick"> 998 <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHJwYJKoZIhvcNAQcEoIIHGDCCBxQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9h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lxFjiHTwb0hgFbShBg4AJd2dpjF9AJ5WFa1V5SGYoscmNYrHnRoaYZIc5SPbd7Fto0vuIK1Z1Jq8x3rZ2ex85I3WLLusKg=-----END PKCS7----- 999 "> 1000 <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 1001 <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 1002 </form>'; 1003 $content .= '</div>'; 1004 $this->postbox("donate", __("Show your support!",'wpaa'), $content); 1005 ?> 1006 </div> 1007 </div> 1008 </div> 1093 <?php 1094 $this->doAdminSideBar('plugin-admin'); 1095 ?> 1009 1096 </div> 1010 1097 <?php -
wordpress-amazon-associate/trunk/WPAA/CacheHandler.php
r353979 r410533 89 89 $cache_index = $locale . $id . $type . $responseGroup; 90 90 if( isset( $this->_cache[$cache_index] ) ) { // check php cache 91 92 return $this->filterAmazonId($this->_cache[$cache_index] ); 91 $result = $this->_cache[$cache_index]; 92 // if product does not exist for locale then get product from default locale 93 if( !$result->isSuccess() && $locale != $wpaa->getLocale() ) { 94 $result = $this->getProduct( $id, $wpaa->getLocale(), $type, $responseGroup ); 95 } 96 return $this->filterAmazonId( $result ); 93 97 } else { 94 98 //lookup product in db cache … … 103 107 // cache result in php 104 108 $this->_cache[$cache_index] = $result; 109 // if product does not exist for locale then get product from default locale 110 if( !$result->isSuccess() && $locale != $wpaa->getLocale() ) { 111 return $this->getProduct( $id, $wpaa->getLocale(), $type, $responseGroup ); 112 } 105 113 return $result; 106 114 } else { … … 132 140 } 133 141 } else { // cache is disabled 134 return $this->getProductByAPI($id, $locale, $type, $responseGroup); 142 $obj = $this->getProductByAPI($id, $locale, $type, $responseGroup); 143 // if product does not exist for locale then get product from default locale 144 if( !$obj->isSuccess() && $locale != $wpaa->getLocale() ) { 145 return $this->getProductByAPI( $id, $wpaa->getLocale(), $type, $responseGroup ); 146 } 135 147 } 136 148 } -
wordpress-amazon-associate/trunk/WPAA/Module/Cache.php
r400955 r410533 87 87 */ 88 88 protected $message = null; 89 90 /**91 * Plugin Version92 * @var String93 */94 protected $version = '-';95 96 /**97 * Plugin Last Updated98 * @var String99 */100 protected $last_updated = '-';101 89 102 90 /** … … 150 138 } 151 139 } 140 if (isset($_POST['clear'])) { 141 $this->clear(); 142 } 152 143 update_option($this->options_name, $this->options); 153 144 } … … 160 151 */ 161 152 public function registerAdminMenu() { 162 add_submenu_page($this->parent_hook, " Cache", "Cache", $this->options_lvl, $this->hook, array(&$this, 'doPage'));153 add_submenu_page($this->parent_hook, "Product Cache", "Product Cache", $this->options_lvl, $this->hook, array(&$this, 'doPage')); 163 154 } 164 155 … … 194 185 195 186 /** 187 * Clears database of cached product information 188 * @global <type> $wpdb 189 */ 190 public function clear() { 191 global $wpdb; 192 $sql = 'DELETE FROM ' . $this->tbl_name; 193 $wpdb->query($sql); 194 if ($wpdb->query($sql) === FALSE) { 195 $this->message = __("<strong>Failure:</strong> Settings updated but could not clear cache.", "wpaa"); 196 } else { 197 $this->message = __("<strong>Success:</strong> Settings updated and Cache cleared successfully.", "wpaa"); 198 } 199 } 200 201 /** 196 202 * Output Admin Page header scripts 197 203 */ … … 237 243 ?> 238 244 <div class="wrap"> 239 <h2>WordPress Amazon Associate: <?php _e(' Cache', 'wpaa'); ?></h2>245 <h2>WordPress Amazon Associate: <?php _e('Product Cache', 'wpaa'); ?></h2> 240 246 <div class="postbox-container" style="width:500px;" > 241 247 <div class="metabox-holder"> … … 251 257 $content .= '<tr><td><strong>' . __('is Enabled?', 'wpaa') . '</strong></td><td>' . $this->checkbox("enabled", $this->options['enabled']) . '</td></tr>'; 252 258 $content .= '<tr><td><strong>' . __('Products in cache will expire after _ days?', 'wpaa') . '</strong></td><td>' . $this->textinput("expire", $this->options['expire']) . '</td></tr>'; 259 $content .= '<tr><td colspan="2"><small>* ' . __('Entering 0 will mean that products in the cache do not expire.') . '</small></td></tr>'; 260 $content .= '<tr><td><strong>' . __('Clear Cache?', 'wpaa') . '</strong></td><td>' . $this->checkbox("clear") . '</td></tr>'; 253 261 $content .= '</table>'; 254 $content .= '<p><small>* ' . __('Entering 0 will mean that products in the cache do not expire.') . '</small></p>';255 262 $content .= '<br/><div class="alignright"><input class="button-primary" type="submit" name="submit" value="' . __('Update Settings','wpaa') . ' »" /></div>'; 256 263 $content .= '<div class="clear"></div>'; … … 262 269 </div> 263 270 </div> 264 <div class="postbox-container" style="width:300px;" > 265 <div class="metabox-holder"> 266 <div class="meta-box-sortables"> 267 <?php 268 $content = '<div class="admin_config_box">'; 269 $content .= '<strong>' . __('Author:','wpaa') . '</strong> <a href="http://mdbitz.com/" target="_blank">MDBitz- Matthew Denton</a><br/><br/>'; 270 $content .= '<strong>' . __('Project Website:','wpaa') . '</strong> <a href="http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/?utm_source=plugin-cache&utm_medium=about-us&utm_campaign=plugin" target="_blank">labs.mdbitz.com</a><br/><br/>'; 271 $content .= '<strong>' . __('Version:','wpaa') . '</strong> ' . $this->version . '<br/><br/>'; 272 $content .= '<strong>' . __('Last Updated:','wpaa') . '</strong> ' . $this->last_updated; 273 $content .= '</div>'; 274 $this->postbox("about", __("About this Plugin",'wpaa'), $content); 275 276 $content = '<div class="admin_config_box">'; 277 $content .= '<a href="http://wordpress.org/extend/plugins/wordpress-amazon-associate/" target="_blank">' . __('Rate this plugin','wpaa') . '</a> ' . __('on WordPress') . '<br/><br/>'; 278 $content .= '<a href="http://wordpress.org/extend/plugins/wordpress-amazon-associate/" target="_blank">' . __('Notify','wpaa') . '</a> ' . __('WordPress users this plugin works with your WordPress version','wpaa') . '<br/><br/>'; 279 $content .= '<strong>Share this plugin with others</strong><br/><br/>'; 280 //facebook 281 $content .= '<a href="http://www.facebook.com/sharer.php?u=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/&t=Awesome%20WordPress%20Plugin:%20%20WordPress%20Amazon%20Associate" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/fb.png" alt="Facebook" /></a>'; 282 //digg 283 $content .= ' <a href="http://digg.com/submit?url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/digg.gif" alt="Digg" /></a>'; 284 //stubmleupon 285 $content .= ' <a href="http://www.stumbleupon.com/badge/?url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/stumbleupon.gif" alt="Stumble Upon" /></a>'; 286 //delicious 287 $content .= ' <a href="http://delicious.com/save?v=5&noui&jump=close&url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/deli.gif" alt="Delicous" /></a>'; 288 //twitter 289 $content .= ' <a href="http://twitter.com/home/?status=WordPress+Amazon+Associate+%2C+the+all-in-one+Amazon+Associate+WordPress+Plugin+http://tinyurl.com/wpaaplugin" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/twitter.gif" alt="Twitter" /></a>'; 290 $content .= '</div>'; 291 $this->postbox("feedback", __("User Feedback",'wpaa'), $content); 292 293 $content = '<div class="admin_center" >'; 294 $content .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 295 <input type="hidden" name="cmd" value="_s-xclick"> 296 <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHJwYJKoZIhvcNAQcEoIIHGDCCBxQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEW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jF9AJ5WFa1V5SGYoscmNYrHnRoaYZIc5SPbd7Fto0vuIK1Z1Jq8x3rZ2ex85I3WLLusKg=-----END PKCS7----- 297 "> 298 <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 299 <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 300 </form>'; 301 $content .= '</div>'; 302 $this->postbox("donate", __("Show your support!",'wpaa'), $content); 303 ?> 304 </div> 305 </div> 306 </div> 271 <?php 272 $this->doAdminSideBar('plugin-cache'); 273 ?> 307 274 </div> 308 <?php275 <?php 309 276 } 310 277 -
wordpress-amazon-associate/trunk/WPAA/Module/Compliance.php
r400955 r410533 71 71 */ 72 72 protected $message = null; 73 74 /**75 * Plugin Version76 * @var String77 */78 protected $version = '-';79 80 /**81 * Plugin Last Updated82 * @var String83 */84 protected $last_updated = '-';85 73 86 74 /** … … 351 339 </div> 352 340 </div> 353 <div class="postbox-container" style="width:300px;" > 354 <div class="metabox-holder"> 355 <div class="meta-box-sortables"> 356 <?php 357 $content = '<div class="admin_config_box">'; 358 $content .= '<strong>' . __('Author:','wpaa') . '</strong> <a href="http://mdbitz.com/" target="_blank">MDBitz- Matthew Denton</a><br/><br/>'; 359 $content .= '<strong>' . __('Project Website:','wpaa') . '</strong> <a href="http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/?utm_source=plugin-compliance&utm_medium=about-us&utm_campaign=plugin" target="_blank">labs.mdbitz.com</a><br/><br/>'; 360 $content .= '<strong>' . __('Version:','wpaa') . '</strong> ' . $this->version . '<br/><br/>'; 361 $content .= '<strong>' . __('Last Updated:','wpaa') . '</strong> ' . $this->last_updated; 362 $content .= '</div>'; 363 $this->postbox("about", __("About this Plugin",'wpaa'), $content); 364 365 $content = '<div class="admin_config_box">'; 366 $content .= '<a href="http://wordpress.org/extend/plugins/wordpress-amazon-associate/" target="_blank">' . __('Rate this plugin','wpaa') . '</a> ' . __('on WordPress') . '<br/><br/>'; 367 $content .= '<a href="http://wordpress.org/extend/plugins/wordpress-amazon-associate/" target="_blank">' . __('Notify','wpaa') . '</a> ' . __('WordPress users this plugin works with your WordPress version','wpaa') . '<br/><br/>'; 368 $content .= '<strong>Share this plugin with others</strong><br/><br/>'; 369 //facebook 370 $content .= '<a href="http://www.facebook.com/sharer.php?u=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/&t=Awesome%20WordPress%20Plugin:%20%20WordPress%20Amazon%20Associate" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/fb.png" alt="Facebook" /></a>'; 371 //digg 372 $content .= ' <a href="http://digg.com/submit?url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/digg.gif" alt="Digg" /></a>'; 373 //stubmleupon 374 $content .= ' <a href="http://www.stumbleupon.com/badge/?url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/stumbleupon.gif" alt="Stumble Upon" /></a>'; 375 //delicious 376 $content .= ' <a href="http://delicious.com/save?v=5&noui&jump=close&url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/deli.gif" alt="Delicous" /></a>'; 377 //twitter 378 $content .= ' <a href="http://twitter.com/home/?status=WordPress+Amazon+Associate+%2C+the+all-in-one+Amazon+Associate+WordPress+Plugin+http://tinyurl.com/wpaaplugin" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/twitter.gif" alt="Twitter" /></a>'; 379 $content .= '</div>'; 380 $this->postbox("feedback", __("User Feedback",'wpaa'), $content); 381 382 $content = '<div class="admin_center" >'; 383 $content .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 384 <input type="hidden" name="cmd" value="_s-xclick"> 385 <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHJwYJKoZIhvcNAQcEoIIHGDCCBxQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBepXKuhGkfHqDUGSYPR+SJftezcmMEcE3Oae/juECySBhVweLZpnK7jJwVBthO7euizPhg3lP0KQy/ea14lxn2HH1e1NxE0B/iyD55Z3N6ly0/uDBQVI9gDpL0Esyva1fPjGyYbFDLpauG6gZQlcaCpVXVNu8XjP424HKvxv3e6DELMAkGBSsOAwIaBQAwgaQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIy1Yt8ma1h2yAgYAPJ/DDalqI9KnesGiJnjXHqyDU7gWj5yVlFSsY3wyT1DqGd7HXmYGtbyuRwSOuFvreuk2zn+h3wzGi4CMoAIGQTBrYeaIexZHO2flnwQT5WG99qiMFOXMd+LMnHiRuYmCgIc7vjAk82bZdHsmxThEwMcuFYyHBaJ/ljLCLorOHaqCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1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DAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEwMTAyMjExNTY1M1owIwYJKoZIhvcNAQkEMRYEFG9XjtXvii5csRnOJ5DPr67owUaMMA0GCSqGSIb3DQEBAQUABIGApAZcp9yNC9Kq7dyJ1b+ndpu9dAAjXSKFZlR9qvhpurUIcnn3QivTsIKR/AaBgK0O62794omrrKG2jlxFjiHTwb0hgFbShBg4AJd2dpjF9AJ5WFa1V5SGYoscmNYrHnRoaYZIc5SPbd7Fto0vuIK1Z1Jq8x3rZ2ex85I3WLLusKg=-----END PKCS7----- 386 "> 387 <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 388 <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 389 </form>'; 390 $content .= '</div>'; 391 $this->postbox("donate", __("Show your support!",'wpaa'), $content); 392 ?> 393 </div> 394 </div> 395 </div> 341 <?php 342 $this->doAdminSideBar('plugin-compliance'); 343 ?> 396 344 </div> 397 345 <?php -
wordpress-amazon-associate/trunk/WPAA/Module/IP2Nation.php
r400955 r410533 1 1 <?php 2 2 /* 3 * copyright (c) 2010 MDBitz - Matthew John Denton - mdbitz.com3 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com 4 4 * 5 5 * This file is part of WordPress Amazon Associate Plugin. … … 57 57 */ 58 58 protected $options_lvl = "manage_options"; 59 60 /**61 * Plugin Version62 * @var String63 */64 protected $version = '-';65 66 /**67 * Plugin Last Updated68 * @var String69 */70 protected $last_updated = '-';71 59 72 60 /** … … 117 105 add_action('admin_print_scripts', array(&$this, 'doPageScripts')); 118 106 add_action('admin_print_styles', array(&$this, 'doPageStyles')); 119 add_action('admin_init', array(&$this, ' install'));107 add_action('admin_init', array(&$this, 'doAction')); 120 108 $this->getStatus(); 121 109 } … … 209 197 $locale = 'JP'; // Japan 210 198 break; 211 // CN 212 case 'cn': // China 213 $locale = 'CN'; 214 break; 215 // IT 216 case 'it': // Italy 217 $locale = 'IT'; 199 // CN 200 case 'cn': // China 201 $locale = 'CN'; 202 break; 203 // IT 204 case 'it': // Italy 205 $locale = 'IT'; 206 break; 218 207 } 219 208 return $locale; … … 240 229 } 241 230 231 } 232 233 /** 234 * Init 235 */ 236 public function doAction() { 237 $this->uninstall(); 238 $this->install(); 242 239 } 243 240 … … 310 307 } 311 308 309 } 310 } 311 } 312 313 public function uninstall() { 314 if( isset($_POST['wpaa_ip2nation_uninstall']) && isset($_POST['wpaa-ip2nation-uninstall-meta-nonce']) ) { 315 $wpaa_edit = $_POST["wpaa_ip2nation_uninstall"]; 316 $nonce = $_POST['wpaa-ip2nation-uninstall-meta-nonce']; 317 if (isset($wpaa_edit) && !empty($wpaa_edit) && wp_verify_nonce($nonce, 'wpaa-ip2nation-uninstall-meta-nonce')) { 318 global $wpdb; 319 $sql = 'DROP TABLE ' . $this->db; 320 if ($wpdb->query($sql) === FALSE) { 321 $this->install_status = __("<strong>Failure:</strong> IP2Nation database table could not be deleted.", "wpaa"); 322 return; 323 } else { 324 $this->install_status = __("<strong>Success:</strong> IP2Nation database table was deleted successfully.", "wpaa"); 325 } 326 $this->status['installed'] = false; 312 327 } 313 328 } … … 431 446 ?> 432 447 </form> 448 <?php if( $this->status['installed'] ) { ?> 449 <form action="<?php echo admin_url('admin.php?page=' . $this->hook); ?>" method="post" id="wpaa-conf"> 450 <input value="wpaa_ip2nation_uninstall" type="hidden" name="wpaa_ip2nation_uninstall" /> 451 <input type="hidden" name="wpaa-ip2nation-uninstall-meta-nonce" value="<?php echo wp_create_nonce('wpaa-ip2nation-uninstall-meta-nonce') ?>" /> 452 <?php 453 454 $content = '<div class="admin_config_box">'; 455 $content .= '<p>' . __("If you no longer want to use ip2nation for Geo-Localization than you can delete the ip2nation database by clicking uninstall.") . '</p>'; 456 $content .= '<div class="alignright"><input class="button-primary" type="submit" name="submit" value="' . __('Uninstall','wpaa') . ' »" /></div>'; 457 $content .= '<div class="clear"></div>'; 458 $content .= '</div>'; 459 $this->postbox("ip2nation_uninstall", __("ip2nation uninstall",'wpaa'), $content); 460 ?> 461 </form> 462 <?php } ?> 433 463 </div> 434 464 </div> 435 465 </div> 436 <div class="postbox-container" style="width:300px;" > 437 <div class="metabox-holder"> 438 <div class="meta-box-sortables"> 439 <?php 440 $content = '<div class="admin_config_box">'; 441 $content .= '<strong>' . __('Author:','wpaa') . '</strong> <a href="http://mdbitz.com/" target="_blank">MDBitz- Matthew Denton</a><br/><br/>'; 442 $content .= '<strong>' . __('Project Website:','wpaa') . '</strong> <a href="http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/?utm_source=plugin-ip2nation&utm_medium=ip2nation&utm_campaign=plugin" target="_blank">labs.mdbitz.com</a><br/><br/>'; 443 $content .= '<strong>' . __('Version:','wpaa') . '</strong> ' . $this->version . '<br/><br/>'; 444 $content .= '<strong>' . __('Last Updated:','wpaa') . '</strong> ' . $this->last_updated; 445 $content .= '</div>'; 446 $this->postbox("about", __("About this Plugin",'wpaa'), $content); 447 448 $content = '<div class="admin_config_box">'; 449 $content .= '<a href="http://wordpress.org/extend/plugins/wordpress-amazon-associate/" target="_blank">' . __('Rate this plugin','wpaa') . '</a> ' . __('on WordPress') . '<br/><br/>'; 450 $content .= '<a href="http://wordpress.org/extend/plugins/wordpress-amazon-associate/" target="_blank">' . __('Notify','wpaa') . '</a> ' . __('WordPress users this plugin works with your WordPress version','wpaa') . '<br/><br/>'; 451 $content .= '<strong>Share this plugin with others</strong><br/><br/>'; 452 //facebook 453 $content .= '<a href="http://www.facebook.com/sharer.php?u=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/&t=Awesome%20WordPress%20Plugin:%20%20WordPress%20Amazon%20Associate" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/fb.png" alt="Facebook" /></a>'; 454 //digg 455 $content .= ' <a href="http://digg.com/submit?url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/digg.gif" alt="Digg" /></a>'; 456 //stubmleupon 457 $content .= ' <a href="http://www.stumbleupon.com/badge/?url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/stumbleupon.gif" alt="Stumble Upon" /></a>'; 458 //delicious 459 $content .= ' <a href="http://delicious.com/save?v=5&noui&jump=close&url=http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/deli.gif" alt="Delicous" /></a>'; 460 //twitter 461 $content .= ' <a href="http://twitter.com/home/?status=WordPress+Amazon+Associate+%2C+the+all-in-one+Amazon+Associate+WordPress+Plugin+http://tinyurl.com/wpaaplugin" target="_blank"><img src="' . WP_CONTENT_URL . '/plugins/wordpress-amazon-associate/imgs/twitter.gif" alt="Twitter" /></a>'; 462 $content .= '</div>'; 463 $this->postbox("feedback", __("User Feedback",'wpaa'), $content); 464 465 $content = '<div class="admin_center" >'; 466 $content .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 467 <input type="hidden" name="cmd" value="_s-xclick"> 468 <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHJwYJKoZIhvcNAQcEoIIHGDCCBxQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQ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YrHnRoaYZIc5SPbd7Fto0vuIK1Z1Jq8x3rZ2ex85I3WLLusKg=-----END PKCS7----- 469 "> 470 <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 471 <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 472 </form>'; 473 $content .= '</div>'; 474 $this->postbox("donate", __("Show your support!",'wpaa'), $content); 475 ?> 476 </div> 477 </div> 478 </div> 466 <?php 467 $this->doAdminSideBar('plugin-ip2nation'); 468 ?> 479 469 </div> 480 470 <?php -
wordpress-amazon-associate/trunk/WPAA/Module/MultiUser.php
r400955 r410533 1 1 <?php 2 2 /* 3 * copyright (c) 2010 MDBitz - Matthew John Denton - mdbitz.com3 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com 4 4 * 5 5 * This file is part of WordPress Amazon Associate Plugin. … … 67 67 68 68 /** 69 * Plugin Version70 * @var String71 */72 protected $version = '-';73 74 /**75 * Plugin Last Updated76 * @var String77 */78 protected $last_updated = '-';79 80 /**81 69 * Constructor 82 70 * @param string $parent_hook … … 110 98 <h3><?php _e("Amazon Assoicate Settings", "wpaa"); ?></h3> 111 99 <table class="form-table"> 100 <?php if ( $wpaa->isLocaleEnabled( "US" ) ) { ?> 112 101 <tr> 113 102 <th><img alt="" width="18" height="11" src="<?php echo $wpaa->getPluginPath( '/imgs/flag_us.gif'); ?>" /> <a href="https://affiliate-program.amazon.com/" target="_blank"><?php _e('United States', 'wpaa');?></a></th> 114 103 <td><input type="text" name="AssociateTag-US" id="AssociateTag-US" value="<?php echo esc_attr( get_user_meta( $user->ID, 'AssociateTag-US', true ) ); ?>" class="regular-text" /></td> 115 104 </tr> 105 <?php } if ( $wpaa->isLocaleEnabled( "CA" ) ) { ?> 116 106 <tr> 117 107 <th><img alt="" width="18" height="11" src="<?php echo $wpaa->getPluginPath( '/imgs/flag_ca.gif'); ?>" /> <a href="https://associates.amazon.ca/" target="_blank"><?php _e('Canada', 'wpaa');?></a></th> 118 108 <td><input type="text" name="AssociateTag-CA" id="AssociateTag-CA" value="<?php echo esc_attr( get_user_meta( $user->ID, 'AssociateTag-CA', true ) ); ?>" class="regular-text" /></td> 119 109 </tr> 110 <?php } if ( $wpaa->isLocaleEnabled( "CN" ) ) { ?> 120 111 <tr> 121 112 <th><img alt="" width="18" height="11" src="<?php echo $wpaa->getPluginPath( '/imgs/flag_cn.gif'); ?>" /> <a href="https://associates.amazon.cn/" target="_blank"><?php _e('China', 'wpaa');?></a></th> 122 113 <td><input type="text" name="AssociateTag-CN" id="AssociateTag-CN" value="<?php echo esc_attr( get_user_meta( $user->ID, 'AssociateTag-CN', true ) ); ?>" class="regular-text" /></td> 123 114 </tr> 115 <?php } if ( $wpaa->isLocaleEnabled( "DE" ) ) { ?> 124 116 <tr> 125 117 <th><img alt="" width="18" height="11" src="<?php echo $wpaa->getPluginPath( '/imgs/flag_de.gif'); ?>" /> <a href="https://partnernet.amazon.de/" target="_blank"><?php _e('Gemany', 'wpaa');?></a></th> 126 118 <td><input type="text" name="AssociateTag-DE" id="AssociateTag-DE" value="<?php echo esc_attr( get_user_meta( $user->ID, 'AssociateTag-DE', true ) ); ?>" class="regular-text" /></td> 127 119 </tr> 120 <?php } if ( $wpaa->isLocaleEnabled( "FR" ) ) { ?> 128 121 <tr> 129 122 <th><img alt="" width="18" height="11" src="<?php echo $wpaa->getPluginPath( '/imgs/flag_fr.gif'); ?>" /> <a href="https://partenaires.amazon.fr/" target="_blank"><?php _e('France', 'wpaa');?></a></th> 130 123 <td><input type="text" name="AssociateTag-FR" id="AssociateTag-FR" value="<?php echo esc_attr( get_user_meta( $user->ID, 'AssociateTag-FR', true ) ); ?>" class="regular-text" /></td> 131 124 </tr> 125 <?php } if ( $wpaa->isLocaleEnabled( "IT" ) ) { ?> 132 126 <tr> 133 127 <th><img alt="" width="18" height="11" src="<?php echo $wpaa->getPluginPath( '/imgs/flag_it.gif'); ?>" /> <a href="https://programma-affiliazione.amazon.it/" target="_blank"><?php _e('Italy', 'wpaa');?></a></th> 134 128 <td><input type="text" name="AssociateTag-IT" id="AssociateTag-IT" value="<?php echo esc_attr( get_user_meta( $user->ID, 'AssociateTag-IT', true ) ); ?>" class="regular-text" /></td> 135 129 </tr> 130 <?php } if ( $wpaa->isLocaleEnabled( "JP" ) ) { ?> 136 131 <tr> 137 132 <th><img alt="" width="18" height="11" src="<?php echo $wpaa->getPluginPath( '/imgs/flag_jp.gif'); ?>" /> <a href="https://affiliate.amazon.co.jp/" target="_blank"><?php _e('Japan', 'wpaa');?></a></th> 138 133 <td><input type="text" name="AssociateTag-JP" id="AssociateTag-JP" value="<?php echo esc_attr( get_user_meta( $user->ID, 'AssociateTag-JP', true ) ); ?>" class="regular-text" /></td> 139 134 </tr> 135 <?php } if ( $wpaa->isLocaleEnabled( "UK" ) ) { ?> 140 136 <tr> 141 137 <th><img alt="" width="18" height="11" src="<?php echo $wpaa->getPluginPath( '/imgs/flag_uk.gif'); ?>" /> <a href="https://affiliate-program.amazon.co.uk/" target="_blank"><?php _e('United Kingdom', 'wpaa');?></a></th> 142 138 <td><input type="text" name="AssociateTag-UK" id="AssociateTag-UK" value="<?php echo esc_attr( get_user_meta( $user->ID, 'AssociateTag-UK', true ) ); ?>" class="regular-text" /></td> 143 139 </tr> 140 <?php } ?> 144 141 </table> 145 142 <?php -
wordpress-amazon-associate/trunk/WPAA/Module/QuickLinks.php
r400955 r410533 1 1 <?php 2 2 /* 3 * copyright (c) 2010 MDBitz - Matthew John Denton - mdbitz.com3 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com 4 4 * 5 5 * This file is part of WordPress Amazon Associate Plugin. … … 65 65 */ 66 66 protected $options = array(); 67 68 /**69 * Plugin Version70 * @var String71 */72 protected $version = '-';73 74 /**75 * Plugin Last Updated76 * @var String77 */78 protected $last_updated = '-';79 67 80 68 /** … … 139 127 tinyMCE.execInstanceCommand("mce_editor_0", "mceFocus"); 140 128 } else { 129 var selected_txt = (!!document.getSelection) ? document.getSelection() : 130 (!!window.getSelection) ? window.getSelection() : 131 document.selection.createRange().text; 132 if( selected_txt != "" ) { 133 content = selected_txt; 134 } 141 135 send_to_editor( content_prefix + content + content_suffix ); 142 136 } … … 168 162 tinyMCE.execInstanceCommand("mce_editor_0", "mceFocus"); 169 163 } else { 164 var selected_txt = (!!document.getSelection) ? document.getSelection() : 165 (!!window.getSelection) ? window.getSelection() : 166 document.selection.createRange().text; 167 if( selected_txt != "" ) { 168 content = selected_txt; 169 } 170 170 send_to_editor( content_prefix + content + content_suffix ); 171 171 } -
wordpress-amazon-associate/trunk/WPAA/ShortCodeHandler.php
r386477 r410533 1 1 <?php 2 2 /* 3 * copyright (c) 2010 MDBitz - Matthew John Denton - mdbitz.com3 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com 4 4 * 5 5 * This file is part of WordPress Amazon Associate Plugin. … … 43 43 add_shortcode('amazon_image', array(&$this,'amazonImageHandler')); 44 44 add_shortcode('amazon_enhanced', array(&$this,'amazonEnhancedHandler')); 45 add_shortcode('amazon_banner', array(&$this,'amazonBannerHandler')); 45 46 add_shortcode('amazon_carousel', array(&$this,'amazonCarouselHandler')); 46 47 add_shortcode('amazon_mp3_clips', array(&$this,'amazonMP3ClipsHandler')); … … 66 67 public function amazonLinkHandler( $atts, $content=null, $code="" ) { 67 68 global $wpaa; 68 $atts = shortcode_atts( array( 'id'=>null, 'locale'=> null, 69 'type' => 'ASIN', 'target' => '_blank', 'rel' => "nofollow", 70 'container' => null, 'container_class' => null, 'title' => null ), $atts ); 71 return AmazonProduct::link($content, $atts['id'], $atts['locale'], 72 $atts['type'], $atts['target'], $atts['rel'], $atts['container'], 73 $atts['container_class'], $atts['title'] ); 69 $atts['content'] = $content; 70 $atts['echo'] = false; 71 return AmazonProduct::link( $atts ); 74 72 } 75 73 … … 82 80 public function amazonImageHandler( $atts, $content=null, $code="" ) { 83 81 global $wpaa; 84 $atts = shortcode_atts( array( 'id'=>null, 'locale'=>null, 85 'size'=>'medium', 'type' => 'ASIN', 'link' => false, 86 'target' => '_blank', 'rel' => "nofollow", 'class'=> null, 87 'container'=>null, 'container_class' => null, 'alt' => null, 88 'title' => null ), $atts ); 89 return AmazonProduct::image($content, $atts['id'], $atts['size'], 90 $atts['link'], $atts['locale'], $atts['type'], $atts['target'], 91 $atts['rel'], $atts['class'], $atts['container'], 92 $atts['container_class'], $atts['alt'], $atts['title']); 82 $atts['content'] = $content; 83 $atts['echo'] = false; 84 return AmazonProduct::image($atts); 93 85 } 94 86 … … 101 93 public function amazonEnhancedHandler( $atts, $content=null, $code="" ) { 102 94 global $wpaa; 103 $atts = shortcode_atts( array('asin' => null, 'locale' => null, 'new_window' => true, 104 'show_border' => true, 'larger_image' => true, 'price' => "All", 105 'background_color' => "FFFFFF", 'text_color' => "000000", 106 'link_color' => "0000FF", 'container' => null, 107 'container_class' => null ), $atts ); 108 return AmazonProduct::enhanced($atts['asin'], $atts['locale'], 109 $atts['new_window'], $atts['show_border'], $atts['larger_image'], 110 $atts['price'], $atts['background_color'], $atts['text_color'], 111 $atts['link_color'], $atts['container'], $atts['container_class'] ); 95 $atts['content'] = $content; 96 $atts['echo'] = false; 97 return AmazonProduct::enhanced( $atts ); 98 } 99 100 /** 101 * Amazon Banner Short Code Handler 102 * @param array $atts 103 * @param string $content 104 * @param string $code 105 */ 106 public function amazonBannerHandler( $atts, $content=null, $code="" ) { 107 $banner = AmazonBanner::Banner( $atts ); 108 if( empty( $banner ) ) { 109 return $content; 110 } else { 111 return $banner; 112 } 112 113 } 113 114 … … 120 121 public function amazonCarouselHandler( $atts, $content=null, $code="" ) { 121 122 $widget = new AmazonWidget_Carousel( $this->mergeWidgetOptions( AmazonWidget_Carousel::getDefaultShortCodeOptions(), $atts ) ); 122 return $widget->toHTML();123 return self::doStyle( $atts, $widget->toHTML() ); 123 124 } 124 125 … … 131 132 public function amazonMP3ClipsHandler( $atts, $content=null, $code="" ) { 132 133 $widget = new AmazonWidget_MP3Clips( $this->mergeWidgetOptions( AmazonWidget_MP3Clips::getDefaultShortCodeOptions(), $atts ) ); 133 return $widget->toHTML();134 return self::doStyle( $atts, $widget->toHTML() ); 134 135 } 135 136 … … 142 143 public function amazonMyFavoritesHandler( $atts, $content=null, $code="" ) { 143 144 $widget = new AmazonWidget_MyFavorites( $this->mergeWidgetOptions( AmazonWidget_MyFavorites::getDefaultShortCodeOptions(), $atts ) ); 144 return $widget->toHTML();145 return self::doStyle( $atts, $widget->toHTML() ); 145 146 } 146 147 … … 153 154 public function amazonSearchHandler( $atts, $content=null, $code="" ) { 154 155 $widget = new AmazonWidget_Search( $this->mergeWidgetOptions( AmazonWidget_Search::getDefaultShortCodeOptions(), $atts ) ); 155 return $widget->toHTML();156 return self::doStyle( $atts, $widget->toHTML() ); 156 157 } 157 158 … … 164 165 public function amazonOmakaseHandler( $atts, $content=null, $code="" ) { 165 166 $widget = new AmazonWidget_Omakase( $this->mergeWidgetOptions( AmazonWidget_Omakase::getDefaultShortCodeOptions(), $atts ) ); 166 return $widget->toHTML();167 return self::doStyle( $atts, $widget->toHTML() ); 167 168 } 168 169 … … 175 176 public function amazonProductCloudHandler( $atts, $content=null, $code="" ) { 176 177 $widget = new AmazonWidget_ProductCloud( $this->mergeWidgetOptions( AmazonWidget_ProductCloud::getDefaultShortCodeOptions(), $atts ) ); 177 return $widget->toHTML();178 return self::doStyle( $atts, $widget->toHTML() ); 178 179 } 179 180 … … 191 192 return shortcode_atts( $defaultArgs, $atts ); 192 193 } 194 195 /** 196 * Append Container, class and style if enabled 197 * @param array $options 198 * @param string $output_str 199 * @return <type> 200 */ 201 public static function doStyle( $options, $output_str ) { 202 $output = ""; 203 if( ! empty($options['container']) ) { 204 $output = "<" . $options['container']; 205 if( ! empty($options['container_class']) ) { 206 $output .= ' class="' . $options['container_class'] . '"'; 207 } 208 if( ! empty($options['container_style']) ) { 209 $output .= ' style="' . $options['container_style'] . '"'; 210 } 211 return $output . ">" . $output_str . "</" . $options['container'] . ">"; 212 } else { 213 return $output_str; 214 } 215 } 193 216 194 217 } -
wordpress-amazon-associate/trunk/Widget/Amazon/Carousel.php
r383621 r410533 56 56 function widget($args, $instance) { 57 57 global $wpaa; 58 extract($args);58 extract($args); 59 59 if( isset( $before_widget ) ) { 60 60 echo $before_widget; -
wordpress-amazon-associate/trunk/Widget/Amazon/MP3Clips.php
r383621 r410533 56 56 function widget($args, $instance) { 57 57 global $wpaa; 58 extract($args);58 extract($args); 59 59 if( isset( $before_widget ) ) { 60 60 echo $before_widget; -
wordpress-amazon-associate/trunk/Widget/Amazon/MyFavorites.php
r383621 r410533 56 56 function widget($args, $instance) { 57 57 global $wpaa; 58 extract($args);58 extract($args); 59 59 if( isset( $before_widget ) ) { 60 60 echo $before_widget; -
wordpress-amazon-associate/trunk/Widget/Amazon/Omakase.php
r383621 r410533 56 56 function widget($args, $instance) { 57 57 global $wpaa; 58 extract($args);58 extract($args); 59 59 if( isset( $before_widget ) ) { 60 60 echo $before_widget; 61 61 } 62 $title = apply_filters(' title', $instance['title']);62 $title = apply_filters('widget_title', $instance['title']); 63 63 if ( $title ) { 64 64 echo $before_title . $title . $after_title; -
wordpress-amazon-associate/trunk/Widget/Amazon/ProductCloud.php
r383621 r410533 56 56 function widget($args, $instance) { 57 57 global $wpaa; 58 extract($args);58 extract($args); 59 59 if( isset( $before_widget ) ) { 60 60 echo $before_widget; 61 61 } 62 $title = apply_filters(' title', $instance['widgetTitle']);62 $title = apply_filters('widget_title', $instance['widgetTitle']); 63 63 if ( $title ) { 64 64 echo $before_title . $title . $after_title; -
wordpress-amazon-associate/trunk/Widget/Amazon/Search.php
r383621 r410533 56 56 function widget($args, $instance) { 57 57 global $wpaa; 58 extract($args);58 extract($args); 59 59 if( isset( $before_widget ) ) { 60 60 echo $before_widget; -
wordpress-amazon-associate/trunk/readme.txt
r400973 r410533 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 5 Requires at least: 3.0.0 6 Tested up to: 3.2. 06 Tested up to: 3.2.1 7 7 Stable tag: trunk 8 8 9 Quickly and easily monetize your web iste through the integration of Amazon10 products and widgets tagged with your and/or authors' associate ids.9 Quickly and easily monetize your website with links and widgets from the web's top Affiliate Program, 10 Amazon Associates. 11 11 12 12 == Description == 13 13 14 Easily and quickly integrate Amazon Products and Widgets into your website. 15 This plugin enables you to monetize your website through the use of Amazon's 14 The WPAA plugin enables you to monetize your website through the use of Amazon's 16 15 Affiliate Program. By entering your amazon associate id for Amazon's supported 17 16 locales you will earn referral fees for all products users purchase through … … 19 18 inserting of amazon products and images into your content, content replacement 20 19 of static links with your associate tag, and support for inserting Amazon 21 Widgets through WordPress ShortCode, tinyMCE,Widget Admin, or PHP code. 22 23 This plugin fully supports amazon localization to supported markets: 20 Widgets through WordPress ShortCode, tinyMCE editor controls, Widget Admin, 21 or PHP code. 22 23 This plugin fully supports amazon product localization to supported markets: 24 24 Canada (CA), Germany (DE), France (FR), Japan (JP), United Kingdom (GB), and 25 25 the Unites States (US).<br> 26 In addition the plugin contains basic support for link filteringof Amazon's26 In addition the plugin contains support for link localization of Amazon's 27 27 Italy (IT) and China (CN) markets. 28 28 … … 30 30 plugin is designed to be your all inclusive source for enriching you website 31 31 with Amazon Products and Widgets embedded with your unique Amazon Associate Tag. 32 Below is a brief overview of the supported features: 32 Below is a brief overview of the supported features if you have any questions 33 concerning using or features of the plugin than please visit the [Support Forums](http://forums.mdbitz.com/). 34 35 **Key Features** 33 36 34 37 1. **Amazon Widget Support** <br> 35 To date the plug-in supports all Amazon Widgets that can be created using 36 Amazon's [Widget Source](https://widgets.amazon.com/Widget-Source/) including 37 the Carousel Widget, MP3 Clips Widget, My Favorites Widget and Search Widget in 38 addition to the Omakase and Product Cloud Widgets. 39 <br> 40 All widgets can be inserted into your website in any of 4 methods: 41 <br> 42 *Short Code* `[amazon_carousel]`<br> 43 *tinyMCE Editor Button*<br> 44 *WordPress Widget Admin*<br> 45 *PHP code* `<?php AmazonWidget::Carousel( $args ); ?>`<br> 46 Inserting widgets in templates is done through the usage of the AmazonWidget 47 class that provides static methods for rendering the different widgets. 48 49 1. **Amazon Associate Tag Filtering** <br> 50 To make management of your site easier we have included an optional filter that 51 when enabled will modify static amazon product links to include your specified 52 associate tag. This feature checks the locale of the amazon link and uses the 53 correct localized associate tag so that you maximize your returns. 54 55 *As of version 1.6.0 static links are localized if Tag Filtering and Geo Localization are enabled.* 56 57 1. **Amazon Product Linking** <br> 58 When writing content for your website you may find the need to include product 59 links and images. The WordPress Amazon Associate plugin makes this task easier 60 by including an amazon associate tinyMCE control that lets you quickly search 61 for a product and insert either an image or link to the desired product that is 62 automatically tagged with your associate id. In addition ShortCode and PHP code 63 handles are provided to provide complete support. 64 <br> `<?php AmazonProduct::link( '0756406412'); ?>` 65 <br> `[amazon_link id="0756406412" ]Shadowrise[/amazon_link]` 66 67 1. **Amazon Product Preview** <br> 68 If your website contains product links Amazon's 'Product Preview' enhances your 69 links by providing overlay products when a visitor rolls over the links. This 70 plugin allows you to easily enable/disable this feature through it's admin 71 panel. 72 73 1. **Link Localization** <br> 74 For websites that want to provide the most relevant product links to their visitors 75 they can enable links to be localized to the visitors Amazon. This means that 76 visitors from France will be directed to amazon.fr and etc. If you have visitors 77 from multiple countries this feature is for you. 78 79 1. **Multi-Author Support**<br> 80 If your website has multiple authors contributing content, then you have the option 81 of having content they write tagged with their associate id. If enabled users will 82 have the ability to insert their associate tags on their profile page in the admin 83 and any pages/posts they write will have the links/widgets in the content area set 84 to their associate id. And links or widgets in the non-content (header/footer/sidebar/etc) 85 will still be tagged with the associate ids configured in the settings page. 86 87 1. **Complete Administrative control** <br> 88 We want this plugin to be as unobtrusive as possible and for that goal we give you 89 full control over what features you want to use on your website. Including enabling/disabling 90 of the Amazon Widgets and Associate Tag Filter if they are unused by your website 91 freeing up valuable screen space and processing time. 38 *Carousel*<br> 39 *MP3 Clips*<br> 40 *My Favorites*<br> 41 *Omakase*<br> 42 *Product Cloud*<br> 43 *Search*<br> 44 45 1. **Amazon Product Linking** 46 47 1. **Amazon Product Link Filtering** 48 49 1. **Amazon Product Preview** 50 51 1. **Amazon Link & Widget Geo-Localization** 52 53 1. **Multi-Author Support** 54 55 1. **Amazon Product Advertising API Caching** 56 57 1. **Complete Administrative control** 58 59 1. **MPMU Compatible** 92 60 93 61 == Installation == … … 95 63 1. Upload the `wordpress-amazon-associate` folder and all it's contents to the `/wp-content/plugins/` directory 96 64 1. Activate the plugin through the *Plugins* menu in WordPress 97 1. Access the Plugin settings by clicking the *WP - Amazon* menu option 98 1. Enter your Amazon Associate Id(s) 99 1. Enter your Amazon Web Services Keys 65 1. Access the Plugin Settings by clicking the *WP - Amazon* menu option 66 1. Enter your Amazon Associate Ids 67 1. Enter your Amazon Web Services Access and Secret Keys 68 1. Optionally Configure Multi-Author, Link Filtering and Product Preview settings 100 69 1. Install the ip2nation database if you wish to support Geo Localization, by selecting the *WP - Amazon* > *ip2nation* menu option 101 70 1. Configure the Plugin Cache by visiting the *WP - Amazon* > *Cache* menu option 71 1. Configure available Widgets by accessing the *WP - Amazon* > *Widgets* menu option 102 72 1. Insert Products and Widgets into your website through your template, page/post content or the *Widget* admin screen in WordPress 103 73 104 74 == Frequently Asked Questions == 105 75 76 = How can I report a bug? request help? request a feature? = 77 78 If you find a bug in the WordPress Amazon Associate plugin then please let me 79 know by emailing it to [matt@mdbitz.com](mailto:matt@mdbitz.com) or posting the 80 issue in the [Support Forums](http://forums.mdbitz.com/). You can also 81 report it through my [trac project](http://trac.mdbitz.com/WordPressAmazonAssociate/) 82 using the login credential of "user" with password "guest". Another way you can 83 reach me is through my [website](http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/?utm_source=wordpress&utm_medium=plugin-readme&utm_campaign=plugin) 84 106 85 = Do I need to configure the Amazon Web Service Keys = 107 86 108 No, however by not input ting a valid Amazon Web Serviceyou will not be able to109 insert amazon product links and images through ShortCode orthe content editor's110 tinyMCE control .87 No, however by not inputing a valid Amazon Web Service credential you will not be able to 88 insert amazon product links and images through ShortCode, the content editor's 89 tinyMCE control or the Quick Links Module. 111 90 112 91 = Why can't I set Italy or China as my Primary Locale? = … … 118 97 Link Filter functions for these locales. 119 98 120 It is important to note that if you put static links in your website and have the121 associate filter and geo localization enabled that italy and china locales will be122 outputted if the link is valid in the localized locale.123 124 99 = Does this plugin support Multi-Author websites? = 125 100 … … 129 104 associate ids, and if not set will default to the ids configured on 130 105 the *WP - Amazon * > *Settings* page. 106 107 Version 2.0 and later of the plugin enable sites administrators to define a percentage 108 of links where the administrator's associate id will be used instead of the author's 109 associate id. 131 110 132 111 = What is Link Localization? = … … 150 129 151 130 At this time there is a confirmed bug with the Amazon Product Preview code 152 that in some wordpress themes the previews do not occ our. This error is due to131 that in some wordpress themes the previews do not occur. This error is due to 153 132 the Amazon script including it's own version of jQuery into the page causing a 154 133 conflict. To resolve the issue an optional jQuery.noConflict call to remap … … 177 156 project for other users. 178 157 179 = How can I report a bug? request help? request a feature? =180 181 If you find a bug in the WordPress Amazon Associate plugin then please let me182 know by emailing it to [matt@mdbitz.com](mailto:matt@mdbitz.com). You can also183 report it through my [trac project](http://trac.mdbitz.com/WordPressAmazonAssociate/)184 using the login credential of "user" with password "guest". Another way you can185 reach me is through my [website](http://labs.mdbitz.com/wordpress/wordpress-amazon-associate-plugin/?utm_source=wordpress&utm_medium=plugin-readme&utm_campaign=plugin)186 187 = I notice that the associate tag for some links do not have my id, is this a bug? =188 189 No, this is not a bug. We have built into the plugin the ability to support the190 developers by having x% of links tagged with our associate id. By default this191 is set to 0% but can be turned on if desired by the user by visiting the192 *WP - Amazon* menu in your WordPress admin and selecting to use our associate193 tag for X% of links.194 195 158 == Screenshots == 196 159 … … 225 188 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) 226 189 227 = 1.6.1 - 06/24/2011 = 190 = 1.7.0 - 07/15/2011 = 191 * Multi-Author - Support Admin for x% of Author links 192 * Multi-Author - Product Preview - Support of Author Associate ID 193 * Plugin Compatibility - WordTwit - Fixed naming of fancybox script 194 * Plugin Compatibility - wp_tables_reloaded - Increased Filter priority 195 * Geo-Localization - Updated APaPi to return error when asin not found in locale 196 * Quick Links - HTML Editor text selection support 197 * Admin - Code refactor of messages, code reuse, options, tracking 198 * Admin - Migrated widget management to own sub-page 199 * Admin - Disable plugin features if AWS credentials not configured 200 * ip2nation - uninstall option 201 * Cache Module - clear cache option 202 * Content Viewer Module - Ability for admin to view content as designated locale 203 * Widgets - Support of Widget Styling via container, container_class and container_style 204 205 = 1.6.1 - 06/25/2011 = 228 206 * WordPress MultiSite Fix : Change admin capabilities to manage_options to enable plugin administration to site administrators 229 207 … … 250 228 = 1.5.1 - 04/28/2011 = 251 229 * Author level users now have access to the TinyMCE interface to create widgets/links 252 * Fixed Associate Filter logic so that multiple links in page to same url would not be double tagged. 230 * Fixed Associate Filter logic so that multiple links in page to same url would not be double tagged. 253 231 254 232 = 1.5.0 - 03/01/2011 = … … 324 302 = Carousel = 325 303 326 * `<?php AmazonWidget::Carousel( ); ?>`304 * `<?php AmazonWidget::Carousel( $options ); ?>` 327 305 * `[amazon_carousel]` 328 306 329 307 = MP3 Clips = 330 308 331 * `<?php AmazonWidget::MP3Clips( ); ?>`309 * `<?php AmazonWidget::MP3Clips( $options ); ?>` 332 310 * `[amazon_mp3_clips]` 333 311 334 312 = My Favorites = 335 313 336 * `<?php AmazonWidget::MyFavorites( ); ?>`314 * `<?php AmazonWidget::MyFavorites( $options ); ?>` 337 315 * `[amazon_my_favorites]` 338 316 339 317 = Omakase (Leave it to Us) = 340 318 341 * `<?php AmazonWidget::Omakase( ); ?>`319 * `<?php AmazonWidget::Omakase( $options ); ?>` 342 320 * `[amazon_omakase]` 343 321 344 322 = Product Cloud = 345 323 346 * `<?php AmazonWidget::ProductCloud( ); ?>`324 * `<?php AmazonWidget::ProductCloud( $options ); ?>` 347 325 * `[amazon_product_cloud]` 348 326 349 327 = Search = 350 328 351 * `<?php AmazonWidget::Search( ); ?>`329 * `<?php AmazonWidget::Search( $options ); ?>` 352 330 * `[amazon_search]` 353 331 354 332 = Product Link = 355 333 356 * `<?php AmazonProduct::link( "link_text", '0345518705'); ?>`334 * `<?php AmazonProduct::link( array( "content"=>"link text", "id" => "0345518705" ) ); ?>` 357 335 * `[amazon_link id="0345518705"]link text[/amazon_link]` 358 336 359 337 = Product Image = 360 338 361 * `<?php AmazonProduct::image( "link_text", '0345518705', "medium", true); ?>`339 * `<?php AmazonProduct::image( array( "content" => "link text", "id" => "0345518705, "size" => "medium", "link" => true ) ); ?>` 362 340 * `[amazon_image id="0345518705" link="true"]alt text[/amazon_image]` 363 341 364 = Enhanced ProductAd =365 366 * `<?php AmazonProduct::enhanced( "0345518705"); ?>`342 = Enhanced Ad = 343 344 * `<?php AmazonProduct::enhanced( array( "asin" => "0345518705" ) ); ?>` 367 345 * `[amazon_enhanced asin="0345518705" ]` -
wordpress-amazon-associate/trunk/servlet/index.php
r321609 r410533 1 1 <?php 2 2 /* 3 * copyright (c) 2010 MDBitz - Matthew John Denton - mdbitz.com3 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com 4 4 * 5 5 * This file is part of WordPress Amazon Associate Plugin. … … 27 27 28 28 $result = null; 29 30 29 switch( $_REQUEST['Action'] ) { 31 30 case "ValidateAccess": 32 $api->setAccessKey( $_REQUEST['AccessKey'] ); 33 $api->setSecretKey( $_REQUEST['SecretKey'] ); 34 $api->setLocale( $_REQUEST['Locale'] ); 35 switch( $_REQUEST['Locale'] ) { 36 case 'US': 37 $result = $api->browseNodeLookup("1000"); 38 break; 39 case "UK": 40 $result = $api->browseNodeLookup("1025612"); 41 break; 42 case "CA": 43 $result = $api->browseNodeLookup("927726"); 44 break; 45 case "DE": 46 $result = $api->browseNodeLookup("541686"); 47 break; 48 case "FR": 49 $result = $api->browseNodeLookup("468256"); 50 break; 51 case "JP": 52 $result = $api->browseNodeLookup("465610"); 53 break; 31 if( ! empty($_REQUEST['AccessKey']) && ! empty($_REQUEST['SecretKey'])) { 32 $api->setAccessKey( $_REQUEST['AccessKey'] ); 33 $api->setSecretKey( $_REQUEST['SecretKey'] ); 34 $api->setLocale( $_REQUEST['Locale'] ); 35 switch( $_REQUEST['Locale'] ) { 36 case 'US': 37 $result = $api->browseNodeLookup("1000"); 38 break; 39 case "UK": 40 $result = $api->browseNodeLookup("1025612"); 41 break; 42 case "CA": 43 $result = $api->browseNodeLookup("927726"); 44 break; 45 case "DE": 46 $result = $api->browseNodeLookup("541686"); 47 break; 48 case "FR": 49 $result = $api->browseNodeLookup("468256"); 50 break; 51 case "JP": 52 $result = $api->browseNodeLookup("465610"); 53 break; 54 } 54 55 } 55 56 break; -
wordpress-amazon-associate/trunk/wordpress_amazon_associate.php
r400955 r410533 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. 6.17 Version: 1.7.0 8 8 Requires at least: 3.0.0 9 9 Author URI: http://labs.mdbitz.com … … 12 12 13 13 /* 14 * copyright (c) 2010 MDBitz - Matthew John Denton - mdbitz.com14 * copyright (c) 2010,2011 MDBitz - Matthew John Denton - mdbitz.com 15 15 * 16 16 * This file is part of WordPress Amazon Associate Plugin. … … 45 45 spl_autoload_register(array('WPAA', 'autoload')); 46 46 $wpaa = new WPAA(); 47 48 // deactivation 49 register_deactivation_hook( __FILE__, 'wpaa_deactivate'); 50 51 /** 52 * send site uninstall information 53 */ 54 function wpaa_deactivate() { 55 if( function_exists('curl_init') ) { 56 $handle = curl_init('http://mdbitz.com/installs.php?app=WPAA&uninstall=true&site=' . site_url() ); 57 if (false !== $handle) { 58 curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE); 59 curl_setopt($handle, CURLOPT_NOBODY, true); 60 $response = curl_exec($handle); 61 curl_close($handle); 62 } 63 } 64 }
Note: See TracChangeset
for help on using the changeset viewer.