Index: affiliate.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/affiliate/Attic/affiliate.info,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 affiliate.info
--- affiliate.info	12 Aug 2007 16:58:46 -0000	1.1.2.1
+++ affiliate.info	20 Dec 2008 20:27:23 -0000
@@ -1,5 +1,4 @@
 ; $Id: affiliate.info,v 1.1.2.1 2007/08/12 16:58:46 thierrygd Exp $
 name = Affiliate
 description = Allows site owners to issue affiliate links to their partners
-
-
+core = 6.x
\ No newline at end of file
Index: affiliate.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/affiliate/affiliate.install,v
retrieving revision 1.1.4.1
diff -u -r1.1.4.1 affiliate.install
--- affiliate.install	12 Aug 2007 16:57:55 -0000	1.1.4.1
+++ affiliate.install	20 Dec 2008 23:29:29 -0000
@@ -4,48 +4,45 @@
 // Copyright 2007 Thierry GUEGAN http://www.arvoriad.com 
 
 function affiliate_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      // which users are affiliates
-      db_query("CREATE TABLE {affiliate_details} (".
-	       "aid int unsigned UNIQUE NOT NULL, ".
-	       "enabled int(2) NOT NULL default '0', ".
-	       "PRIMARY KEY (aid) ".
-	       ") /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      
-      // which affiliate referred a user to the site
-      db_query("CREATE TABLE {affiliate_users} ( ".
-	       "aid int unsigned NOT NULL, ".
-	       "uid int unsigned UNIQUE NOT NULL, ".
-	       // not normal form!
-	       "keyword varchar(255) NOT NULL default '', ".
-	       "PRIMARY KEY (aid,uid) ".
-	       ") /*!40100 DEFAULT CHARACTER SET utf8 */;");
-
-      // where we count clicks, signups, etc.
-      db_query("CREATE TABLE {affiliate_counts} ( ".
-	       "aid int unsigned NOT NULL, ".
-	       "time int unsigned NOT NULL, ".
-	       // not normal form!
-	       "keyword varchar(255) NOT NULL default '', ".
-	       "clicks int unsigned NOT NULL, ".
-	       "users int NOT NULL, ".
-	       "PRIMARY KEY (aid, time, keyword) ".
-	       ") /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      break;
-   
-    case 'pgsql':
-      break;
-  }
+  // Create tables.
+  drupal_install_schema('affiliate');
 }
 
 /**
 * Implementation of hook_uninstall().
 */
 function affiliate_uninstall() {
-  db_query('DROP TABLE {affiliate_details}');
-  db_query('DROP TABLE {affiliate_users}');  
-  db_query('DROP TABLE {affiliate_counts}'); 
+  // Remove tables.
+  drupal_uninstall_schema('affiliate');
+
 } 
 
+function affiliate_schema() {
+  $schema['affiliate_users'] = array(
+    'fields' => array(
+      'aid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
+      'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
+      'keyword' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '')),
+    'primary key' => array('aid', 'uid'),
+    'unique keys' => array(
+      'uid' => array('uid')),
+  );
+  $schema['affiliate_details'] = array(
+    'fields' => array(
+      'aid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
+      'enabled' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '2')),
+    'primary key' => array('aid'),
+    'unique keys' => array(
+       'aid' => array('aid')),
+  );
+  $schema['affiliate_counts'] = array(
+    'fields' => array(
+         'aid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
+         'time' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
+         'keyword' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
+         'clicks' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
+         'users' => array('type' => 'int', 'not null' => TRUE, 'disp-width' => '11')),
+    'primary key' => array('aid', 'time', 'keyword'),
+  );
+  return $schema;
+}
\ No newline at end of file
Index: affiliate.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/affiliate/affiliate.module,v
retrieving revision 1.7.4.1
diff -u -r1.7.4.1 affiliate.module
--- affiliate.module	12 Aug 2007 16:58:10 -0000	1.7.4.1
+++ affiliate.module	20 Dec 2008 23:41:34 -0000
@@ -1,17 +1,29 @@
 <?php
 // $Id: affiliate.module,v 1.7.4.1 2007/08/12 16:58:10 thierrygd Exp $
 
