? amazontools.txt
Index: amazon.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/amazontools/amazon.module,v
retrieving revision 1.63
diff -u -p -r1.63 amazon.module
--- amazon.module	25 Jan 2007 00:13:16 -0000	1.63
+++ amazon.module	25 Jun 2007 18:22:05 -0000
@@ -710,6 +710,12 @@ function amazon_settings() {
     '#width' => 60,
     '#height' => 5,
   );
+  $form['amazon_link_functionality'] = array(
+    '#title' => t('Link Functionality'),
+    '#type' => 'radios',
+    '#options' => array(t('Images link back to Amazon'),t('Disable image links'),t('Images link to product node')),
+    '#default_value' => variable_get('amazon_link_functionality', 0),
+  );
   return system_settings_form($form);
 }
 
@@ -1406,14 +1412,26 @@ function theme_amazon_node($node) {
   $output = '';
   $output .= '<table class="amazontools_table">';
   $output .= '<tr>';
-  $output .= "<td><a href=\"$node->detailpageurl\" target=\"_blank\">";
-  if ($node->mediumimageurl) {
-    $output .= "<img src=\"$node->mediumimageurl\" height=\"$node->mediumimageheight\" width=\"$node->mediumimagewidth\" alt=\"cover of $node->title\" />";
+  $output .= "<td>";
+  	  if ($node->mediumimageurl) {
+    $image .= "<img src=\"$node->mediumimageurl\" height=\"$node->mediumimageheight\" width=\"$node->mediumimagewidth\" alt=\"cover of $node->title\" />";
   }
   else {
-    $output .= "<img src=\"$module_dir/images/missingm.gif\" height=\"150\" width=\"100\" alt=\"no image\" />";
+    $image .= "<img src=\"$module_dir/images/missingm.gif\" height=\"150\" width=\"100\" alt=\"no image\" />";
+  }
+  $output .= "<td>";
+  switch(variable_get('amazon_link_functionality',0)) {
+  	case 0:
+  		$output .= l($image,$node->detailpageurl,array('target'=>'_blank'),null,null,false,true);
+  		break;
+  	case 1:
+  		$output .= $image;
+  		break;
+  	case 2:
+  		$output .= l($image,'node/'.$node->nid,null,null,null,false,true);
+  		break;
   }
-  $output .= "</a></td><td>";
+  $output .= "</td><td>";
   if ($node->type == 'amazon') {
     if ($node->detailpageurl) {
       $output .= "<a href=\"$node->detailpageurl\" target=\"_blank\">";
