--- modr8.module.latest	2006-09-13 08:29:32.000000000 -0400
+++ modr8.module	2006-09-13 08:25:47.000000000 -0400
@@ -70,6 +70,14 @@
     '#options' => drupal_map_assoc(array(5, 10, 15, 20, 25, 50, 75, 100, 150, 200)),
     '#default_value' => variable_get('modr8_nodes_per_page', 10),
   );
+  
+   $form['modr8_publish'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Set node to published'),
+    '#default_value' => variable_get('modr8_publish', FALSE),
+    '#description' => t('If this is set, when the moderator approves the node, the published flag is set.'),
+  );
+  
   $form['text'] = array(
     '#type' => 'fieldset',
     '#title' => t('email'),
@@ -259,7 +267,8 @@
         if(variable_get('modr8_send_approve', FALSE)){
           modr8_usermail('approve', $nid, $values);
         }
-        db_query('UPDATE {node} SET moderate = 0 WHERE nid = %d', $nid);
+        if (variable_get('modr8_publish', FALSE)) { $publish =", status = 1"; }
+        db_query('UPDATE {node} SET moderate = 0 $publish WHERE nid = %d', $nid);
         drupal_set_message(t('The %type %title has been approved.', array('%title' => theme('placeholder', $values['title']), '%type' => $values['type'])));
         break;
       case 'delete':