+/* TODO Implement the hook_theme registry. Combine all theme registry entries
+   into one hook_theme function in each corresponding module file.
+function affiliate_theme() {
+  return array(
+  );
+}; */
+
+
+/* TODO
+   An argument for replacements has been added to format_plural(),
+   escaping and/or theming the values just as done with t().*/
+
 /**
  * Implementation of hook_help().
  */
-function affiliate_help($section='') {
+function affiliate_help($path, $arg) {
   switch ($section) {
   case 'admin/modules#description':
     return t('Tracks source of visitors.');
     break;
   case 'admin/modules/affiliate':
     return t('Find out which users have registered under which '.
-	     'affiliates by clicking on the affiliate name.');
+      'affiliates by clicking on the affiliate name.');
     break;
   }
 }
@@ -23,29 +35,30 @@
 /**
  * Implementation of hook_menu().
  */
-function affiliate_menu($may_cache) {
-    
-    affiliate_record();
-
-    if ($may_cache) {
-      $access = user_access('administer affiliates');
-      $items[] = array('path' => 'admin/settings/affiliate',
-		       'title' => t('Affiliates'),
-		       'description' => t('Track source of visitors'),		      		       
-		       'access' => $access,
-		       'callback' => 'affiliate_admin',
-		       'type' => MENU_NORMAL_ITEM);
-      $items[] = array('path' => 'admin/settings/affiliate/users',
-		       'title' => t('Users by Affiliate'),
-		       'access' => $access,
-		       'callback' => 'affiliate_admin_users',
-		       'type' => MENU_DEFAULT_LOCAL_TASK);
-    }
-    
+function affiliate_menu() {
+      $access = array('administer affiliates');
+      $items['admin/settings/affiliate'] = array(
+        'title' => 'Affiliates',
+        'description' => 'Track source of visitors',
+        'access arguments' => $access,
+        'page callback' => 'affiliate_admin',
+        'type' => MENU_NORMAL_ITEM);
+      $items['admin/settings/affiliate/users'] = array(
+        'title' => 'Users by Affiliate',
+        'access arguments' => $access,
+        'page callback' => 'affiliate_admin_users',
+        'type' => MENU_DEFAULT_LOCAL_TASK);
     return $items;
 }
 
 /**
+ * Implementation of hook_init().
+ */
+function affiliate_init() {
+  affiliate_record();
+}
+
+/**
  *  Return the current time rounded down to the most recent chunk
  *  (day).  I may make this configurable at some point.
  */
@@ -58,9 +71,9 @@
   $time = affiliate_current_time();
   
   db_query('UPDATE {affiliate_counts} '.
-	   'SET clicks=(clicks+%d), users=(users+%d) '.
-	   'WHERE aid=%d AND time=%d AND keyword="%s"',
-	   $clicks, $users, $aff, $time, $kw);
+  'SET clicks=(clicks+%d), users=(users+%d) '.
+  'WHERE aid=%d AND time=%d AND keyword="%s"',
+  $clicks, $users, $aff, $time, $kw);
 
   // If we affected 0 rows, this is the first entry for this
   // aid/time/keyword.  NOTE: There is a race condition here; on
@@ -70,9 +83,9 @@
 
   if (!db_affected_rows() && !$recurse) {
     $res = db_query('INSERT INTO {affiliate_counts} '.
-		    '(aid, time, keyword, clicks, users) '.
-		    'VALUES(%d, %d, "%s", %d, %d)',
-		    $aff, $time, $kw, $clicks, $users);
+    '(aid, time, keyword, clicks, users) '.
+    'VALUES(%d, %d, "%s", %d, %d)',
+    $aff, $time, $kw, $clicks, $users);
 
     // If we failed, the race condition occurred.  Try again, since
     // now the UPDATE should succeed.  Set $recurse to TRUE to prevent
@@ -94,7 +107,8 @@
   $aid = $_REQUEST['a'];
   $kw = $_REQUEST['k'];
   $res = db_query('SELECT aid FROM {affiliate_details} WHERE aid=%d', $aid);
