--- invite.module	2005-06-25 22:16:42.000000000 +0200
+++ invite.module.2	2005-09-24 01:33:00.923195800 +0200
@@ -1,6 +1,6 @@
 <?php
 // $Id: invite.module,v 1.3 2005/06/25 18:54:01 kbahey Exp $
-
+// patched by OeX http://www.oxkr.com
 /** 
  * @file 
  *
@@ -82,7 +82,7 @@
 
   $group .= form_select(t('Number of invitations per user'), 'invite_maxnum', 
             variable_get('invite_maxnum', 10), 
-            drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20)), 
+            drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 50)), 
             t('Maximum number of invitations a user may send'), 
             $extra = 0, $multiple = FALSE, $required = TRUE);
 
@@ -102,7 +102,14 @@
                $attributes = NULL, $required = FALSE);
   
   }
+
+ $group2 = form_textarea(t('email'), 'invite_send_body', 
+                           variable_get('invite_send_body',t('TYPE YOUR BODY TEXT HERE')), 60, 10, 
+                           t('Type the body text here'), 
+                           $attributes = NULL, $required = TRUE);
+  
   $output .= form_group(t('Email settings'),$group);
+  $output .= form_group(t('Body Text'),$group2);
   $output .= form_group(t('Sample Email'),_invite_send_invite('display'));
 
   return $output;
@@ -114,17 +121,13 @@
 */
 
 function invite_menu($may_cache) {
-  global $user;
   $items = array();
-
-  if ($may_cache) {
-
-    $items[] = array('path' => 'invite',
-                    'title' => t('Invite'),
-                 'callback' => 'invite_page',
-                   'access' => user_access('send invitations'),
-                     'type' => MENU_CALLBACK);
+if ($may_cache) {
+    $items[] = array('path' => 'invite', 'title' => t('Invite'),
+      'callback' => 'invite_page',
+      'access' => user_access('send invitations'));
   }
+
   return $items;
 }
 
@@ -143,17 +146,17 @@
 
     // What type of registration action are we taking?
     switch ($type) {
-      case t("login"):
-      case t("view"):
+      case "login":
+      case "view":
         if (user_access('send invitations')){
            _invite_check_msgs($user->uid);
-           if ($type == t("view") && ($user->uid == $GLOBALS['user']->uid)){
+           if ($type == "view" && ($user->uid == $GLOBALS['user']->uid)){
              $data = l("Invite a friend",'invite');
              return array("Buddy List" => $data);
            }
         }
         break;
-      case t("register"):
+      case "register":
 
         // Add items to the registration form.
 
@@ -164,7 +167,7 @@
                 array('title' => t('Registration Code'),
                       'data' => $output,
                       'weight' => -1));
-      case t("validate"):
+      case "validate":
         // The user has filled out the form and checked the "accept" box.
         if (($edit["invite_code"]) && !($edit["invite_email"])) {
           form_set_error('invite_email', t("You must enter the email address where you received your invitation or remove the registration code from the signup form. "));
@@ -187,7 +190,7 @@
           }
         }
         break;
-      case t("insert"):
+      case "insert":
         // Check to see if the regnumber and email match.  
         if (($edit["invite_code"]) && ($edit["invite_email"])){
           $query = "SELECT * FROM {invite} WHERE email = '%s'";
@@ -199,7 +202,8 @@
               _invite_status_activate($user);
               _invite_role_escalate($user);
               _invite_userpoints($user, 'register');
-              _invite_set_timestamp($registration['email'],$user->uid);
+      	  drupal_set_message("You have accepted an invitation from your friend: " .$user->name);
+      	      _invite_set_timestamp($registration['email'],$user->uid);
               drupal_set_message("Your registration code has been accepted");
               
             } else {
@@ -246,6 +250,8 @@
        //update database
        db_query("INSERT INTO {invite}(email, reg_code, uid, expiry) VALUES ('%s', '%s', %d, %d)",$edit["email"],$code,$user->uid, time()+(variable_get('invite_expiry', 30)*60*60*24));  
        //send email
+	watchdog("user", "Invite Module: User ".$user->name." invitation has been sent!", $link = NULL);
+              drupal_set_message("invitation has been sent!");
        _invite_send_invite('mail',$user->name,$edit["email"],$code);
        _invite_userpoints($user, 'invite');
        drupal_set_message("Your invitation has been sent!");
@@ -256,7 +262,7 @@
        //delete an invite from the table
        if ($email = arg(2)){ 
          db_query("DELETE from {invite} WHERE email = '%s'",$email);
-         drupal_set_message("Invitation to $email has been deleted");
+	  drupal_set_message("Invitation to $email has been deleted");
          drupal_goto('invite');
        }
     default:
@@ -367,11 +373,11 @@
   if (module_exist("feature") && (variable_get('invite_include_features', '0') == 1)){
     $body .= strip_tags(br2nl(feature_listing()))."\n\n";
   }
-
-  $body .= "To sign up, follow the link below and enter the following information into the 'Registration Code' section of the form\n\n";             
+  $body .= variable_get('invite_send_body', '0');
+  $body .= "\n\n";
   $body .= "Your usercode : ".$code."\n";
   $body .= "Your email address : ".$email."\n"; 
-  $body .= "Register Here : ". $base_url."/user/register";
+  $body .= "Register Here : ". $base_url."/?q=user/register";
   
   switch ($op){
     case "mail":
