Changeset 1004924
- Timestamp:
- 10/10/2014 07:42:29 AM (11 years ago)
- Location:
- 2kb-amazon-affiliates-store/trunk
- Files:
-
- 14 edited
-
KbAmazonImporter.php (modified) (1 diff)
-
KbAmazonStore.php (modified) (4 diffs)
-
plugin.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
store_functions.php (modified) (1 diff)
-
store_shortcodes.php (modified) (5 diffs)
-
template/admin/css/default.css (modified) (1 diff)
-
template/admin/importBySearch.phtml (modified) (1 diff)
-
template/admin/index.phtml (modified) (1 diff)
-
template/admin/productsShortCodes.phtml (modified) (2 diffs)
-
template/admin/version.phtml (modified) (1 diff)
-
template/default/css/style.css (modified) (1 diff)
-
template/view/partial/product.phtml (modified) (2 diffs)
-
template/view/products.phtml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
2kb-amazon-affiliates-store/trunk/KbAmazonImporter.php
r932407 r1004924 543 543 } 544 544 545 546 545 $metaToInsert = $this->updateProductPostMeta($meta, $postId); 547 546 -
2kb-amazon-affiliates-store/trunk/KbAmazonStore.php
r993771 r1004924 43 43 'code' => 'kb_amz_product_content', 44 44 'params' => array( 45 'show -all-reviews' => 'Yes/No',46 'show -title' => 'Yes/No',47 'strip -tags' => 'No/Yes',48 'replace' => ' No/Yes - replace the short code result directly in the post'45 'show_all_reviews' => '<b>Yes</b>/No', 46 'show_title' => '<b>Yes</b>/No', 47 'strip_tags' => '<b>No</b>/Yes', 48 'replace' => '<b>No</b>/Yes - replace the short code result directly in the post' 49 49 ), 50 50 'active' => true, … … 74 74 'code' => 'kb_amz_list_products', 75 75 'params' => array( 76 'featured' => '<b>No</b>/Yes', 77 'featured_content_length' => '<b>300</b> / any number', 76 78 'items_per_row' => '2,3,4,6', 77 79 'posts_per_page' => 'Number', … … 80 82 'post_status' => 'Always - any', 81 83 'title' => 'String', 82 'attribute Key' => '(See Product Attributes)',83 'attribute Value' => '(Explore Attributes Value)',84 'attribute Compare' => "'=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN'"84 'attribute_key' => '(See Product Attributes)', 85 'attribute_value' => '(Explore Attributes Value)', 86 'attribute_compare' => "'=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN'" 85 87 ), 86 88 'active' => true, … … 591 593 } 592 594 } 595 596 public function getProductContent($id) 597 { 598 $meta = $this->getProductMeta($id); 599 return isset($meta['KbAmzEditorialReviews.EditorialReview.0.Content']) 600 ? $meta['KbAmzEditorialReviews.EditorialReview.0.Content'] : ''; 601 } 593 602 594 603 public function getCartButtonHtml($id) -
2kb-amazon-affiliates-store/trunk/plugin.php
r993771 r1004924 4 4 * Plugin URI: http://www.2kblater.com/?p=8318 5 5 * Description: Amazon Affiliate Store Plugin With Cart, Checkout, Custom Themes. Easy to manage and setup. Sell wide range of physical and digital products imported from Amazon Affiliate API using 90 days cookie reference. This plugin is released with GPL2 license. 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: 2kblater.com 8 8 * Author URI: http://www.2kblater.com … … 16 16 } 17 17 18 define('KbAmazonVersion', '1.0. 6');19 define('KbAmazonVersionNumber', 10 6);18 define('KbAmazonVersion', '1.0.7'); 19 define('KbAmazonVersionNumber', 107); 20 20 define('KbAmazonStoreFolderName', pathinfo(dirname(__FILE__), PATHINFO_FILENAME)); 21 21 define('KbAmazonStorePluginPath', dirname(__FILE__) . '/'); -
2kb-amazon-affiliates-store/trunk/readme.txt
r993771 r1004924 3 3 Requires at least: 4.0 4 4 Tested up to: 4.0 5 Stable tag: 1.0. 65 Stable tag: 1.0.7 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 36 36 37 37 == Changelog == 38 38 = 1.0.7 = 39 Short Codes bug fixed - all shortcodes use '_' instead of '-'. 40 Added option for featured content in [kb_amz_list_products featured="Yes" featured_content_length="150"]. Content is loaded from the_excerpt or the product description. 41 Bug fixed when using [kb_amz_list_products] in product shortcode content. (product is excluded from the query). 39 42 = 1.0.6 = 40 43 Category accept functions in [kb_amz_list_products] and items_per_row added. -
2kb-amazon-affiliates-store/trunk/store_functions.php
r993771 r1004924 352 352 } 353 353 } 354 355 function getKbAmzExcerptFromContent($postcontent, $length) 356 { 357 $this_excerpt = strip_shortcodes( $postcontent ); 358 $this_excerpt = strip_tags($this_excerpt); 359 $this_excerpt = substr($this_excerpt, 0, $length); 360 361 $parts = preg_split('/([\s\n\r]+)/', $this_excerpt, null, PREG_SPLIT_DELIM_CAPTURE); 362 $parts_count = count($parts); 363 364 $length = 0; 365 $last_part = 0; 366 for (; $last_part < $parts_count; ++$last_part) { 367 $length += strlen($parts[$last_part]); 368 if ($length > $length) { break; } 369 } 370 371 return implode(array_slice($parts, 0, $last_part)); 372 } -
2kb-amazon-affiliates-store/trunk/store_shortcodes.php
r993771 r1004924 102 102 // [kb_amz_product_content] 103 103 function kb_amz_product_content_func($atts) { 104 104 105 $atts = shortcode_atts( array( 105 'show -all-reviews' => 'Yes',106 'show -title' => 'Yes',107 'strip -tags' => 'No',106 'show_all_reviews' => 'Yes', 107 'show_title' => 'Yes', 108 'strip_tags' => 'No', 108 109 'id' => null 109 110 ), $atts); … … 126 127 </div> 127 128 HTML; 129 128 130 $postId = $atts['id'] ? $atts['id'] : get_the_ID(); 129 131 $meta = getKbAmz()->getProductMetaArray($postId); … … 137 139 $contents = array(); 138 140 foreach ($reviews as $review) { 139 if (kbAmzShortCodeBool($atts['show -title'])) {141 if (kbAmzShortCodeBool($atts['show_title'])) { 140 142 $headers[] = $review['Source']; 141 143 } 142 144 143 $contents[] = kbAmzShortCodeBool($atts['strip -tags'])145 $contents[] = kbAmzShortCodeBool($atts['strip_tags']) 144 146 ? strip_tags($review['Content']) 145 147 : $review['Content']; 146 if (!kbAmzShortCodeBool($atts['show -all-reviews'])) {148 if (!kbAmzShortCodeBool($atts['show_all_reviews'])) { 147 149 break; 148 150 } … … 284 286 function kb_amz_list_products($atts) { 285 287 $atts = shortcode_atts( array( 288 'featured' => null, 289 'featured_content_length' => 300, 286 290 'posts_per_page' => get_option('posts_per_page', 10), 287 291 'category' => null, 288 292 'post_status' => 'any', 289 'attribute Key' => null,290 'attribute Value' => null,291 'attribute Compare' => '=',293 'attribute_key' => null, 294 'attribute_value' => null, 295 'attribute_compare' => '=', 292 296 'title' => null, 293 297 'pagination' => 'Yes', … … 319 323 $atts['cat'] = $category; 320 324 $atts['post_type'] = 'post'; 321 $atts['meta_key'] = 'KbAmzASIN';325 //$atts['meta_key'] = 'KbAmzASIN'; 322 326 $atts['post_status'] = 'any'; 323 327 $atts['paged'] = getKbAmzPaged(); 324 325 if (isset($atts['attributeKey']) && isset($atts['attributeValue'])) { 326 $atts['meta_query'] = array( 327 'key' => $atts['attributeKey'], 328 'value' => $atts['attributeValue'], 329 'compare' => $atts['attributeCompare'] 330 ); 331 } 332 kbAmzIsMainQuery(true); 328 $atts['meta_query'] = array(); 329 $atts['meta_query'][] = array( 330 'key' => 'KbAmzASIN' 331 ); 332 333 if (null !== $atts['attribute_key'] && null !== $atts['attribute_value']) { 334 $atts['meta_query'][] = array( 335 'key' => $atts['attribute_key'], 336 'value' => $atts['attribute_value'], 337 'compare' => str_replace(array('>', '<'), array('>', '<'), $atts['attribute_compare']) 338 ); 339 } 340 341 if (get_the_ID() && getKbAmz()->isPostProduct(get_the_ID())) { 342 $atts['post__not_in'] = array(get_the_ID()); 343 } 344 345 $currentPost = null; 346 if (get_the_ID()) { 347 global $post; 348 $currentPost = $post; 349 } 350 351 kbAmzIsMainQuery(true); 333 352 $posts = query_posts($atts); 334 353 $atts['maxNumPages'] = $GLOBALS['wp_query']->max_num_pages; 335 354 $atts['posts'] = $posts; 355 $atts['featured'] = kbAmzShortCodeBool($atts['featured']); 336 356 $view = getKbAmzTemplate()->getProductsView($atts)->getContent(); 337 357 wp_reset_query(); 338 358 kbAmzIsMainQuery(false); 339 359 if (get_the_ID()) { 360 setup_postdata($currentPost); 361 } 340 362 return $view; 341 363 } -
2kb-amazon-affiliates-store/trunk/template/admin/css/default.css
r920982 r1004924 74 74 margin-top: 10px; 75 75 } 76 .homepage .label{ 77 display: inline-block; 78 margin-bottom: 5px; 79 } -
2kb-amazon-affiliates-store/trunk/template/admin/importBySearch.phtml
r920982 r1004924 1 1 <form role="form" method="post"> 2 <div class="alert alert-success">User Category from the select or write down your own. <a href="http://docs.aws.amazon.com/AWSECommerceService/latest/DG/BrowseNodeIDs.html" target="_blank">Check this link for amazon categories</a></div> 2 3 <div class="row"> 3 4 <div class="col-xs-4"> -
2kb-amazon-affiliates-store/trunk/template/admin/index.phtml
r993771 r1004924 1 <div class="row ">1 <div class="row homepage"> 2 2 3 3 <div class="col-sm-3"> -
2kb-amazon-affiliates-store/trunk/template/admin/productsShortCodes.phtml
r993771 r1004924 21 21 $params[] = $nameParamName . '="'.$avaialbe.'"'; 22 22 } 23 echo implode(' ,', $params);23 echo implode(' ', $params); 24 24 ?> 25 25 </td> … … 49 49 <div class="form-group"> 50 50 <label class="control-label" for="updateForAllPosts"> 51 <?php echo __('Update For All Existing Products. '); ?>51 <?php echo __('Update For All Existing Products. Note that if some product is updated manualy, all the changes will be lost with option Yes.'); ?> 52 52 </label> 53 53 <select value="<?php echo getKbPostVar('updateForAllPosts', 0);?>" name="updateForAllPosts" class="form-control"> -
2kb-amazon-affiliates-store/trunk/template/admin/version.phtml
r993771 r1004924 1 1 <div class="row" id="kb-amz-version"> 2 2 <div class="col-sm-12"> 3 <h4>1.0.7</h4> 4 <ul style="list-style-type: disc;"> 5 <li>Short Codes bug fixed - all shortcodes use '_' instead of '-'.</li> 6 <li>Added option for featured content in [kb_amz_list_products featured="Yes" featured_content_length="150"]. Content is loaded from the_excerpt or the product description.</li> 7 <li>Bug fixed when using [kb_amz_list_products] in product shortcode content. (product is excluded from the query).</li> 8 </ul> 3 9 <h4>1.0.6</h4> 4 10 <ul style="list-style-type: disc;"> -
2kb-amazon-affiliates-store/trunk/template/default/css/style.css
r920982 r1004924 346 346 line-height: 0; 347 347 } 348 349 .kb-amz-row-item-part.featured .kb-amz-item-list-img img{ 350 margin: 0!important; 351 /*position: initial!important;*/ 352 } 353 354 .kb-amz-row-item-part.featured .kb-amz-item-list-img a{ 355 float: left; 356 width: 50%; 357 position: relative; 358 height: 100%; 359 } 360 .kb-amz-featured-content{ 361 float: left; 362 width: 49%; 363 padding-left: 1%; 364 } 348 365 /*TB*/ 349 366 .row { -
2kb-amazon-affiliates-store/trunk/template/view/partial/product.phtml
r993771 r1004924 18 18 $sm = 4; 19 19 $xs = 4; 20 } 21 20 } else if ($c == 2) { 21 $lg = 6; 22 $md = 6; 23 $sm = 6; 24 $xs = 6; 25 }; 22 26 ?> 23 27 24 <li class="kb-amz-per-row-<?php echo $c; ?> col-lg-<?php echo $lg; ?> col-md-<?php echo $md; ?> col-sm-<?php echo $sm; ?> col-xs-<?php echo $xs; ?> kb-amz-row-item-part <?php echo getKbAmz()->getOption('productListImageSize'); ?> ">28 <li class="kb-amz-per-row-<?php echo $c; ?> col-lg-<?php echo $lg; ?> col-md-<?php echo $md; ?> col-sm-<?php echo $sm; ?> col-xs-<?php echo $xs; ?> kb-amz-row-item-part <?php echo getKbAmz()->getOption('productListImageSize'); ?> <?php echo $this->featured ? 'featured' : 'not-featured'; ?>"> 25 29 <article id="post-<?php echo $p->ID; ?>" <?php post_class('kb-amz-product', $p->ID); ?>> 26 30 <header> … … 35 39 ?> 36 40 </a> 41 <?php if ($this->featured) : ?> 42 <div class="kb-amz-featured-content"> 43 <?php 44 if (!empty($p->post_excerpt)) { 45 echo $p->post_excerpt; 46 } else { 47 $content = getKbAmz()->getProductContent($p->ID); 48 echo getKbAmzExcerptFromContent($content, $this->featured_content_length); 49 } 50 ?> 51 </div> 52 <?php endif; ?> 37 53 <?php echo getKbAmz()->getProductSticker($p->ID); ?> 38 54 </div> -
2kb-amazon-affiliates-store/trunk/template/view/products.phtml
r993771 r1004924 25 25 $i = 0; 26 26 } 27 setup_postdata($p); 27 28 include dirname(__FILE__) . '/partial/product.phtml'; 28 29 $i++;
Note: See TracChangeset
for help on using the changeset viewer.