-  if (db_num_rows($res) && !$user->affiliate) {
+  $res_count = db_result(db_query('SELECT COUNT(aid) FROM {affiliate_details} WHERE aid = %d', $aid));
+  if ($res_count && !$user->affiliate) {
     $_SESSION['affiliate'] = $aid;
     $_SESSION['affiliate_keyword'] = $kw;
     affiliate_add_count($aid, $kw, 1, 0);
@@ -117,72 +131,65 @@
 function affiliate_user($op, &$edit, &$user, $category = NULL) {
   switch ($op) {
   case 'insert':
-      $aff = $_SESSION['affiliate'];
-      $kw = $_SESSION['affiliate_keyword'];
-      if ($aff) {
-	db_query('INSERT INTO {affiliate_users} (aid, uid, keyword) '.
-		 "VALUES (%d, %d, '%s')", $aff, $user->uid, $kw);
-	affiliate_add_count($aff, $kw, 0, 1);
-	watchdog('user', 
-		 t('User %name referred by user id %affiliate, keyword %kw.',
-		   array('%name' => theme('username', $user),
-			 '%affiliate' => theme('placeholder', $aff),
-			 '%kw' => theme('placeholder', $kw))));
-      }
-      break;
+    $aff = $_SESSION['affiliate'];
+    $kw = $_SESSION['affiliate_keyword'];
+    if ($aff) {
+      db_query('INSERT INTO {affiliate_users} (aid, uid, keyword) '.
+      "VALUES (%d, %d, '%s')", $aff, $user->uid, $kw);
+      affiliate_add_count($aff, $kw, 0, 1);
+      watchdog('user', 
+      t('User %name referred by user id %affiliate, keyword %kw.',
+        array('%name' => theme('username', $user),
+        '%affiliate' => theme('placeholder', $aff),
+        '%kw' => theme('placeholder', $kw))));
+    }
+  break;
       
   case 'update':
     // access check is probably unnecessary due to Form API
     if (user_access('administer affiliates')) {
       $aff = $edit['affiliate_referrer'];
       if (is_numeric($aff) && $aff != $user->affiliate) {
-	db_query('DELETE FROM {affiliate_users} WHERE uid=%d', $user->uid);
-	if ($user->affiliate > 0) {
-	  affiliate_add_count($user->affiliate, $user->affiliate_keyword, 0, 
-			      -1);
-	}
-	if ($aff > 0) {
-	  db_query('INSERT INTO {affiliate_users} (aid,uid,keyword) '.
-		   "VALUES (%d, %d, '%s')", $aff, $user->uid, 'admin');
-	  affiliate_add_count($aff, 'admin', 0, 1);
-	}
-	watchdog('user', 
-		 t('User %name referrer changed to user id %affiliate.',
-		   array('%name' => theme('username', $user),
-			 '%affiliate' => theme('placeholder', $aff))));
-	$user->affiliate = $aff;
-      }
+        db_query('DELETE FROM {affiliate_users} WHERE uid=%d', $user->uid);
+        if ($user->affiliate > 0) {
+          affiliate_add_count($user->affiliate, $user->affiliate_keyword, 0, -1);
+        }
+        if ($aff > 0) {
+          db_query('INSERT INTO {affiliate_users} (aid,uid,keyword) '.
+          "VALUES (%d, %d, '%s')", $aff, $user->uid, 'admin');
+          affiliate_add_count($aff, 'admin', 0, 1);
+        }
+        watchdog('user', t('User %name referrer changed to user id %affiliate.', array('%name' => theme('username', $user), '%affiliate' => theme('placeholder', $aff))));
+      $user->affiliate = $aff;
+     }
 
       db_query('DELETE FROM {affiliate_details} WHERE aid=%d', $user->uid);
       // the enabled field is not used but may be some day
       if ($edit['affiliate_enabled']) {
-	db_query('INSERT INTO {affiliate_details} (aid, enabled) '.
-		 "VALUES (%d, %d)", $user->uid, $edit['affiliate_enabled']);
+        db_query('INSERT INTO {affiliate_details} (aid, enabled) '.
+        "VALUES (%d, %d)", $user->uid, $edit['affiliate_enabled']);
       }
     }
     break;
 
   case 'load':
-    $o = db_fetch_object(db_query('SELECT aid, keyword FROM {affiliate_users} '
-				  .'WHERE uid=%d', $user->uid));
+    $o = db_fetch_object(db_query('SELECT aid, keyword FROM {affiliate_users} WHERE uid=%d', $user->uid));
     $user->affiliate = $o->aid;
     $user->affiliate_keyword = $o->keyword;
-    $user->affiliate_details =
-      db_fetch_object(db_query('SELECT * FROM {affiliate_details} '.
-			       'WHERE aid=%d', $user->uid));
+    $user->affiliate_details = db_fetch_object(db_query('SELECT * FROM {affiliate_details} WHERE aid=%d', $user->uid));
     break;
 
   case 'view':
     if (user_access('administer affiliates')) {
       if ($user->affiliate) {
-	$sql = 'SELECT name, uid FROM {users} WHERE uid = %d';
-	$aff = db_fetch_object(db_query($sql, $user->affiliate));
-	$items[] = array('title' => t('Referred by'),
-			 'value' => l($aff->name, 
-				      "admin/settings/affiliate/users/".$aff->uid));
-      } else {
-	$items[] = array('title' => t('Referred by'),
-			 'value' => t('none'));
+        $sql = 'SELECT name, uid FROM {users} WHERE uid = %d';
+        $aff = db_fetch_object(db_query($sql, $user->affiliate));
+        $items[] = array('title' => t('Referred by'),
+          'value' => l($aff->name, "admin/settings/affiliate/users/". $aff->uid));
+      } 
+      else {
+        $items[] = array('title' => t('Referred by'),
+        'value' => t('none'));
       }
       return array('History' => $items);
     }
@@ -191,27 +198,28 @@
   case 'categories':
     if (user_access('administer affiliates')) {
       return array(array('name' => 'affiliate',
-			 'title' => 'Affiliate Details',
-			 'weight' => 4));
+        'title' => 'Affiliate Details',
+        'weight' => 4));
     }
     break;
 
   case 'form':
     if (user_access('administer affiliates')) {
       if ($category == 'account') {
-	$form['account']['affiliate_referrer'] = array
-	  ('#type' => 'select',
-	   '#title' => t('Referred by'),
-	   '#default_value' => $user->affiliate > 0 ? $user->affiliate : 0,
-	   '#options' => affiliate_get_affiliates(),
-	   '#description' => 'The Affiliate to credit for this user.',
-	   '#weight' => 1);
-      } else if ($category == 'affiliate') {
-	$form[$category]['affiliate_enabled'] = array
-	  ('#type' => 'radios',
-	   '#title' => t('Is as Affiliate?'),
-	   '#default_value' => $user->affiliate_details->enabled,
-	   '#options' => array(t('Disabled'), t('Enabled')));
+        $form['account']['affiliate_referrer'] = array
+          ('#type' => 'select',
+           '#title' => t('Referred by'),
+           '#default_value' => $user->affiliate > 0 ? $user->affiliate : 0,
+           '#options' => affiliate_get_affiliates(),
+           '#description' => 'The Affiliate to credit for this user.',
+           '#weight' => 1);
+      } 
+      else if ($category == 'affiliate') {
+        $form[$category]['affiliate_enabled'] = array
+          ('#type' => 'radios',
+           '#title' => t('Is as Affiliate?'),
+           '#default_value' => $user->affiliate_details->enabled,
+           '#options' => array(t('Disabled'), t('Enabled')));
       }
       return $form;
     }
@@ -223,9 +231,7 @@
  * Get affiliate ids and names.
  */
 function affiliate_get_affiliates() {
-  $result = db_query('SELECT u.uid, u.name '.
-		     'FROM {users} u, {affiliate_details} a '.
-		     'WHERE u.uid = a.aid');
+  $result = db_query('SELECT u.uid, u.name FROM {users} u, {affiliate_details} a WHERE u.uid = a.aid');
   $all[0] = '';
   while ($row = db_fetch_object($result)) {
     $all[$row->uid] = $row->name;
@@ -245,9 +251,7 @@
       array('data' => t('last access'), 'field' => 'access', 'sort' => 'desc'),
       array('data' => t('operations'))
       );
-  $sql = ('SELECT u.uid, u.name, u.status, u.access FROM {users} u '.
-	  'INNER JOIN {affiliate_users} a ON u.uid = a.uid '.
-	  'WHERE a.aid = %d');
+  $sql = ('SELECT u.uid, u.name, u.status, u.access FROM {users} u INNER JOIN {affiliate_users} a ON u.uid = a.uid WHERE a.aid = %d');
   $sql .= tablesort_sql($header);
   $result = pager_query($sql, 50, 0, NULL, $aid);
   $status = array(t('blocked'), t('active'));
@@ -267,8 +271,7 @@
     $rows[] = array(array('data' => $pager, 'colspan' => '4'));
   }
 
-  drupal_set_title(t('Users affiliated with %name', 
-		     array('%name' => $afname)));
+  drupal_set_title(t('Users affiliated with %name', array('%name' => $afname)));
   return theme('table', $header, $rows);
 }
 
