Index: notify.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/notify/notify.module,v
retrieving revision 2.55.4.1
diff -u -r2.55.4.1 notify.module
--- notify.module   5 Dec 2005 14:11:12 -0000   2.55.4.1
+++ notify.module   7 Dec 2005 23:48:42 -0000
@@ -6,18 +6,60 @@
     case 'admin/modules#description':
       $output = t("Enables notifications by email.");
       break;
+    case 'admin/help#notify':
+      return t('
+      <p>The notification module allows users to subscribe to periodic emails which include all new or revised content and/or comments much like the daily news letters sent by some websites.  Even if this feature is not configured for normal site users, it can be a useful feature for an administrator of a site to monitor content submissions and comment posts.</p>
+      <p>The administrator sets the frequency of the emails in the notify administration interface. They can also set how many email failures should occur before notify stops sending notifications.  Note that cron must be enabled for notifications to be sent out. </p>
+      <p>You can</p>
+      <ul>
+       <li>set up your site to run tasks automatically at required intervals. For more information, see  <a href="%admin-help-system">cron</a>.</li>
+       <li>administer notify <a href="%admin-settings-notify">administer &gt;&gt; settings &gt;&gt; notify</a>.</li>
+      </ul>
+      <p>For more information, read the configuration and customization handbook <a href = "http://drupal.org/handbook/modules/notify" title = "notifypage"> notify page</a>.</p>
+      ',array('%admin-help-system' => url('admin/help/system'),'%admin-settings-notify' => url('admin/settings/notify')));
   }
   return $output;
 }

 function notify_settings() {
   $period = array(900 => format_interval(900), 1800 => format_interval(1800), 3600 => format_interval(3600), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 1000000000 => "Never");
-  $output .= form_select(t("Send notifications every"), "notify_send", variable_get("notify_send", 86400), $period, t("Requires crontab."));
-  $output .= form_select(t("Number of failed sends after which notifications are disabled"), "notify_attempts", variable_get("notify_attempts", 5), array(t("Disabled"), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20));
+  $group = form_select(t("Send notifications every"), "notify_send", variable_get("notify_send", 86400), $period, t("Requires crontab."));
+  $group .= form_select(t("Number of failed sends after which notifications are disabled"), "notify_attempts", variable_get("notify_attempts", 5), array(t("Disabled"), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20));
+  $output = form_group(t('Configuration'), $group);
+  $group1 = form_radios(t('Show in registration'), 'notify_show_in_registration', variable_get('notify_show_in_registration', 'off'), array('on' => t('on'), 'off' => t('off')), t('Show a simple checkbox in signup form'));
+  $group1 .= form_radios(t('Notify new content'), 'notify_content', variable_get('notify_content',0), array(t('Disabled'), t('Enabled')), t('If show in registration is enabled, include new content in the notification mail. Users can change this later.'));
+  $group1 .= form_radios(t('Content'), 'notify_teasers', variable_get('notify_teasers',0), array(t('Title only'), t('Title + Teaser'), t('Title + Body')), t('If show in registration is enabled, select the amount of each post that is to be sent in notification emails. Users can change this later.'));
+  $group1 .= form_radios(t('Notify new comments'), 'notify_comment', variable_get('notify_comment',0), array(t('Disabled'), t('Enabled')), t('If show in registration is enabled, include new comments in the notification mail. Users can change this later.'));
+  $group .= form_group(t('Settings for quick registration checkbox'), $group1);
+  $output .= form_group(t('Show simple checkbox in registration page'), $group1);
+
+  foreach (node_list() as $type) {
+    $varname = t('notify_type_%type', array('%type' => $type));
+    $group2 .= form_checkbox(node_invoke($type, 'node_name'), $varname, 1, variable_get($varname, 0));
+  }
+
+  $output .= form_group(t('Notify for new nodes of type'), $group2);

   return $output;
 }

+function notify_user($type, $edit, &$user, $category = NULL) {
+  switch ($type) {
+    case 'register':
+    if(variable_get('notify_show_in_registration', 'off')=='on'){
+    $period = variable_get("notify_send", 86400);
+      return array(array('title' => t('Notification settings'), 'data' => form_checkbox(t('Content emailing'), 'notify_status', 1, $edit['notify_status'], t('Receive email notifications of new content posted to this site. Notifications are sent every '.format_interval($period).'')), 'weight' => 3));
+      }
+    case 'insert':
+    $content = variable_get('notify_content',0);
+    $teasers = variable_get('notify_teasers',0);
+    $comment = variable_get('notify_comment',0);
+      if ($edit['notify_status']) {
+          db_query('INSERT INTO {notify} (uid, status, node, teasers, comment) VALUES (%d, %d, %d, %d, %d)', $user->uid,1,$content,$teasers,$comment);
+      }
+   }
+}
+
 function notify_cron() {
   if (time() - variable_get('notify_send_last', 0) > variable_get('notify_send', 86400)) {
     include_once drupal_get_path('module', 'notify') . '/notify.inc';

Index: notify.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/notify/notify.inc,v
retrieving revision 2.11.2.2
diff -u -r2.11.2.2 notify.inc
--- notify.inc  5 Dec 2005 14:11:12 -0000   2.11.2.2
+++ notify.inc  7 Dec 2005 23:58:58 -0000
@@ -125,7 +125,7 @@
           $body .= _notify_content($node, $user);
           $body .= '  [ '. url("queue/$node->nid", NULL, NULL, TRUE) ." ]\n\n";
         }
-        elseif (!$user->moderate && $node->nid) {
+        elseif (!$user->moderate && $node->nid && variable_get(t('notify_type_%type', array('%type'=>$node->type)),0) == 1) {
           $body .= strtr(t('%status %type by %author: %title'), array('%status' => t('published'), '%type' => node_invoke($node, 'node_name'), '%title' => $node->title, '%author' => ($node->name ? $node->name : variable_get('anonymous', 'Anonymous')))) ."\n";
           $body .= _notify_content($node, $user);
           $body .= '  [ '. url("node/$node->nid", NULL, NULL, TRUE) ." ]\n\n";
