__('Amazon Best Selling Books', 'widgets'), 'float'=>__('none', 'widgets'), 'numItems'=>__('3', 'widgets'), 'amazonId'=>__('', 'widgets'), 'ebayId'=>__('', 'widgets'), 'googleId'=>__('', 'widgets'), 'width'=>__('200', 'widgets')); if ( $_POST['amazon_books_smartlinks-submit'] ) { // Remember to sanitize and format use input appropriately. $options['title'] = strip_tags(stripslashes($_POST['amazon_books_smartlinks-title'])); $options['float'] = strip_tags(stripslashes($_POST['amazon_books_smartlinks-float'])); $options['width'] = strip_tags(stripslashes($_POST['amazon_books_smartlinks-width'])); $options['numItems'] = strip_tags(stripslashes($_POST['amazon_books_smartlinks-numItems'])); $options['amazonId'] = strip_tags(stripslashes($_POST['amazon_books_smartlinks-amazonId'])); $options['ebayId'] = strip_tags(stripslashes($_POST['amazon_books_smartlinks-ebayId'])); $options['googleId'] = strip_tags(stripslashes($_POST['amazon_books_smartlinks-googleId'])); update_option('widget_amazon_books_smartlinks', $options); } // Be sure you format your options to be valid HTML attributes. $title = htmlspecialchars($options['title'], ENT_QUOTES); $float = htmlspecialchars($options['float'], ENT_QUOTES); $width = htmlspecialchars($options['width'], ENT_QUOTES); $numItems = htmlspecialchars($options['numItems'], ENT_QUOTES); $amazonId = htmlspecialchars($options['amazonId'], ENT_QUOTES); $ebayId = htmlspecialchars($options['ebayId'], ENT_QUOTES); $googleId = htmlspecialchars($options['googleId'], ENT_QUOTES); if(empty($numItems)) { $numItems = 4; } if(empty($width)) { $width = 200; } // form echo '
(The float option is necessary if your widget pushes the content of your sidebar to the bottom, or is stretched to the bottom of the sidebar)
'; echo ''; } // Adds Amazon Bestselling Movies to your sidebar function widget_amazon_movies_smartlinks($args) { // $args is an array of strings that help widgets to conform to // the active theme: before_widget, before_title, after_widget, // and after_title are the array keys. Default tags: li and h2. extract($args); // get affiliate id $options = get_option('widget_amazon_movies_smartlinks'); $title = $options['title']; $float = $options['float']; $width = $options['width']; $numItems = $options['numItems']; $amazonId = $options['amazonId']; $ebayId = $options['ebayId']; $googleId = $options['googleId']; $feed = "http%3A%2F%2Fecs.amazonaws.com%2Fonca%2Fxml%3FService%3DAWSECommerceService%26AWSAccessKeyId%3D07GG2103RY5KFCY09GG2%26Operation%3DItemSearch%26SearchIndex%3DDVD%26BrowseNode%3D139452%26Sort%3Dsalesrank%26ResponseGroup%3DItemAttributes%2CImages%2CEditorialReview"; echo $before_widget; echo widget_amazon_smartlinks_createScript($feed, $title, "amazon-item.xsl", $numItems, $width, $float, $amazonId, $ebayId, $googleId); echo $after_widget; } function widget_amazon_movies_smartlinks_control() { // Get our options and see if we're handling a form submission. $options = get_option('widget_amazon_movies_smartlinks'); if ( !is_array($options) ) $options = array('title'=>__('Amazon Best Selling DVDs', 'widgets'), 'float'=>__('none', 'widgets'), 'numItems'=>__('3', 'widgets'), 'amazonId'=>__('', 'widgets'), 'ebayId'=>__('', 'widgets'), 'googleId'=>__('', 'widgets'), 'width'=>__('200', 'widgets')); if ( $_POST['amazon_movies_smartlinks-submit'] ) { // Remember to sanitize and format use input appropriately. $options['title'] = strip_tags(stripslashes($_POST['amazon_movies_smartlinks-title'])); $options['float'] = strip_tags(stripslashes($_POST['amazon_movies_smartlinks-float'])); $options['width'] = strip_tags(stripslashes($_POST['amazon_movies_smartlinks-width'])); $options['numItems'] = strip_tags(stripslashes($_POST['amazon_movies_smartlinks-numItems'])); $options['amazonId'] = strip_tags(stripslashes($_POST['amazon_movies_smartlinks-amazonId'])); $options['ebayId'] = strip_tags(stripslashes($_POST['amazon_movies_smartlinks-ebayId'])); $options['googleId'] = strip_tags(stripslashes($_POST['amazon_movies_smartlinks-googleId'])); update_option('widget_amazon_movies_smartlinks', $options); } // Be sure you format your options to be valid HTML attributes. $title = htmlspecialchars($options['title'], ENT_QUOTES); $float = htmlspecialchars($options['float'], ENT_QUOTES); $width = htmlspecialchars($options['width'], ENT_QUOTES); $numItems = htmlspecialchars($options['numItems'], ENT_QUOTES); $amazonId = htmlspecialchars($options['amazonId'], ENT_QUOTES); $ebayId = htmlspecialchars($options['ebayId'], ENT_QUOTES); $googleId = htmlspecialchars($options['googleId'], ENT_QUOTES); if(empty($numItems)) { $numItems = 4; } if(empty($width)) { $width = 200; } // form echo '(The float option is necessary if your widget pushes the content of your sidebar to the bottom, or is stretched to the bottom of the sidebar)
'; echo ''; } // Adds Amazon Bestselling Music to your sidebar function widget_amazon_music_smartlinks($args) { // $args is an array of strings that help widgets to conform to // the active theme: before_widget, before_title, after_widget, // and after_title are the array keys. Default tags: li and h2. extract($args); // get affiliate id $options = get_option('widget_amazon_music_smartlinks'); $title = $options['title']; $float = $options['float']; $width = $options['width']; $numItems = $options['numItems']; $amazonId = $options['amazonId']; $ebayId = $options['ebayId']; $googleId = $options['googleId']; $feed = "http%3A%2F%2Fecs.amazonaws.com%2Fonca%2Fxml%3FService%3DAWSECommerceService%26AWSAccessKeyId%3D07GG2103RY5KFCY09GG2%26Operation%3DItemSearch%26SearchIndex%3DMusic%26BrowseNode%3D5174%26Sort%3Dsalesrank%26ResponseGroup%3DItemAttributes%2CImages%2CEditorialReview"; echo $before_widget; echo widget_amazon_smartlinks_createScript($feed, $title, "amazon-item.xsl", $numItems, $width, $float, $amazonId, $ebayId, $googleId); echo $after_widget; } function widget_amazon_music_smartlinks_control() { // Get our options and see if we're handling a form submission. $options = get_option('widget_amazon_music_smartlinks'); if ( !is_array($options) ) $options = array('title'=>__('Amazon Best Selling Music', 'widgets'), 'float'=>__('none', 'widgets'), 'numItems'=>__('3', 'widgets'), 'amazonId'=>__('', 'widgets'), 'ebayId'=>__('', 'widgets'), 'googleId'=>__('', 'widgets'), 'width'=>__('200', 'widgets')); if ( $_POST['amazon_music_smartlinks-submit'] ) { // Remember to sanitize and format use input appropriately. $options['title'] = strip_tags(stripslashes($_POST['amazon_music_smartlinks-title'])); $options['float'] = strip_tags(stripslashes($_POST['amazon_music_smartlinks-float'])); $options['width'] = strip_tags(stripslashes($_POST['amazon_music_smartlinks-width'])); $options['numItems'] = strip_tags(stripslashes($_POST['amazon_music_smartlinks-numItems'])); $options['amazonId'] = strip_tags(stripslashes($_POST['amazon_music_smartlinks-amazonId'])); $options['ebayId'] = strip_tags(stripslashes($_POST['amazon_music_smartlinks-ebayId'])); $options['googleId'] = strip_tags(stripslashes($_POST['amazon_music_smartlinks-googleId'])); update_option('widget_amazon_music_smartlinks', $options); } // Be sure you format your options to be valid HTML attributes. $title = htmlspecialchars($options['title'], ENT_QUOTES); $float = htmlspecialchars($options['float'], ENT_QUOTES); $width = htmlspecialchars($options['width'], ENT_QUOTES); $numItems = htmlspecialchars($options['numItems'], ENT_QUOTES); $amazonId = htmlspecialchars($options['amazonId'], ENT_QUOTES); $ebayId = htmlspecialchars($options['ebayId'], ENT_QUOTES); $googleId = htmlspecialchars($options['googleId'], ENT_QUOTES); if(empty($numItems)) { $numItems = 4; } if(empty($width)) { $width = 200; } // form echo '(The float option is necessary if your widget pushes the content of your sidebar to the bottom, or is stretched to the bottom of the sidebar)
'; echo ''; } // Adds Amazon Bestselling Electronics to your sidebar function widget_amazon_electronics_smartlinks($args) { // $args is an array of strings that help widgets to conform to // the active theme: before_widget, before_title, after_widget, // and after_title are the array keys. Default tags: li and h2. extract($args); // get affiliate id $options = get_option('widget_amazon_electronics_smartlinks'); $title = $options['title']; $float = $options['float']; $width = $options['width']; $numItems = $options['numItems']; $amazonId = $options['amazonId']; $ebayId = $options['ebayId']; $googleId = $options['googleId']; $feed = "http%3A%2F%2Fecs.amazonaws.com%2Fonca%2Fxml%3FService%3DAWSECommerceService%26AWSAccessKeyId%3D07GG2103RY5KFCY09GG2%26Operation%3DItemSearch%26SearchIndex%3DElectronics%26BrowseNode%3D172282%26Sort%3Dsalesrank%26ResponseGroup%3DItemAttributes%2CImages%2CEditorialReview"; echo $before_widget; echo widget_amazon_smartlinks_createScript($feed, $title, "amazon-item.xsl", $numItems, $width, $float, $amazonId, $ebayId, $googleId); echo $after_widget; } function widget_amazon_electronics_smartlinks_control() { // Get our options and see if we're handling a form submission. $options = get_option('widget_amazon_electronics_smartlinks'); if ( !is_array($options) ) $options = array('title'=>__('Amazon Best Selling Electronics', 'widgets'), 'float'=>__('none', 'widgets'), 'numItems'=>__('3', 'widgets'), 'amazonId'=>__('', 'widgets'), 'ebayId'=>__('', 'widgets'), 'googleId'=>__('', 'widgets'), 'width'=>__('200', 'widgets')); if ( $_POST['amazon_electronics_smartlinks-submit'] ) { // Remember to sanitize and format use input appropriately. $options['title'] = strip_tags(stripslashes($_POST['amazon_electronics_smartlinks-title'])); $options['float'] = strip_tags(stripslashes($_POST['amazon_electronics_smartlinks-float'])); $options['width'] = strip_tags(stripslashes($_POST['amazon_electronics_smartlinks-width'])); $options['numItems'] = strip_tags(stripslashes($_POST['amazon_electronics_smartlinks-numItems'])); $options['amazonId'] = strip_tags(stripslashes($_POST['amazon_electronics_smartlinks-amazonId'])); $options['ebayId'] = strip_tags(stripslashes($_POST['amazon_electronics_smartlinks-ebayId'])); $options['googleId'] = strip_tags(stripslashes($_POST['amazon_electronics_smartlinks-googleId'])); update_option('widget_amazon_electronics_smartlinks', $options); } // Be sure you format your options to be valid HTML attributes. $title = htmlspecialchars($options['title'], ENT_QUOTES); $float = htmlspecialchars($options['float'], ENT_QUOTES); $width = htmlspecialchars($options['width'], ENT_QUOTES); $numItems = htmlspecialchars($options['numItems'], ENT_QUOTES); $amazonId = htmlspecialchars($options['amazonId'], ENT_QUOTES); $ebayId = htmlspecialchars($options['ebayId'], ENT_QUOTES); $googleId = htmlspecialchars($options['googleId'], ENT_QUOTES); if(empty($numItems)) { $numItems = 4; } if(empty($width)) { $width = 200; } // form echo '(The float option is necessary if your widget pushes the content of your sidebar to the bottom, or is stretched to the bottom of the sidebar)
'; echo ''; } // Adds your Amazon Wishlit to your sidebar function widget_amazon_wishlist_smartlinks($args) { // $args is an array of strings that help widgets to conform to // the active theme: before_widget, before_title, after_widget, // and after_title are the array keys. Default tags: li and h2. extract($args); // get affiliate id $options = get_option('widget_amazon_wishlist_smartlinks'); $title = $options['title']; $listId = $options['listId']; $float = $options['float']; $width = $options['width']; $numItems = $options['numItems']; $amazonId = $options['amazonId']; $ebayId = $options['ebayId']; $googleId = $options['googleId']; $feed = 'http%3A%2F%2Fecs.amazonaws.com%2Fonca%2Fxml%3FService%3DAWSECommerceService%26AWSAccessKeyId%3D07GG2103RY5KFCY09GG2%26Operation%3DListLookup%26ListType%3DWishList%26ListId%3D' . $listId . '%26ResponseGroup%3DItemAttributes%2CImages%2CEditorialReview'; echo $before_widget; echo widget_amazon_smartlinks_createScript($feed, $title, "amazon-list.xsl", $numItems, $width, $float, $amazonId, $ebayId, $googleId); echo $after_widget; } function widget_amazon_wishlist_smartlinks_control() { // Get our options and see if we're handling a form submission. $options = get_option('widget_amazon_wishlist_smartlinks'); if ( !is_array($options) ) $options = array('title'=>__('My Amazon Wish List', 'widgets'), 'listId'=>__('', 'widgets'), 'float'=>__('none', 'widgets'), 'numItems'=>__('3', 'widgets'), 'amazonId'=>__('', 'widgets'), 'ebayId'=>__('', 'widgets'), 'googleId'=>__('', 'widgets'), 'width'=>__('200', 'widgets')); if ( $_POST['amazon_wishlist_smartlinks-submit'] ) { // get list id from email address $email = $_POST['amazon_wishlist_smartlinks-email']; $responseString = file_get_contents("http://s1.smrtlnks.com/users/GetPageContent.php?url=http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService" . "&AWSAccessKeyId=07GG2103RY5KFCY09GG2&Operation=ListSearch&ListType=WishList&Email=" . $email); if(strpos($responseString, "Error") === FALSE) { $start = strpos($responseString, "(The float option is necessary if your widget pushes the content of your sidebar to the bottom, or is stretched to the bottom of the sidebar)
'; echo ''; } function widget_amazon_smartlinks_createScript($feed, $title, $xsl, $numItems, $width, $float, $amazonId, $ebayId, $googleId) { if(empty($numItems)) { $numItems = 4; } if(empty($width)) { $width = 200; } $script = ''; if(strcmp($float, "left") === 0 || strcmp($float, "right") === 0) { return '