| 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 |
); |
); |
| 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 |
| 1059 |
} |
} |
| 1060 |
} |
} |
| 1061 |
// end of special case |
// end of special case |
| 1062 |
$output .= '<strong>' . t('asin') . ":</strong> $amazonitem->asin <br />"; |
$output .= '<strong>' . t('ASIN or ISBN-10') . ":</strong> $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 |
} |
} |
| 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>"; |
| 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 />"; |
| 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 />"; |
| 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'>"; |
| 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'); |
| 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>"; |
| 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; |