Only in flag_content_orig: ._flag_content.info
Binary files flag_content_orig/._flag_content.module and flag_content/._flag_content.module differ
diff -urp flag_content_orig/flag_content.install flag_content/flag_content.install
--- flag_content_orig/flag_content.install	2007-04-19 10:00:17.000000000 -0500
+++ flag_content/flag_content.install	2007-09-11 14:05:14.000000000 -0500
@@ -52,6 +52,10 @@ function flag_content_update_1() {
   return $ret;
 }
 
+function flag_content_update_2() {
+  return update_sql("ALTER TABLE  {flag_content} ADD  name VARCHAR(60) NOT NULL AFTER type, ADD mail VARCHAR(64) NOT NULL AFTER name, ADD reason TEXT AFTER mail");
+}
+
 function flag_content_uninstall() {
   db_query("DROP TABLE {flag_content}");
 }
diff -urp flag_content_orig/flag_content.module flag_content/flag_content.module
--- flag_content_orig/flag_content.module	2007-06-23 15:33:23.000000000 -0500
+++ flag_content/flag_content.module	2007-09-11 15:05:06.000000000 -0500
@@ -224,6 +224,8 @@ function flag_content_link($type, $entry
 }
 
 function flag_content_add($eid = 0, $type = FLAG_CONTENT_TYPE_NODE) {
+  global $user;
+
   switch ($type) {
     case FLAG_CONTENT_TYPE_NODE:
       $node = node_load($eid);
@@ -255,6 +257,28 @@ function flag_content_add($eid = 0, $typ
     '#value' => $type,
   );
 
+  $form['name'] = array(
+	'#type' => 'textfield',
+	'#title' => t('Name'),
+	'#required' => TRUE,
+	'#default_value' => ($user->name) ? $user->name : ''
+  );
+
+  $form['mail'] = array(
+	'#type' => 'textfield',
+	'#title' => t('Email'),
+	'#required' => TRUE,
+	'#default_value' => ($user->mail) ? $user->mail : ''
+  );
+
+  $form['reason'] = array(
+	'#type' => 'textarea',
+	'#title' => t('Reason'),
+	'#required' => TRUE,
+	'#rows' => 8,
+	'#description' => t('Why are you flagging this item?')
+  );
+
   return confirm_form(
     $form,
     t('Are you sure you want to flag the @type @title', array('@type' => $type_label, '@title' => $title)),
@@ -268,10 +292,13 @@ function flag_content_add_submit($form_i
   global $user;
   $eid = $form_values['eid'];
   $type = $form_values['type'];
+  $name = $form_values['name'];
+  $mail = $form_values['mail'];
+  $reason = $form_values['reason'];
   if ($eid && $type) {
     // Insert the data into the table
-    db_query("INSERT INTO {flag_content} (fid, eid, uid, type, timestamp) VALUES (0, %d, %d, '%s', %d)",
-      $eid, $user->uid, $type, time());
+    db_query("INSERT INTO {flag_content} (fid, eid, uid, type, name, mail, reason, timestamp) VALUES (0, %d, %d, '%s', '%s', '%s', '%s', %d)",
+      $eid, $user->uid, $type, $name, $mail, $reason, time());
     // Prepare the data
     switch ($type) {
       case FLAG_CONTENT_TYPE_NODE:
@@ -292,7 +319,7 @@ function flag_content_add_submit($form_i
     }
 
     // Email the admin
-    $email = theme('flag_content_mail', $entry, $type);
+    $email = theme('flag_content_mail', $entry, $type, $name, $mail, $reason);
     drupal_mail('flag_content_admin', $email['to'], $email['subject'], $email['body'], $email['from']);
 
     // Log the operation:
@@ -388,11 +415,16 @@ function theme_flag_content_view($list =
       }
 
       $timestamp = format_date($entry->timestamp, 'custom', 'Y-m-d H:i');
-      $by = theme('username', user_load(array('uid' => $entry->uid)));
+      if ($entry->uid) {
+	    $by = theme('username', user_load(array('uid' => $entry->uid)));
+      } else {
+        $by = l($entry->name, 'mailto:'.$entry->mail);
+      }
       $ops = l(t('edit'), $edit);
       $ops .= ' ' . l(t('unflag'), "flag_content/unflag/$entry->eid/$entry->type");
       $ops .= ' ' . l(t('delete'), $delete);
       $rows[] = array($item, $type, $by, $timestamp, $ops);
+      $rows[] = array(array('data' => 'Reason: '.$entry->reason, 'colspan' => 5));
     }
   }
   else {
@@ -449,13 +481,9 @@ function theme_flag_content_mail($entry 
   }
 
   if ($user->uid) {
-    $name = $user->name;
-    $from = $user->mail;
     $user_url = $base_url . base_path() . "user/$user->uid";
   }
   else {
-    $name = variable_get('anonymous', 'Anonymous');
-    $from = variable_get('site_mail', '');
     $user_url = t('n/a');
   }
   $site = variable_get('site_name', 'drupal site');
@@ -469,18 +497,20 @@ function theme_flag_content_mail($entry 
     '@title'     => $title,
     '@entry_url' => $base_url . base_path() . $path,
     ));
-
+  $body .= t("\nReason: @reason", array(
+    '@reason' => $reason,
+    ));
   $body .= t("\n\nManage the flagged items list at @manage", array(
     '@manage' => $base_url . base_path() . 'admin/content/flag_content',
     ));
 
   $to = check_plain($to);
-  $from = check_plain($from);
+  $mail = check_plain($mail);
   $name = check_plain($name);
 
   return array(
     'to'      => $to,
-    'from'    => $from,
+    'from'    => $mail,
     'subject' => $subject,
     'body'    => $body,
   );
