Gary M Davis Description: Affiliate Easel for Amazon is an affiliate helper and site builder for Amazon affiliates. After Activation, add your affiliate ID and keys on the admin page. Visit the BookSpree site for complete information about Affiliate Easel for Amazon. Copyright © 2011 Gary M Davis, Zykinetics Inc. (email : gary [a t ] zykinetics DOT com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * easelWidget Class */ class easelWidget extends WP_Widget { /** constructor */ function easelWidget() { parent::WP_Widget(false, $name = 'Affiliate Easel Search'); } /** @see WP_Widget::widget */ function widget($args, $instance) { extract( $args ); $title = apply_filters('widget_title', $instance['title']); $searchpage = apply_filters('widget_searchpage', $instance['searchpage']); echo $before_widget; if ( $title ){echo $before_title . $title . $after_title;} include 'includes/search_widget.php'; echo $after_widget; } /** @see WP_Widget::update */ function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['searchpage'] = strip_tags($new_instance['searchpage']); return $instance; } /** @see WP_Widget::form */ function form($instance) { $title = esc_attr($instance['title']); $searchpage = esc_attr($instance['searchpage']); //print_r($instance); ?>


Place the shortcode "[az_easel node="1000" index="Books"]" on the selected page. getAdminOptions(); } // function deactivate() { // Cleanup if requested delete_option('aeaAffiliateEaselAdminOptions'); delete_option('widget_easelwidget'); } function makeSearchPage(){ $shoppe = array('post_status' => 'publish', 'post_type' => 'page', 'ping_status' => 'closed', 'post_content' => '[az_easel node="1000" index="Books"]', 'post_title' => 'Shoppe'); wp_insert_post($shoppe, false); } //END makeSearchPage() //Returns an array of admin options function getAdminOptions() { $aeaAdminOptions = array( //list options 'aff_id' => '', 'aeaaff_key' => '', 'aeaaff_secret' => '', 'contribute' => '9', 'show_title' => 'h3', 'show_image' => 'medium', 'show_byline' => 'true', 'show_ratings' => '', 'show_related' => '', 'show_versions' => '', 'show_content' => '0', //item detail options 'show_title_d' => 'h1', 'show_image_d' => 'large', 'show_byline_d' => 'true', 'show_ratings_d' => 'true', 'show_related_d' => 'true', 'show_versions_d' => 'true', 'show_content_d' => 'full', 'show_list_d' => 'true', 'float_d' => '', 'show_kindle' => 'true', 'show_mp3' => 'true', //prices 'show_list' => 'true', 'show_az' => 'true', 'show_azn' => '', 'show_azu' => '', 'show_azr' => '', 'show_azc' => '', //page navigation 'show_page_top' => 'true', 'show_page_bot' => 'true', 'float' => 'true', 'link_type' => '', 'aea_blank' => '' ); $aea_option = get_option($this->adminOptionsName); if (!empty($aea_option)) { //add_option($this->adminOptionsName, $aeaAdminOptions); //would this be better? foreach ($aea_option as $key => $option) $aeaAdminOptions[$key] = $option; } //END if (!empty($aea_option)) update_option($this->adminOptionsName, $aeaAdminOptions); return $aeaAdminOptions; } //END function getAdminOptions //----------------------------------------------------- function aff_easel_admin_warnings() { if ( !get_option('add_id') ) { function aff_easel_warning() { echo "

".__('Affilate Easel is almost ready.')." ".sprintf(__('You must enter your Amazon API keys and Affiliate ID for it to work.'), "options-general.php?page=affiliate-easel.php")."

"; } add_action('admin_notices', 'aff_easel_warning'); return; } } //----------------------------------------------------- //Prints out the admin page function printAdminPage() { $aea_option = $this->getAdminOptions(); if (isset($_POST['update_aeaAffiliateEaselSettings'])) { //checkboxes don't need conditional statements check_admin_referer('az_easel_nonce'); $aea_option['show_ratings'] = $_POST['aeaRatings']; $aea_option['show_byline'] = $_POST['aeaByline']; $aea_option['show_versions'] = $_POST['aeaVersions']; $aea_option['show_related'] = $_POST['aeaRelated']; $aea_option['show_content'] = $_POST['aeaContent']; $aea_option['show_list'] = $_POST['listPrice']; $aea_option['show_az'] = $_POST['azPrice']; $aea_option['show_azu'] = $_POST['azuPrice']; $aea_option['show_azn'] = $_POST['aznPrice']; $aea_option['show_azr'] = $_POST['azrPrice']; $aea_option['show_azc'] = $_POST['azcPrice']; $aea_option['float'] = $_POST['aeaFloat']; $aea_option['show_page_top'] = $_POST['aeaPageTop']; $aea_option['show_page_bot'] = $_POST['aeaPageBot']; // $aeaDetail_option['show_ratings_d'] = $_POST['aeaDetailRatings']; $aeaDetail_option['show_byline_d'] = $_POST['aeaDetailByline']; $aeaDetail_option['show_versions_d'] = $_POST['aeaDetailVersions']; $aeaDetail_option['show_related_d'] = $_POST['aeaDetailRelated']; $aea_option['show_content_d'] = $_POST['aeaDetailContent']; $aea_option['float_d'] = $_POST['aeaDetailFloat']; $aea_option['show_kindle'] = $_POST['aeaDetailKindle']; $aea_option['show_mp3'] = $_POST['aeaDetailmp3']; $aea_option['aea_blank'] = $_POST['aea_blank']; // if (isset($_POST['aeaLink'])) { $aea_option['link_type'] = $_POST['aeaLink']; } if (isset($_POST['aeaImageSize'])) { $aea_option['show_image'] = $_POST['aeaImageSize']; } if (isset($_POST['aeaTitle'])) { $aea_option['show_title'] = $_POST['aeaTitle']; } if (isset($_POST['aeaDetailImageSize'])) { $aea_option['show_image_d'] = $_POST['aeaDetailImageSize']; } if (isset($_POST['aeaDetailTitle'])) { $aea_option['show_title_d'] = $_POST['aeaDetailTitle']; } if (isset($_POST['aeaaff_id'])) { $aea_option['aff_id'] = apply_filters('aff_id_save_pre', $_POST['aeaaff_id']); } if (isset($_POST['aeaaff_key'])) { $aea_option['aeaaff_key'] = apply_filters('aeaaff_key_save_pre', $_POST['aeaaff_key']); } if (isset($_POST['aeaaff_secret'])) { $aea_option['aeaaff_secret'] = apply_filters('aeaaff_secret_save_pre', $_POST['aeaaff_secret']); } if (isset($_POST['contribute'])) { $aea_option['contribute'] = apply_filters('contribute_save_pre', $_POST['contribute']); } update_option($this->adminOptionsName, $aea_option); ?>

".__('Affilate Easel is almost ready.')." ".sprintf(__('You must enter your Amazon API keys and Affiliate ID for it to work.'), "options-general.php?page=affiliate-easel.php")."

"; } add_action('admin_notices', 'aff_easel_warning'); return; } */ } /**/ //-- END admin menu --// //shortcode function easel_item($atts) { global $easel_atts; $opt = get_option('aeaAffiliateEaselAdminOptions'); //get predefined options extract(shortcode_atts(array( 'item' => '', //for item lookup - ASIN code B002FQJT3Q 'search' => '', //for search only - search term 'node' => '', //for node only - numeric search node 'index' => 'All', //for search. may be All, Apparel, Automotive, Baby, Beauty, Blended, Books, Classical, DigitalMusic, DVD, Electronics, ForeignBooks, GourmetFood, Grocery, HealthPersonalCare, Hobbies, HomeGarden, Industrial, Jewelry, KindleStore, Kitchen, Magazines, Merchants, Miscellaneous, MP3Downloads, Music, MusicalInstruments, MusicTracks, OfficeProducts, OutdoorLiving, PCHardware, PetSupplies, Photo, Software, SoftwareVideoGames, SportingGoods, Tools, Toys, VHS, Video, VideoGames, Watches, Wireless, WirelessAccessories 'show_title' => $opt['show_title'], //h3 'show_image' => $opt['show_image'], //'medium', 'show_byline' => $opt['show_byline'], //'true', 'show_ratings' => $opt['show_ratings'], //'', 'show_related' => $opt['show_related'], //'', 'show_versions' => $opt['show_versions'], //'', 'show_content' => $opt['show_content'], //'0', //prices 'show_list' => $opt['show_list'], //'true', 'show_az' => $opt['show_az'], //'true', 'show_azn' => $opt['show_azn'], //'', 'show_azu' => $opt['show_azu'], //'', 'show_azr' => $opt['show_azr'], //'', 'show_azc' => $opt['show_azc'], //'', //page navigation 'page_top' => $opt['show_page_top'], //'true', 'page_bot' => $opt['show_page_bot'], //'true', 'float' => $opt['float'], //'true', ), $atts)); if($_GET['node']){$item=''; $node=$_GET['node']; $search='';} if($_GET['kw']){$item=''; $node=''; $search=$_GET['kw'];} if($_GET['item']){$item=$_GET['item']; $node=''; $search='';} if($item){ $item=str_replace('-', '', trim($item));//removes spaces and hyphen return(ItemLookup($item, $index, $atts)); } elseif($search){ if(isset($_GET['ItemPage'])){$p=$_GET['ItemPage'];}else{$p='1';} if(!isset($index)){$index='All';} if(isset($_GET['idx'])){$index=$_GET['idx'];} return(ItemSearch($index, rawurlencode($search), $p, $atts)); } elseif($node){ if(!isset($index)){$index='Books';} //index cannot be "All" for BrowseNode if(isset($_GET['idx'])){$index=$_GET['idx'];} if(isset($_GET['ItemPage'])){$p=$_GET['ItemPage'];}else{$p='1';} return(nodePage($index, $node, $p, $atts)); } } add_shortcode('az_easel', 'easel_item'); function search_form($atts){ extract(shortcode_atts(array( 'page'=> get_page_link(), 'select'=>'', ), $atts)); $searchpage = $page; $form=file_get_contents( WP_PLUGIN_DIR .'/affiliate-easel-for-amazon/includes/search_widget.php' ); /* eval ouputs directly to the browser so putting it in the output buffer allows control over placement */ ob_start(); eval(' ?> '.$form.' 'CartCreate', 'Item.1.OfferListingId'=>$offerListingId, 'Item.1.Quantity'=>'1'); $request=signed($q); if (isset($_GET['dev'])){$results.='

For development test XML [cartCreate]

' ;} $response = @file_get_contents($request); if(!$response){ $results.='
Amazon Error.
'; return($results); } $parsed_xml = simplexml_load_string($response); showCartContents($parsed_xml); } //------------------------------------------------------------------------------------------------------- function cartAdd($offerListingId){ $CartId = $_GET['CartId']; $HMAC = urlencode($_GET['HMAC']); $q = array('Operation'=>'CartAdd', 'CartId'=>$CartId, 'HMAC'=>$HMAC, 'Item.1.OfferListingId'=>$offerListingId, 'Item.1.Quantity'=>'1'); $request=signed($q); if (isset($_GET['dev'])){$results.='

For development test XML [cartAdd]

' ;} $response = @file_get_contents($request); if(!$response){ $results.='
Amazon Error.
'; return($results); } $parsed_xml = simplexml_load_string($response); showCartContents($parsed_xml); } //------------------------------------------------------------------------------------------------------- function showCartContents($parsed_xml){ print(""); $CartId = $parsed_xml->Cart->CartId; $HMAC = $parsed_xml->Cart->URLEncodedHMAC; foreach($parsed_xml->Cart->CartItems->CartItem as $current){ $CartItemId = $current->CartItemId; $remove="books.html?Action=Remove&CartId=$CartId&HMAC=$HMAC&CartItemId=$CartItemId"; print(""); } print(""); print("
".$current->Title.": ".$current->Price->FormattedPrice."   (Remove from Cart)
Subtotal: ".$parsed_xml->Cart->CartItems->SubTotal->FormattedPrice."
"); $continue = "books.html?Action=Search&CartId=$CartId&HMAC=$HMAC"; print("Continue Shopping"); $checkout=$parsed_xml->Cart->PurchaseURL; print("   Checkout"); print("
"); } //------------------------------------------------------------------------------------------------------ function removeFromCart($CartItemId){ $CartId = $_GET['CartId']; $HMAC = urlencode($_GET['HMAC']); $CartItemId = $_GET['CartItemId']; $q = array('Operation' => 'CartModify', 'CartId' => $CartId, 'HMAC' => $HMAC, 'Item.1.CartItemId' => $CartItemId, 'Item.1.Quantity' => '0'); $request=sign($q); if (isset($_GET['dev'])){$results.='

For development test XML [removeFromCart]

' ;} $response = @file_get_contents($request); if(!$response){ $results.='
Amazon Error.
'; return($results); } $parsed_xml = simplexml_load_string($response); showCartContents($parsed_xml); } //----------------------------------------------------------------------------------------------------- function getCartContents($CartId, $HMAC){ $q = array('Operation'=>'CartGet', 'CartId'=>$CartId, 'HMAC'=>$HMAC); $request=sign($q); if (isset($_GET['dev'])){$results.='

For development test XML [getCartContents]

' ;} $response = @file_get_contents($request); if(!$response){ $results.='
Amazon Error.
'; return($results); } $parsed_xml = simplexml_load_string($response); showCartContents($parsed_xml); } //------------------------------------------------------------------------------------------------------ function ItemSearch($index, $keywords, $page, $atts){ $q =array('ItemPage'=>$page, 'Keywords'=>$keywords, 'SearchIndex'=>$index, 'Operation'=>'ItemSearch', 'ResponseGroup'=>'Large,Offers,VariationSummary'); //$q['Keywords']=rawurldecode($q['Keywords']); $request=signed($q); if (isset($_GET['dev'])){$results.='

For development test XML [ItemSearch]

' ;} $response = @file_get_contents($request); if(!$response){ $results.='
Amazon Error.
'; return($results); } $parsed_xml = simplexml_load_string($response); $results.=searchDetails($parsed_xml, $index, $atts); return($results); } //------------------------------------------------------------------------------------------------------- function ItemLookup($item, $index, $atts){ $q = array('ItemId'=>$item, 'Operation'=>'ItemLookup', 'ResponseGroup'=>'Large,Offers,VariationSummary,AlternateVersions'); $request=signed($q); if (isset($_GET['dev'])){$results.='

For development test XML [ItemLookup]

' ;} $response = @file_get_contents($request); if(!$response){ $results.='
Amazon Error.
'; return($results); } $parsed_xml = simplexml_load_string($response); $results.=searchDetails($parsed_xml, $index, $atts); return($results); } //------------------------------------------------------------------------------------------------------- function nodePage($index, $node, $page, $atts){ $q=array('BrowseNode'=>$node, 'ItemPage'=>$page, 'Operation'=>'ItemSearch', 'SearchIndex'=>$index, 'ResponseGroup'=>'Large,Offers,VariationSummary'); $request=signed($q); if (isset($_GET['dev'])){$results.='

For development test XML [nodePage]

' ;} $response = @file_get_contents($request); if(!$response){ $results.='
Amazon Error.
'; return($results); } $parsed_xml = simplexml_load_string($response); $results.=searchDetails($parsed_xml, $index, $atts); return($results); } //------------------------------------------------------------------------------------------------------ function nodeBrowse($index, $node){ $q['node']=$node; $q['idx']=$index; $q['svc']='tree'; $param=http_build_query($q); $request=signed($param); if (isset($_GET['dev'])){$results.='

For development test XML [nodeBrowse]

' ;} $response = @file_get_contents($request); if(!$response){ $results.='
Amazon Error.
'; return($results); } $parsed_xml = simplexml_load_string($response); return(makeNodeResults($parsed_xml, $index)); } //echo nodeBrowse('Books', '1000'); //------------------------------------------------------------------------------------------------------ function makeNodeResults($parsed_xml, $SearchIndex){ $myNode = $parsed_xml->BrowseNodes->BrowseNode; $topic=$myNode->Name; //print_r($myNode); $nodeTree= '

'.$topic.'

'; if(isset($myNode->Children->BrowseNode)){ $nodeTree.= ''; } return($nodeTree); } //------------------------------------------------------------------------------------------------------- function pageNumbers($p, $t){ $pg=(int)$p; $prevQuery['ItemPage']=$pg-1; $nextQuery['ItemPage']=$pg+1; if(isset($_GET)){ $nextQuery=array_merge($_GET, $nextQuery); $prevQuery=array_merge($_GET, $prevQuery); } $folio='
'; if($p>1){ $folio.='  '; } $folio.='Page '.$p.'  '; if($t==1){ $folio.='of  '.$t.' '; } if($t>1){ $folio.=''; } $folio.='
'; return($folio); } //------------------------------------------------------------------------------------------------------- function searchDetails($parsed_xml, $SearchIndex, $atts){ if(!$parsed_xml){return 'Amazon Error';} $searchpage=getSearchpage(); //establish parameters $aea_option=get_option('aeaAffiliateEaselAdminOptions'); extract($aea_option); //defaults extract($atts); //shortcodes will overwrite aea defaults if($only=='image'){ //prevents all data but images form appearing $show_title = ''; $show_byline = ''; $show_ratings = ''; $show_related = ''; $show_versions = ''; $show_content = ''; $show_list = ''; $show_az = ''; $show_azn = ''; $show_azu = ''; $show_azr = ''; $show_azc = ''; $kindle = ''; $mp3 = ''; } if($_GET['item']){ //changes parameters if this is a detail page $show_title = $show_title_d; $show_image = $show_image_d; $show_byline = $show_byline_d; $show_ratings = $show_ratings_d; $show_related = $show_related_d; $show_versions = $show_versions_d; $show_content = $show_content_d; $show_list = $show_list_d; $float = $float_d; $kindle = $show_kindle; //this prevents kindle preview from showing in lists $mp3 = $show_mp3; //this prevents mp3 preview from showing in lists } if($parsed_xml->Items->Request->Errors){ $error=$parsed_xml->Items->Request->Errors->Error->Message; $azEaselResults.=''.$error.''; } $numOfItems =count($parsed_xml->Items->Item); $totalPages = $parsed_xml->Items->TotalPages; $CartId = $_GET['CartId']; $HMAC = urlencode($_GET['HMAC']); $args=$parsed_xml->OperationRequest->Arguments[0]; foreach($args as $arg){ if($arg->attributes()->Name == 'AssociateTag'){ $tag=$arg->attributes()->Value; } if($arg->attributes()->Name == 'ItemPage'){ $pageNo=$arg->attributes()->Value; } } if($aea_blank){$target='target="_blank" ';} if($link_type == 'nofollow'){$rel='rel="nofollow" ';} if($pageNo && $show_page_top){ $azEaselResults.=pageNumbers($pageNo, $totalPages); } if($numOfItems>0){ foreach($parsed_xml->Items->Item as $current){ $asin = $current->ASIN; if($show_title){ $title=$current->ItemAttributes->Title; $htmlTitle=htmlspecialchars($title, ENT_QUOTES); } switch ($show_image) { case 'small': $imgSrc=$current->SmallImage->URL; $imgH=$current->SmallImage->Height; $imgW=$current->SmallImage->Width; break; case 'medium': $imgSrc=$current->MediumImage->URL; $imgH=$current->MediumImage->Height; $imgW=$current->MediumImage->Width; break; case 'large': $imgSrc=$current->LargeImage->URL; $imgH=$current->LargeImage->Height; $imgW=$current->LargeImage->Width; break; } $azURL=$current->DetailPageURL; $creators=@getCreators($current); if($show_versions){ $versions=@getVersions($current, $tag, $rel.$target); } if($show_related){ $similar=@getSimilar($current, $tag, $rel.$target); } if($show_list){ $listPrice=$current->ItemAttributes->ListPrice->FormattedPrice; } if($show_az){ $azPrice=$current->Offers->Offer->OfferListing->Price->FormattedPrice; if(!$current->Offers->Offer){ $azPrice=$current->VariationSummary->LowestPrice->FormattedPrice; } } if(stristr($creators, 'kindle')){ $azPrice='See Kindle Price'; $kindlePreview='true'; } if(stristr($creators, 'MP3 Download')){ $mp3Preview='true'; } if($show_azn){ $aznPrice=$current->OfferSummary->LowestNewPrice->FormattedPrice; } if($show_azu){ $azuPrice=$current->OfferSummary->LowestUsedPrice->FormattedPrice; } if($show_azr){ $azrPrice=$current->OfferSummary->LowestRefurbishedPrice->FormattedPrice; } if($show_azc){ $azcPrice=$current->OfferSummary->LowestCollectiblePrice->FormattedPrice; } if($show_content && $current->EditorialReviews->EditorialReview){ $content=''; //reset foreach($current->EditorialReviews->EditorialReview as $reviews){ $content.='

'.$reviews->Source.'

'; $content.=$reviews->Content.'
'; if ($content && $show_content =='excerpt') { $content=strip_tags($content, '
'); $content=trimPost($content); $content.='... Read more'; } } } if($show_ratings && $current->CustomerReviews->IFrameURL){ $ratings=$current->CustomerReviews->IFrameURL; settype($ratings, 'string'); $ratings=htmlentities($ratings); } //if(isset($current->Offers)){ //only show items for which there is an offer $azEaselResults.='
'; if($show_title){ $azEaselResults.='<'.$show_title.' style="padding:1em 0 .2em; margin:0;">'; if(isset($searchpage)){ $azEaselResults.=''.$htmlTitle.'' ; }else{ $azEaselResults.=''.$htmlTitle.'' ; } $azEaselResults.=''; } if($show_byline){ $azEaselResults.='
'.$creators.'
'; unset($creators); } if(isset($imgSrc)){ if($float){$float=' fl';} $azEaselResults.=''; $azEaselResults.=''.$htmlTitle.''; } if($imgW && $float){$ulm=' style="margin-left:'.($imgW+30).'px;"'; } $azEaselResults.=''; if($kindlePreview && $kindle){ $azEaselResults.="

Kindle Preview

"; } if($mp3Preview && $mp3){ $azEaselResults.=""; } if(isset($content)){ $azEaselResults.='
'.$content.'
'; unset($content); } if(isset($ratings)){ $azEaselResults.=''; } if(isset($versions)){ $azEaselResults.='

Other versions

'.$versions.'
'; unset($versions); } if(isset($similar)){ $azEaselResults.='

Related items

'.$similar.'
'; unset($similar); } //} //if(isset($current->Offers)) $azEaselResults.='
'; } if($pageNo && $show_page_bot){ $azEaselResults.=pageNumbers($pageNo, $totalPages); } $azEaselResults= '
'.$azEaselResults.'
'; //to allow specific styles } return $azEaselResults; } //------------------------------------------------------------------------------------------------------- function getSearchpage(){ $easel_atts=get_option('widget_easelwidget'); foreach($easel_atts as $att){ if(is_array($att) && array_key_exists('searchpage', $att)){$searchpage=$att['searchpage'];} //may be multiple, last one is fine. } return $searchpage; } //------------------------------------------------------------------------------------------------------- function trimPost($post){ $str1=strip_tags($post); //trims the text to the nearest length $maxL at last space $end = strrpos(substr($str1, 0, 512), "."); if($end){ $newStr = substr($str1, 0, $end+1); }else{ $newStr = substr($str1, 0, 512); } return $newStr; } //------------------------------------------------------------------------------------------------------- function getCreators($current){ foreach($current->ItemAttributes->AudienceRating as $attribute){ if(isset($creators)){$creators.=", ";} $creators.=$attribute; } foreach($current->ItemAttributes->HardwarePlatform as $attribute){ if(isset($creators)){$creators.=", ";} $creators.=$attribute; } foreach($current->ItemAttributes->Binding as $attribute){ if(isset($creators)){$creators.=", ";} $creators.=$attribute; } foreach($current->ItemAttributes->Actor as $attribute){ if(isset($creators)){$creators.=", ";} $creators.=$attribute; } foreach($current->ItemAttributes->Author as $attribute){ if(isset($creators)){$creators.=", ";} $creators.=$attribute; } foreach($current->ItemAttributes->Director as $attribute){ if(isset($creators)){$creators.=", ";} $creators.=$attribute; } foreach($current->ItemAttributes->Artist as $attribute){ if(isset($creators)){$creators.=", ";} $creators.=$attribute; } foreach($current->ItemAttributes->Creator as $attribute){ if(isset($creators)){$creators.=", ";} $creators.=$attribute; } $creators=htmlspecialchars($creators, ENT_QUOTES); return($creators); } //------------------ function getLinkOptions(){ $aea_option=get_option('aeaAffiliateEaselAdminOptions'); if($aea_option['aea_blank']){$options.='target="_blank" ';} if($aea_option['link_type'] == 'nofollow'){$options.='rel="nofollow" ';} return($options); } function getVersions($current, $tag, $opt){ $searchpage=getSearchpage(); foreach($current->AlternateVersions->AlternateVersion as $version){ if(isset($versions)){$versions.="
";} $htmlTitle=htmlspecialchars($version->Title, ENT_QUOTES); if(isset($searchpage)){ $versions.=''.$htmlTitle.', '.$version->Binding.'' ; }else{ $versions.=''.$htmlTitle.', '.$version->Binding.'' ; } } return($versions); } function getSimilar($current, $tag, $opt){ $searchpage=getSearchpage(); foreach($current->SimilarProducts->SimilarProduct as $product){ if(isset($products)){$products.="
";} $htmlTitle=htmlspecialchars($product->Title, ENT_QUOTES); if(isset($searchpage)){ $products.=''.$htmlTitle.', '.$product->Binding.'' ; }else{ $products.=''.$htmlTitle.', '.$product->Binding.'' ; } //$products.=''.$product->Title.'' ; } return($products); } } //End Class aeaAffiliateEasel ?>