Index: submitted_by.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/submitted_by/submitted_by.module,v
retrieving revision 1.2
diff -u -r1.2 submitted_by.module
--- submitted_by.module	9 Jun 2008 16:04:33 -0000	1.2
+++ submitted_by.module	20 Oct 2008 22:16:27 -0000
@@ -10,6 +10,40 @@
 function submitted_by_theme_registry_alter(&$theme_registry) {
   if (!empty($theme_registry['form_element'])) {
     $theme_registry['node_submitted']['function'] = 'submitted_by_node_submitted';
+    $theme_registry['comment_submitted']['function'] = 'submitted_by_comment_submitted';
+  }
+}
+
+function submitted_by_form_alter(&$form, $form_state, $form_id) {
+  if ($form_id == 'node_type_form' && isset($form['comment'])) {
+    $form['comment']['comment']['#weight'] = -5;
+    $type = isset($form['identity']['type']) ? $form['identity']['type']['#value'] : '';
+    $default = variable_get('submitted_by_comment_'. $type, NULL);
+    $form['comment']['appearance'] = array(
+      '#type' => 'fieldset',
+      '#collapsible' => TRUE,
+      '#collapsed' => $default ? FALSE : TRUE,
+      '#title' => t('"Submitted by" Appearance'),
+      );
+    $form['comment']['appearance']['#weight'] = -1;
+    $form['comment']['appearance']['submitted_by']['submitted_by_comment'] = array(
+      '#type' => 'textfield',
+      '#title' => t("'Submitted by...' text"),
+      '#default_value' => $default,
+      '#description' => t("When a comment is displayed, text in this box will be used to override the normal attribution and date-posted text."),
+      );
+    $form['comment']['appearance']['submitted_by']['help'] = array(
+      '#type' => 'fieldset',
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#title' => t('Replacement tokens'),
+      '#description' => t("The following tokens can be used in the Submitted By... text. They will be replaced with the appropriate values."),
+      );
+
+    $form['comment']['appearance']['submitted_by']['help']['tokens'] = array(
+      '#value' => theme('token_help', 'node'),
+      );
+
   }
 }
 
@@ -47,6 +81,25 @@
 }
 
 /**
+ * Format the "Submitted by username on date/time" for each comment.
+ * varying the results by node type.
+ */
+function submitted_by_comment_submitted($node) {
+  $type = db_result(db_query(db_rewrite_sql("SELECT n.type FROM {node} n WHERE n.nid=%d"), $node->nid));
+  if ($submitted = variable_get('submitted_by_comment_' . $type, NULL)) {
+    return token_replace($submitted, 'node', $node);
+  }
+  else {
+    return t('Submitted by !username on @datetime',
+      array(
+        '!username' => theme('username', $node),
+        '@datetime' => format_date($node->created),
+      )
+    );
+  }
+}
+
+/**
  * Format the "Submitted by username on date/time" for each node,
  * varying the results by node type.
  */
