? mail_logger-v3.patch
Index: mail_logger.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mail_logger/mail_logger.install,v
retrieving revision 1.4
diff -u -p -r1.4 mail_logger.install
--- mail_logger.install	26 May 2008 00:08:41 -0000	1.4
+++ mail_logger.install	6 Feb 2010 14:23:47 -0000
@@ -70,12 +70,11 @@ function mail_logger_schema() {
       '`language`'        => array('`language`'),
     ),
   );
-  
+
   return $schema;
 }
 function mail_logger_install() {
   drupal_install_schema('mail_logger');
-  
 }
 function mail_logger_uninstall() {
   drupal_uninstall_schema('mail_logger');
Index: mail_logger.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mail_logger/mail_logger.module,v
retrieving revision 1.3
diff -u -p -r1.3 mail_logger.module
--- mail_logger.module	26 May 2008 00:08:41 -0000	1.3
+++ mail_logger.module	6 Feb 2010 14:23:47 -0000
@@ -1,17 +1,17 @@
 <?php
 // $Id: mail_logger.module,v 1.3 2008/05/26 00:08:41 litwol Exp $
 /**
- * Implementation of hook_boot()
+ * Implementation of hook_boot().
  *
  */
 function mail_logger_boot() {
-  //because modules can modify the outgoing mail, mail_logger must be executed last in order to capture 
+  //because modules can modify the outgoing mail, mail_logger must be executed last in order to capture
   //the final mail parameters by setting the weight of mail_logger to something ridicolous
-  $max_weight = db_result(db_query("select max(weight) from {system} where name != 'mail_logger'"));
+  $max_weight = db_result(db_query("SELECT MAX(weight) FROM {system} WHERE name <> 'mail_logger'"));
   db_query("UPDATE {system} SET weight = %d WHERE name = 'mail_logger'", $max_weight + 100);
 }
 /**
- * implementation of hook_perm().
+ * Implementation of hook_perm().
  *
  */
 function mail_logger_perm() {
@@ -24,20 +24,20 @@ function mail_logger_perm() {
 function mail_logger_menu() {
   $items = array();
   $items['admin/reports/mail-logger'] = array(
-    'title'             => t('Outgoing Mail log entries'),
-    'description'       => t('View Mails that have been sent from this site.'),
+    'title'             => 'Outgoing Mail log entries',
+    'description'       => 'View Mails that have been sent from this site.',
     'page callback'     => 'mail_logger_overview',
     'access arguments'  => array('access mail logger'),
     'type'              => MENU_NORMAL_ITEM,
-   );
+  );
   $items['admin/reports/mail-logger/mail/%'] = array(
-    'title'             => t('Outgoing Mail log entries'),
-    'description'       => t('View information about a single logged mail entry'),
+    'title'             => 'Outgoing Mail log entries',
+    'description'       => 'View information about a single logged mail entry',
     'page callback'     => 'mail_logger_read_mail',
     'page arguments'    => array(4),
     'access arguments'  => array('access mail logger'),
     'type'              => MENU_CALLBACK,
-   );
+  );
 
   return $items;
 }
@@ -49,10 +49,10 @@ function mail_logger_theme() {
   );
 }
 function mail_logger_read_mail($id) {
-  if(!isset($id) || !is_numeric($id)) {
-    return 'Invalid Mail Logger ID parameter'; 
+  if (!isset($id) || !is_numeric($id)) {
+    return 'Invalid Mail Logger ID parameter';
   }
-  else if ($result = db_query('SELECT * FROM {mail_logger} WHERE mlid = %d LIMIT 1', $id) ) {
+  elseif ($result = db_query_range('SELECT * FROM {mail_logger} WHERE mlid = %d', $id, 0, 1)) {
     drupal_add_css(drupal_get_path('module', 'mail_logger') .'/mail_logger.css');
     return theme('mail_logger_read_mail', db_fetch_object($result));
   }
@@ -75,7 +75,7 @@ function theme_mail_logger_read_mail($ma
 }
 
 /**
- * implementation of hook_mail_alter
+ * Implementation of hook_mail_alter().
  *
  * Purpose of this function is to log all outgoing mail
  */
@@ -95,10 +95,10 @@ function mail_logger_mail_alter(&$messag
     time(),
     $message['language']->language,
   );
-  
+
   db_query("INSERT INTO {mail_logger} (
   `mlid` , `mailkey` , `to` , `subject` , `body` , `from` , `headers`, `date_sent`, `language`
-  ) VALUES ( 
+  ) VALUES (
   NULL, '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s' )", $args);
 
 }
@@ -142,8 +142,7 @@ function mail_logger_form_overview() {
  *
  */
 function mail_logger_form_overview_submit($form, &$form_state) {
-  $form_values = $form_state['values'];
-  $_SESSION['mail_logger_overview_filter'] = $form_values['filter'];
+  $_SESSION['mail_logger_overview_filter'] = $form_state['values']['filter'];
 }
 /**
  * theme function for mail_logger_form_overview
@@ -170,7 +169,7 @@ function mail_logger_overview() {
 
   $sql = "SELECT ml.mlid, ml.mailkey, ml.language, ml.to, ml.from, ml.subject, ml.date_sent FROM {mail_logger} ml";
   $type = $_SESSION['mail_logger_overview_filter'];
-  
+
   if ($type != 'all') {
     $result = pager_query($sql ." WHERE ml.mailkey = '%s'". $tablesort, 50, 0, NULL, $type);
   }