@@ -300,23 +303,14 @@
   }
 
   if ($ec) {
-    $sql = ('SELECT ad.aid, sum(et.gross) as gross '.
-	    'FROM {affiliate_details} as ad, {affiliate_users} as au, '.
-	    '     {users} as u1, {ec_transaction} as et '.
-	    'WHERE ad.aid = au.aid AND au.uid = u1.uid AND u1.uid = et.uid '.
-	    '      AND et.payment_status = %d '.
-	    'GROUP BY ad.aid');
+    $sql = ('SELECT ad.aid, sum(et.gross) as gross FROM {affiliate_details} as ad, {affiliate_users} as au, {users} as u1, {ec_transaction} as et WHERE ad.aid = au.aid AND au.uid = u1.uid AND u1.uid = et.uid AND et.payment_status = %d GROUP BY ad.aid');
     $result = db_query($sql, payment_get_status_id('completed'));
     while ($row = db_fetch_object($result)) {
       $gross[$row->aid] = $row->gross;
     }
   }
-
-  $sql = ('SELECT ad.aid, ad.enabled, u1.name, '.
-	  '       count(au.uid) as referred '.
-	  'FROM {affiliate_details} as ad LEFT JOIN {users} as u1 on ad.aid = u1.uid '.	  
-	  'LEFT JOIN {affiliate_users} as au on ad.aid = au.aid '.
-	  'GROUP BY ad.aid');	  
+  
+  $sql = ('SELECT ad.aid, ad.enabled, u1.name, count(au.uid) as referred FROM {affiliate_details} as ad LEFT JOIN {users} as u1 on ad.aid = u1.uid LEFT JOIN {affiliate_users} as au on ad.aid = au.aid GROUP BY ad.aid');
   $count = 'SELECT COUNT(DISTINCT(aid)) FROM {affiliate_details}';
 
   $sql .= tablesort_sql($header);
