Index: uc_affiliate2.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_affiliate2/uc_affiliate2.module,v
retrieving revision 1.18.2.35
diff -u -p -r1.18.2.35 uc_affiliate2.module
--- uc_affiliate2.module	6 May 2009 19:11:39 -0000	1.18.2.35
+++ uc_affiliate2.module	22 Jul 2009 22:12:48 -0000
@@ -67,9 +67,9 @@ function uc_affiliate2_menu() {
   $items['affiliate'] = array(
     'page callback' => 'uc_affiliate2_click',
     'access arguments' => array('access content'),
+    'callback arguments' => array(arg(2)),
     'type' => MENU_CALLBACK
   );
-
   $items['user/%user/affiliate'] = array(
     'title' => 'Affiliate Center',
     'page callback' => 'uc_affiliate2_dashboard',
@@ -383,7 +383,8 @@ function _uc_affiliate2_product_form_sub
 function _uc_affiliate2_display_banners() {
   global $base_url, $user;
 
-  $banners = variable_get('affiliate_banner_template', '');
+  $banners = variable_get('affiliate_banner_template_1_banner', '');
+  $paths = variable_get('affiliate_banner_template_1_path', '');
 
   $header[] = array('field' => 'banner_preview', 'data' => t('Banner Preview'));
   $header[] = array('field' => 'banner_code', 'data' => t('Banner Code'));
@@ -397,7 +398,7 @@ function _uc_affiliate2_display_banners(
 
   foreach ($banners as $banner) {
     $banner = '<'. $banner;
-    $banner_link = l($banner, 'affiliate/'. $user->name, array('query' => NULL, 'fragment' => NULL, 'absolute' => TRUE, 'html' => TRUE));
+    $banner_link = l($banner, 'affiliate/'. $user->name .'/'. $paths, array('query' => NULL, 'fragment' => NULL, 'absolute' => TRUE, 'html' => TRUE));
 
     $line = array();
     $line[] = $banner;
@@ -497,11 +498,21 @@ function _uc_affiliate2_get_products($mo
  * Define the admin settings form
  */
 function uc_affiliate2_admin_settings() {
-  $form['affiliate_banner_template'] = array(
-    '#type' => 'textarea',
-    '#title' => t('Affiliate Banner Templates'),
+  $form['affiliate_banner_1'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Affiliate Banner Template 1'),
+  );
+  $form['affiliate_banner_1']['affiliate_banner_template_1_banner'] = array(
+    '#type' => 'textfield',
+    '#title' => t('IMG Tag'),
     '#description' => t('The IMG tag(s) around which the url of the affiliate is wrapped around. Insert as many as you want.'),
-    '#default_value' => variable_get('affiliate_banner_template', ''),
+    '#default_value' => variable_get('affiliate_banner_template_1_banner', ''),
+  );
+  $form['affiliate_banner_1']['affiliate_banner_template_1_path'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Redirect Path'),
+    '#description' => t('The path on which the end user will end up after clicking the banner.'),
+    '#default_value' => variable_get('affiliate_banner_template_1_path', ''),
   );
   $form['affiliate_text_link_template'] = array(
     '#type' => 'textfield',
