/[drupal]/contributions/modules/amazontools/amazon.module
ViewVC logotype

Diff of /contributions/modules/amazontools/amazon.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.64, Thu Aug 21 00:37:24 2008 UTC revision 1.65, Wed Sep 17 20:36:04 2008 UTC
# Line 378  function amazon_form_alter($form_id, &$f Line 378  function amazon_form_alter($form_id, &$f
378          '#size' => 20,          '#size' => 20,
379          '#maxlength' => 110,          '#maxlength' => 110,
380          '#default_value' => $node->asin,          '#default_value' => $node->asin,
381          '#description' => t('Enter a comma delimited list of up to 10 ASINs for the related books.'),          '#description' => t("Enter a comma delimited list of up to 10 ASINs or ISBN-10's for the related books."),
382          '#weight' => 10,          '#weight' => 10,
383          '#valid' => 'asin',          '#valid' => 'asin',
384        );        );
# Line 678  function amazon_nodeapi(&$node, $op, $te Line 678  function amazon_nodeapi(&$node, $op, $te
678            $amazondata = $node->amazonnode_data;            $amazondata = $node->amazonnode_data;
679          }          }
680          if ($amazondata) {          if ($amazondata) {
681                                          $related_links = theme('amazon_related_links', $amazondata);                                          $related_links = theme('amazon_related_link', $amazondata);
682            $node->content['related_links'] = array(            $node->content['related_links'] = array(
683                                                  '#weight' => 5,                                                  '#weight' => 5,
684              '#value' => $related_links              '#value' => $related_links
# Line 1059  function _amazon_search_format_item($ama Line 1059  function _amazon_search_format_item($ama
1059      }      }
1060    }    }
1061    // end of special case    // end of special case
1062    $output .= '<strong>' . t('asin') . ":</strong>&nbsp;&nbsp;$amazonitem->asin <br />";    $output .= '<strong>' . t('ASIN or ISBN-10') . ":</strong>&nbsp;&nbsp;$amazonitem->asin <br />";
1063    if ($amazonitem->binding) {    if ($amazonitem->binding) {
1064      $output .= '<strong>' . t('binding') . ":</strong> $amazonitem->binding <br />";      $output .= '<strong>' . t('binding') . ":</strong> $amazonitem->binding <br />";
1065    }    }
# Line 1103  function _amazon_import_format_item($nod Line 1103  function _amazon_import_format_item($nod
1103      $datacell .= "<img src=\"$node->smallimageurl\" height=\"$node->smallimageheight\" width=\"$node->smallimagewidth\" alt=\"cover of $node->title\" />";      $datacell .= "<img src=\"$node->smallimageurl\" height=\"$node->smallimageheight\" width=\"$node->smallimagewidth\" alt=\"cover of $node->title\" />";
1104    }    }
1105    else {    else {
1106      $datacell .= "<img src=\"/$module_dir/images/missings.gif\" height=\"100\" width=\"102\" alt=\"no image\" />";      $datacell .= "<img src=\"/$module_dir/images/missings.gif\" height=\"75\" width=\"56\" alt=\"no image\" />";
1107    }    }
1108    $datacell .= '</td>';    $datacell .= '</td>';
1109    $datacell .= "<td>";    $datacell .= "<td>";
# Line 1116  function _amazon_import_format_item($nod Line 1116  function _amazon_import_format_item($nod
1116      $datacell .= 'author: ' . implode(",",$node->author) . '<br />';      $datacell .= 'author: ' . implode(",",$node->author) . '<br />';
1117    }    }
1118    if ($node->asin) {    if ($node->asin) {
1119      $datacell .= 'asin: ' . $node->asin . '<br />';      $datacell .= 'ASIN or ISBN-10: ' . $node->asin . '<br />';
1120    }    }
1121    if ($node->binding) {    if ($node->binding) {
1122      $datacell .= "binding: $node->binding <br />";      $datacell .= "binding: $node->binding <br />";
# Line 1460  function theme_amazon_node($node) { Line 1460  function theme_amazon_node($node) {
1460    }    }
1461    
1462    if ($node->asin) {    if ($node->asin) {
1463      $output .= 'asin: ' . $node->asin . '<br />';      $output .= 'ASIN or ISBN-10: ' . $node->asin . '<br />';
1464    }    }
1465    if ($node->binding) {    if ($node->binding) {
1466      $output .= "binding: $node->binding <br />";      $output .= "binding: $node->binding <br />";
# Line 1477  function theme_amazon_node($node) { Line 1477  function theme_amazon_node($node) {
1477    return $output;    return $output;
1478  }  }
1479    
1480  function theme_amazon_related_links($amazondata) {  function theme_amazon_related_link($amazondata) {
1481          $oddeven = 1;          $oddeven = 1;
1482          $output = '<table class="amazontools_related">';          $output = '<table class="amazontools_related">';
1483            $output .= '<thead>';
1484            $output .= '    <tr>';
1485            $output .= '            <th colspan="2">';
1486            $output .= '                    Click book to purchase';
1487            $output .= '            </th>';
1488            $output .= '    </tr>';
1489            $output .= '</thead>';
1490            $output .= '<tbody>';
1491          foreach($amazondata as $amazon_data) {          foreach($amazondata as $amazon_data) {
1492                  if ($oddeven == 1) {                  if ($oddeven == 1) {
1493                          $output .= "<tr class='odd'>";                          $output .= "<tr class='odd'>";
# Line 1489  function theme_amazon_related_links($ama Line 1497  function theme_amazon_related_links($ama
1497                          $output .= "<tr class='even'>";                          $output .= "<tr class='even'>";
1498                          $oddeven = 1;                          $oddeven = 1;
1499                          }                          }
1500          $output .= theme('amazon_related_link', $amazon_data);          $output .= theme('amazon_related_link_book', $amazon_data);
1501                  $output .= "</tr>";                  $output .= "</tr>";
1502          }          }
1503            $output .= '</tbody>';
1504    $output .= '</table>';    $output .= '</table>';
1505          return $output;          return $output;
1506  }  }
1507    
1508  function theme_amazon_related_link($node) {  function theme_amazon_related_link_book($node) {
1509    $output = '';    $output = '';
1510    $output .= '<td><a href="'.$node->detailpageurl.'" target="_blank">';    $output .= '<td><a href="'.$node->detailpageurl.'" target="_blank">';
1511          $module_dir = drupal_get_path('module', 'amazon');          $module_dir = drupal_get_path('module', 'amazon');
# Line 1504  function theme_amazon_related_link($node Line 1513  function theme_amazon_related_link($node
1513      $output .= "<img src=\"$node->smallimageurl\" height=\"$node->smallimageheight\" width=\"$node->smallimagewidth\" alt=\"cover of $node->title\" />";      $output .= "<img src=\"$node->smallimageurl\" height=\"$node->smallimageheight\" width=\"$node->smallimagewidth\" alt=\"cover of $node->title\" />";
1514    }    }
1515    else {    else {
1516      $output .= "<img src=\"$module_dir/images/missings.gif\" height=\"100\" width=\"102\" alt=\"no image\" />";      $output .= "<img src=\"/$module_dir/images/missings.gif\" height=\"75\" width=\"56\" alt=\"no image\" />";
1517    }    }
1518    $output .= '</a></td>';    $output .= '</a></td>';
1519    $output .= "<td>";    $output .= "<td>";
# Line 1517  function theme_amazon_related_link($node Line 1526  function theme_amazon_related_link($node
1526      $output .= 'author: ' . implode(",",$node->author) . '<br />';      $output .= 'author: ' . implode(",",$node->author) . '<br />';
1527    }    }
1528    if ($node->asin) {    if ($node->asin) {
1529      $output .= 'asin: ' . $node->asin . '<br />';      $output .= 'ASIN or ISBN-10: ' . $node->asin . '<br />';
1530    }    }
1531    $output .= '</td>';    $output .= '</td>';
1532    return $output;    return $output;

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

  ViewVC Help
Powered by ViewVC 1.1.2