@@ -324,20 +318,15 @@
   
   while ($row = db_fetch_object($result)) {
     $trow = array
-      (array('data' => l($row->aid, '', 
-			 array('title' => t('an affiliate formatted link')),
-			 "a=$row->aid")),
-       array('data' => l($row->name, "admin/settings/affiliate/users/$row->aid",        
-			 array('title' => 
-			       t('View users attached to this affiliate')))),
+      (array('data' => l($row->aid, '', array('title' => t('an affiliate formatted link')), "a=$row->aid")),
+       array('data' => l($row->name, "admin/settings/affiliate/users/$row->aid",
+       array('title' => t('View users attached to this affiliate')))),
        array('data' => is_null($clicks[$row->aid]) ? 0 : $clicks[$row->aid]),
        array('data' => $row->referred));
     if ($ec) {
-      $trow[] = array('data' => is_null($gross[$row->aid]) ? 0 : 
-		      $gross[$row->aid]);
+      $trow[] = array('data' => is_null($gross[$row->aid]) ? 0 : $gross[$row->aid]);
     }
-    $trow[] = array('data' => l(t('edit'), "user/$row->aid/edit/affiliate",
-				array(), drupal_get_destination()));
+    $trow[] = array('data' => l(t('edit'), "user/$row->aid/edit/affiliate", array('attributes' => array(), 'query' => drupal_get_destination())));
     $rows[] = $trow;
   }
   if (!$rows) {
@@ -352,8 +341,7 @@
   return $output;
 }
 
-function affiliate_edit_user_form()
-{
+function affiliate_edit_user_form() {
   $result = db_query('SELECT u.uid, u.name FROM {users} u ORDER BY u.name');
   while ($row = db_fetch_object($result)) {
     $all[$row->uid] = $row->name;
@@ -367,9 +355,8 @@
   return $form;  
 }
 
-function affiliate_edit_user_form_submit($form_id, $form_values) {
-  drupal_goto('user/'.$form_values['uid'].'/edit/affiliate',
-	      drupal_get_destination());
+function affiliate_edit_user_form_submit($form, &$form_state) {
+  drupal_goto('user/'. $form_state['values']['uid'] .'/edit/affiliate', drupal_get_destination());
 }
 
 /**
@@ -385,7 +372,7 @@
     $result = db_query($sql, $last);
     // build output and info about each affiliate
     while ($row = db_fetch_object($result)) {
-      $affil[$row->affiliate]['text'][] = $row->name. ':  '.  url("user/view/$row->uid", NULL, NULL, 1);
+      $affil[$row->affiliate]['text'][] = $row->name .':  '.  url("user/view/$row->uid", array('absolute' => TRUE));
       $affil[$row->affiliate]['name'] = $row->affil_name;
       $affil[$row->affiliate]['mail'] = $row->affil_mail;
     }
@@ -393,16 +380,16 @@
     // assemble and send each affiliate email
     if ($affil) {
       foreach ($affil as $key => $value) { // $i=0; $i< count($affil); $i++
-        $cnt = format_plural(count($affil[$key]['text']), '1 new user', count($affil[$key]['text']). ' new users');
-        $preamble = t('%persons for %afname since %last', array('%afname' => $affil[$key]['name'], '%persons' => $cnt, '%last' => date('F j G:i', $last))). "\n\n";
+        $cnt = format_plural(count($affil[$key]['text']), '1 new user', count($affil[$key]['text']) .' new users');
+        $preamble = t('%persons for %afname since %last', array('%afname' => $affil[$key]['name'], '%persons' => $cnt, '%last' => date('F j G:i', $last))) ."\n\n";
         $subj = t('Affiliate report: %persons since %last at %sn', array('%persons' => $cnt, '%sn' => variable_get('site_name', 'Drupal'), '%last' => date('F j G:i', $last)));
         $txt = implode("\n", $affil[$key]['text']);
-        user_mail($affil[$key]['mail'], $subj, $preamble. $txt, $headers);
+        user_mail($affil[$key]['mail'], $subj, $preamble . $txt, $headers);
 
-        $output_admin .= strtoupper($affil[$key]['name']). " ($cnt)". "\n". $txt. "\n\n\n";
+        $output_admin .= strtoupper($affil[$key]['name']) ." ". $cnt ."\n". $txt ."\n\n\n";
         $count_admin = $count_admin + count($affil[$key]['text']);
       }
-      $cnt = format_plural($count_admin, '1 new user', $count_admin. ' new users');
+      $cnt = format_plural($count_admin, '1 new user', $count_admin .' new users');
       $subj = t('Admin Affiliate report: %persons since %last at %sn', array('%persons' => $cnt, '%sn' => variable_get('site_name', 'Drupal'), '%last' => date('F j G:i', $last)));
       user_mail($from, $subj, $output_admin, $headers);
 
@@ -410,5 +397,3 @@
     variable_set('affiliate_cron_last', time());
   }
 }
-
-?>

