Great idea for the plugin!
See it in action with edits so far here:
http://http://www.baby.lench.us/?page_id=41 and my personal site is (insert shamless plug) here:
http://http://www.daniellench.com (still in progress, the header image isn't right yet).
Our baby is due in may and I wanted to put an amazon wish list on my site for the ease of one stop shopping. Your plugin is the best one out there and I want to help make it better.
How 'bout these edits in the shortcode because my theme for the baby site doesn't handle widgets well. I wanted to show the item picture and the content together so I edited the avh-amazon.shortcode.php
edits to the function shortcodeAsin:
case 'pic-text' :
$imgsrc = $item_result['Items']['Item']['SmallImage']['URL'];
$return = '<table style=" border: none; cellpadding: 2px; align: left"><tr><td><a title="' . $content . '" href="' . $myurl . '"><img class="alignleft" src="' . $imgsrc . '" alt="' . $content . '"/></a></td><td><a title="' . $content . '" href="' . $myurl . '">' . $content . '</a></td></tr></table>';
break;
Had to add the tables because the items were nesting when there are multiples and the background was ending prematurely.
edits to the function metaboxTabOutputOptions:
echo '<label><input type="radio" value="pic" id="avhamazon_sc' . $tabid . '_linktypep" name="avhamazon_sc' . $tabid . '_linktype"/> ' . __ ( 'Picture', 'avhamazon' ) . '</label><br />';
echo '<label><input type="radio" value="pic-text" id="avhamazon_sc' . $tabid . '_linktypept" name="avhamazon_sc' . $tabid . '_linktype"/> ' . __ ( 'Picture and Text', 'avhamazon' ) . '</label></p>';
Changed the </p> to <br /> at the end of the _linktypep line above and added </p> to the end of the new line.
I'm not so good at coding so I can't figure out how to show all items at once and I had to insert each item into the editor.
The post in the editor looks exactly like this:[avhamazon wishlist="ZS4YOCPN2JT6" asin="B000UEA9ZW" linktype="pic-text" locale="US"][avhamazon wishlist="ZS4YOCPN2JT6" asin="B000LPBQC0" linktype="pic-text" locale="US"]
It must be a "while have items(get items)" or something like the wordpress loop to get all items in the wishlist.
Lastly I was trying to pull the wish list from the database to be the default value in the input box but I'm lost completely. I think it is retrieved at the beginning.
// Get options from WP
$this->db_options = 'avhamazon';
$options_from_table = get_option ( $this->db_options );
But like I said, I'm lost.
It should be an edit to the value="" in the function metaboxTabWishlist:
//can't figure this out
echo ' <input style="width: 13em" type="text" value="' . $this->info['wishlist_id'] . '" id="avhamazon_scwishlist_wishlist" name="avhamazon_scwishlist_wishlist" autocomplete="on"/>';
//i want the default wishlist populatedI'll keep your associate ID for the purchases because it's not pulling it from the database correctly.
I changed it from yours in the admin panel but it doesn't pass into the shortcode:
// Update default options by getting not empty values from options table
foreach ( ( array ) $default_options as $default_options_name => $default_options_value ) {
if ( ! is_null ( $options_from_table[$default_options_name] ) ) {
if ( is_int ( $default_options_value ) ) {
$default_options[$default_options_name] = ( int ) $options_from_table[$default_options_name];
} else {
$default_options[$default_options_name] = $options_from_table[$default_options_name];
if ( 'associated_id' == $default_options_name ) {
if ( 'blogavirtualh-20' == $options_from_table[$default_options_name] ) $default_options[$default_options_name] = 'avh-amazon-20'; // Changed the Amazon ID for better tracking
}
}
}
}What do you think, and thanks again.
Dan