After installing the latest updates of the Amazontools, the formatting of the Amazontools blocks broke at my installation; the product images are now no longer centered, but aligned to the left; the product title is no longer linked to anything, an below appears some style tags (e.g. Bändeclass="amazontools_review_link", class="amazontools_review_link") which most probably are not supposed to be seen by the user. This looks pretty ugly and qute broken.

Is there some way to configure this behaviour or at least to get rid of the style tags below the products?

Regards, -asb

Comments

Prometheus6’s picture

StatusFileSize
new951 bytes

Typo in theme_amazon_block()...sorry about that.

I just committed the attached patch. Your images still aren't centered because in the previous commit I replaced the hard-coded center attribute with a class (<div style="text-align: center;"> became <div class="amazontools_block">)

Here's the block formatting function I just replaced if you prefer that.

function theme_amazon_block($selected_book) {
  if (isset($selected_book->nid)) {
    $is_review = TRUE;
  	$review_url = url("node/$selected_book->nid");
  }
  $module_dir = dirname(drupal_get_filename('module', 'amazon'));
  $book_image = $selected_book->mediumimageurl ? 
    $selected_book->mediumimageurl : "$module_dir/images/missingm.gif";
  $blockcontent = '<div style="text-align: center;">'; // this was changed
  if ($is_review) {
    $blockcontent .= "<a href=\"$review_url\">";
    $blockcontent .= "<img src=\"$book_image\" height=\"$selected_book->mediumimageheight\" 
      width=\"$selected_book->mediumimagewidth\" alt=\"cover of $selected_book->title\" /><br />";
    $blockcontent .= '</a>';
    $blockcontent .= "<a href=\"$selected_book->detailpageurl\" target=\"_blank\">";
    $blockcontent .= $selected_book->title;
    $blockcontent .= '</a>';
    $blockcontent .= "<a href=\"$review_url\">";
    $blockcontent .= t('Read the review');
    $blockcontent .= '</a>';
  }
  else {
    $blockcontent .= "<a href=\"$selected_book->detailpageurl\" target=\"_blank\">";
    $blockcontent .= "<img src=\"$book_image\" height=\"$selected_book->mediumimageheight\" 
      width=\"$selected_book->mediumimagewidth\" alt=\"cover of $selected_book->title\" /><br />";
    $blockcontent .= '</a>';
    $blockcontent .= "<a href=\"$selected_book->detailpageurl\" target=\"_blank\">";
    $blockcontent .= $selected_book->title;
    $blockcontent .= '</a>';

  }
  if ($selected_book->rating) {
    $module_dir = dirname(drupal_get_filename('module', 'amazon'));
    $output .= "rating: <img src=\"$module_dir/images/rating$selected_book->rating.gif\" 
    alt=\"$selected_book->rating\" /><br />";
  }
  $blockcontent .= '</div>';
  return $blockcontent;
}
asb’s picture

> Typo in theme_amazon_block()...sorry about that.

Was this fixed in the version from 2006-10-26? I still get
class="amazontools_review_link" below the product images in the blocks "product recommendation" and "product review".

Regards, -asb

Prometheus6’s picture

StatusFileSize
new731 bytes

Was this fixed in the version from 2006-10-26?

Idiot that I am, I was working on the HEAD branch. I just committed the proper fix.

Prometheus6’s picture

Status: Active » Closed (fixed)