--- D:/Temp/lm_paypal/lm_paypal_subscriptions.module.old	Thu Oct 30 17:06:22 2008
+++ D:/Temp/lm_paypal/lm_paypal_subscriptions.module	Thu Oct 30 13:23:55 2008
@@ -575,12 +575,21 @@
   }
 
   $header = array(t('Name'), t('Description'), t('Action'));
+  $unsubscribe = '';
+  $alias = urlencode($_lm_paypal_business);
+  $unsuburl = "https://$_lm_paypal_host/cgi-bin/webscr?cmd=_subscr-find&amp;alias=$alias";
+
   while ($so = db_fetch_object($subs)) {
     $already = lm_paypal_user_subscribed($so->subid, $account);
 
     $item_name = check_plain($so->item_name);
     if ($already) {
       $sub = t('already subscribed');
+      $unsubscribe .= '<h4>'. t('To Unsubscribe') .'</h4>';
+      $unsubscribe .= '<p>';
+      $unsubscribe .= t('Click unsubscribe to log in to your PayPal account. Click the Details of the subscription in question. Click Cancel Subscription.');
+      $unsubscribe .= "</p><p><a href=\"$unsuburl\">". t('Unsubscribe') .'</a>';
+      $unsubscribe .= '</p>';
     }
     else {
       if (!$logged_in) {
@@ -605,15 +614,7 @@
     $count++;
   }
   $output .= theme('table', $header, $rows);
-
-  $alias = urlencode($_lm_paypal_business);
-  $unsuburl = "https://$_lm_paypal_host/cgi-bin/webscr?cmd=_subscr-find&amp;alias=$alias";
-
-  $output .= '<h4>'. t('To Unsubscribe') .'</h4>';
-  $output .= '<p>';
-  $output .= t('Click unsubscribe to log in to your PayPal account. Click the Details of the subscription in question. Click Cancel Subscription.');
-  $output .= "</p><p><a href=\"$unsuburl\">". t('Unsubscribe') .'</a>';
-  $output .= '</p>';
+  $output .= $unsubscribe;
 
   return $output;
 }
