--- guestbook.module 2007-03-03 05:10:09.000000000 +0800 +++ guestbook.module 2007-09-19 17:28:38.000000000 +0800 @@ -114,6 +114,12 @@ function guestbook_user($op, &$edit, &$u '#title' => t('Status'), '#default_value' => $edit['guestbook_status'], '#options' => array(t('Enabled'), t('Disabled'))); + $form['guestbook']['guestbook_send_email'] = array( + '#type' => 'checkbox', + '#title' => t('Send email notification'), + '#description' => t("Uncheck if you don't wish to be notified of new entries to your guestbook."), + '#default_value' => isset($edit['guestbook_send_email']) ? $edit['guestbook_send_email'] : 1, + ); $form['guestbook']['guestbook_intro'] = array( '#type' => 'textarea', '#title' => t('Intro text'), @@ -121,13 +127,6 @@ function guestbook_user($op, &$edit, &$u '#cols' => 70, '#rows' => GUESTBOOK_TEXTAREA_ROWS, '#description' => t('The text that appears on top of your guestbook.')); - $form['guestbook']['guestbook_send_email'] = array( - '#type' => 'textfield', - '#title' => t('Send an notification to the following e-mail address about new guestbook entries'), - '#description' => t("Leave blank if you don't wish to be notified"), - '#size' => 30, - '#maxlength' => 128, - '#default_value' => $edit['guestbook_send_email']); return $form; } } @@ -437,8 +436,8 @@ function guestbook_form_entry_form_submi } else if ($guestbook_mode & GUESTBOOK_USER_GUESTBOOKS) { $guestbook_user = ($uid != $user->uid) ? user_load(array('uid' => $uid, 'status' => 1)) : $user; - if ($guestbook_user->uid && $guestbook_user->guestbook_status == 0) { - $iSendEmail = $guestbook_user->guestbook_send_email; + if ($guestbook_user->uid && $guestbook_user->guestbook_status == 0 && $guestbook_user->guestbook_send_email) { + $iSendEmail = $guestbook_user->mail; } }