? 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 .= ''; $output .= ''; - $output .= "
detailpageurl\" target=\"_blank\">"; - if ($node->mediumimageurl) { - $output .= "mediumimageurl\" height=\"$node->mediumimageheight\" width=\"$node->mediumimagewidth\" alt=\"cover of $node->title\" />"; + $output .= ""; + if ($node->mediumimageurl) { + $image .= "mediumimageurl\" height=\"$node->mediumimageheight\" width=\"$node->mediumimagewidth\" alt=\"cover of $node->title\" />"; } else { - $output .= "\"no"; + $image .= "\"no"; + } + $output .= ""; + 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 .= ""; + $output .= ""; if ($node->type == 'amazon') { if ($node->detailpageurl) { $output .= "detailpageurl\" target=\"_blank\">";