Index: contribs/weblinks_checker/weblinks_checker.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/weblinks/contribs/weblinks_checker/weblinks_checker.admin.inc,v
retrieving revision 1.1.2.10
diff -u -r1.1.2.10 weblinks_checker.admin.inc
--- contribs/weblinks_checker/weblinks_checker.admin.inc	27 Aug 2009 15:36:40 -0000	1.1.2.10
+++ contribs/weblinks_checker/weblinks_checker.admin.inc	27 Aug 2009 22:36:34 -0000
@@ -22,11 +22,15 @@
     '#type' => 'radios',
     '#title' => t('Allow duplicate URLs'),
     '#default_value' => variable_get('weblinks_allow_dupes', 0),
-    '#options' => array(1 => t('yes'), 0 => t('no'), 2 => t('warn')),
+    '#options' => array(
+      1 => t('Yes'),
+      0 => t('No'),
+      2 => t('Warn')
+    ),
     '#description' => t('This check is performed at link creation time. Most users will not want to allow duplicate URLs.'),
     '#prefix' => '<div class="weblinks-radios">',
     '#suffix' => '</div><div class="clear-block"></div>',
-    );
+  );
 
   $form['weblinks_validate_check'] = array(
     '#type' => 'radios',
@@ -36,7 +40,7 @@
     '#title' => t('Check if link is valid when entered'),
     '#default_value' => (int) variable_get('weblinks_validate_check', FALSE),
     '#description' => t('If enabled, the module will attempt to use the URL to contact the site when the link is created or updated. If the link returns any error, the add/update will fail.'),
-    );
+  );
 
   $form['weblinks_checker_enabled'] = array(
     '#type' => 'radios',
@@ -46,7 +50,7 @@
     '#title' => t('Enable link validity checker'),
     '#description' => t('Do you want to check the links on a schedule?'),
     '#default_value' => (int) variable_get('weblinks_checker_enabled', FALSE),
-    );
+  );
 
   $form['basic'] = array(
     '#type' => 'fieldset',
@@ -54,7 +58,7 @@
     '#collapsible' => TRUE,
     '#collapsed' => FALSE,
     '#prefix' => '<div class="weblinks_checker_hide">',
-    );
+  );
 
   $form['basic']['weblinks_checker_limit'] = array(
     '#type' => 'textfield',
@@ -63,7 +67,7 @@
     '#size' => 5,
     '#maxlength' => 3,
     '#default_value' => variable_get('weblinks_checker_limit', 5),
-    );
+  );
 
   $form['basic']['weblinks_checker_show_status'] = array(
     '#type' => 'radios',
@@ -73,7 +77,7 @@
     '#title' => t('Show error status'),
     '#description' => t('If this is selected and the link is returning an error, the status will be displayed with the link.'),
     '#default_value' => (int) variable_get('weblinks_checker_show_status', TRUE),
-    );
+  );
 
   $form['basic']['weblinks_checker_detail_log'] = array(
     '#type' => 'radios',
@@ -81,13 +85,13 @@
       1 => t('Every URL that was checked'),
       2 => t('Only if the http status has changed'),
       0 => t('None'),
-      ),
+    ),
     '#prefix' => '<div class="weblinks-radios">',
     '#suffix' => '</div>',
     '#title' => t('Show URLs checked'),
     '#description' => t('This option controls what messages are written to the dblog for each URL that is tested. The log will always show links which get published or unpublished during the run.'),
     '#default_value' => (int) variable_get('weblinks_checker_detail_log', FALSE),
-    );
+  );
 
   $form['basic']['weblinks_checker_summary_msg'] = array(
     '#type' => 'radios',
@@ -96,12 +100,12 @@
       1 => t('Short'),
       2 => t('Long'),
       0 => t('None'),
-      ),
+    ),
     '#description' => t('The short message just says how many links were checked. The long message also gives the link titles.'),
     '#default_value' => variable_get('weblinks_checker_summary_msg', 0),
     '#prefix' => '<div class="weblinks-radios">',
     '#suffix' => '</div><div class="clear-block"></div>',
-    );
+  );
 
   $mins = 60;
   $hour = 3600;
@@ -114,14 +118,14 @@
     '#description' => t("This sets the frequency of checking. If you run Cron frequently, you may wish to set this higher than your Cron frequency so that you don't overload the linked site. The check will be run at the next scheduled Cron run after this interval expires. An interval of 0 means every cron run."),
     '#size' => count($interval) / 2,
     '#default_value' => variable_get('weblinks_checker_interval', 24 * $hour),
-    );
+  );
 
   $form['weblinks_error_handling'] = array(
     '#type' => 'fieldset',
     '#title' => t('Handling links that have errors'),
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
-    );
+  );
 
   $form['weblinks_error_handling']['weblinks_checker_redirect'] = array(
     '#type' => 'radios',
@@ -131,7 +135,7 @@
     '#default_value' => variable_get('weblinks_checker_redirect', FALSE),
     '#prefix' => '<div class="weblinks-radios">',
     '#suffix' => '</div>',
-    );
+  );
 
   $form['weblinks_error_handling']['weblinks_checker_order'] = array(
     '#type' => 'radios',
@@ -139,12 +143,12 @@
     '#options' => array(
       0 => t('Check links in strict rotation'),
       1 => t('Give priority to links in error'),
-      ),
+    ),
     '#description' => t('Using strict rotation will make sure each link is checked in turn before any are re-checked. Giving priority to links which are in error ensures that their status is monitored closely so that they can be re-published as soon as they return a good status.'),
     '#default_value' => variable_get('weblinks_checker_order', 0),
     '#prefix' => '<div class="weblinks-radios">',
     '#suffix' => '</div>',
-    );
+  );
 
   $form['weblinks_error_handling']['weblinks_checker_unpublish'] = array(
     '#type' => 'radios',
@@ -153,12 +157,12 @@
       1 => t('Unpublish after N cron runs'),
       2 => t('Unpublish after N days'),
       0 => t('Do not unpublish'),
-      ),
+    ),
     '#description' => t('Weblinks can be unpublished after being in the same error state for a number of consecutive cron runs or days.'),
     '#default_value' => variable_get('weblinks_checker_unpublish', 0),
     '#prefix' => '<div class="weblinks-radios">',
     '#suffix' => '</div>',
-    );
+  );
 
   $form['weblinks_error_handling']['weblinks_checker_unpublish_after'] = array(
     '#type' => 'textfield',
@@ -168,7 +172,7 @@
     '#maxlength' => 2,
     '#default_value' => variable_get('weblinks_checker_unpublish_after', 2),
     '#prefix' => '<div class="weblinks_checker_unpublish_hide">',
-    );
+  );
 
   $form['weblinks_error_handling']['weblinks_checker_action_on_unpublished'] = array(
     '#type' => 'radios',
@@ -177,12 +181,12 @@
       1 => t('Include in checking'),
       2 => t('Include and re-publish if OK'),
       0 => t('Exclude from checking'),
-      ),
+    ),
     '#description' => t('Do you want to re-check and get an up-to-date status for links which have been unpublished because they were in error? These links can also be re-published if they are now reporting a good status code.'),
     '#default_value' => variable_get('weblinks_checker_action_on_unpublished', 0),
     '#prefix' => '<div class="weblinks-radios">',
     '#suffix' => "</div></div><!-- /weblinks_checker_unpublish_hide -->",
-    );
+  );
 
   $ignore_deflt = variable_get('weblinks_checker_ignore', array());
   if (!$ignore_deflt) {
@@ -204,7 +208,7 @@
       array('!url' => url('http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html', array('external' => TRUE)))),
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
-    );
+  );
 
   // Add a separate checkbox for code 0, which is (mainly) when you are not connected to the internet.
   // It has to be done separately from the rest of the codes because the key must be something
@@ -216,7 +220,7 @@
     '#default_value' => variable_get('weblinks_checker_ignore_zero', array()),
     '#prefix' => '<div class="weblinks-checkboxes">',
     '#suffix' => '</div>',
-    );
+  );
 
   $form['ignore']['weblinks_checker_ignore'] = array(
     '#type' => 'checkboxes',
@@ -224,16 +228,16 @@
     '#default_value' => $ignore_deflt,
     '#prefix' => '<div class="weblinks-checkboxes">',
     '#suffix' => '</div></div><!-- /weblinks_checker_hide --><br />',
-    );
+  );
 
   // The following are for user deletion.
   $form['rescue'] = array(
     '#type' => 'fieldset',
-    '#title' => t("User Deletion Action"),
+    '#title' => t('User Deletion Action'),
     '#description' => t('This section determines what you want to do with links submitted by a user who is subsequently deleted.'),
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
-    );
+  );
 
 /*  $form['rescue']['weblinks_user_rescue'] = array(
     '#type' => 'radios',
@@ -243,11 +247,11 @@
     '#default_value' => variable_get('weblinks_user_rescue', 'move'),
     '#prefix' => '<div class="weblinks-radios">',
     '#suffix' => '</div>',
-    ); /* */
+  ); /* */
   $form['rescue']['weblinks_user_rescue'] = array(
     '#type' => 'value',
     '#value' => 'move',   /* there is a core bug that prevents 'delete' for now */
-    );
+  );
 
   $result = db_query("SELECT uid, name FROM {users}");
   $rescue_users = array();
@@ -264,7 +268,7 @@
     '#default_value' => variable_get('weblinks_rescue_move', 1),
     '#prefix' => '<div class="weblinks-move-user-list">',
     '#suffix' => '</div>',
-    );
+  );
 
   $form['rescue']['weblinks_rescue_unpub'] = array(
     '#type' => 'radios',
@@ -274,7 +278,7 @@
     '#default_value' => (int) variable_get('weblinks_rescue_unpub', 0),
     '#prefix' => '<div class="weblinks-radios">',
     '#suffix' => '</div>',
-    );
+  );
 
 //  $form['#redirect'] = 'weblinks';
   return system_settings_form($form);
@@ -300,11 +304,11 @@
     return FALSE;
   }
 
-  // If the 'N days' or 'N crons' option has been changed, reset the existing last_status_info 
+  // If the 'N days' or 'N crons' option has been changed, reset the existing last_status_info.
   // values to zero where a value has been set, as they would now give wrong results.
   $unpublish = $form['weblinks_error_handling']['weblinks_checker_unpublish'];
   if ($unpublish['#value'] != $unpublish['#default_value']) {
-    db_query('UPDATE {weblinks} SET last_status_info=0 WHERE last_status_info > 0');
+    db_query('UPDATE {weblinks} SET last_status_info=%d WHERE last_status_info > %d', 0, 0);
     drupal_set_message(t('The stored information on when links in error changed status has been cleared because you altered the criteria for unpublishing.'));
   }
   return TRUE;
Index: contribs/weblinks_checker/weblinks_checker.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/weblinks/contribs/weblinks_checker/weblinks_checker.module,v
retrieving revision 1.1.2.10
diff -u -r1.1.2.10 weblinks_checker.module
--- contribs/weblinks_checker/weblinks_checker.module	27 Aug 2009 15:36:40 -0000	1.1.2.10
+++ contribs/weblinks_checker/weblinks_checker.module	27 Aug 2009 22:36:34 -0000
@@ -68,7 +68,7 @@
   }
 
   // Check the validity of the link.
-  $error_text = array_key_exists($node->last_status, $errors) ? $errors[$node->last_status] : t('Invalid code');
+  $error_text = array_key_exists($node->last_status, $errors) ? $errors[$node->last_status] : t('Invalid status code');
   switch ($node->last_status) {
     case '200':
     case '0':
@@ -119,18 +119,8 @@
           $status = variable_get('weblinks_rescue_unpub', 0);
           $move = db_query("UPDATE {node} SET uid=%d, status=%d WHERE type='weblinks' AND uid=%d", $move_to, $status, $account->uid);
           $count = db_affected_rows();
-          drupal_set_message(t('Weblinks moved !links from user !from to user !to.',
-            array(
-              '!links' => format_plural($count, '1 link', '@count links'),
-              '!from' => $account->uid,
-              '!to' => $move_to))
-              );
-          watchdog('Weblinks', 'Weblinks moved !links from user !from to user !to.',
-            array(
-              '!links' => format_plural($count, '1 link', '@count links'),
-              '!from' => $account->uid,
-              '!to' => $move_to)
-              );
+          drupal_set_message(format_plural($count, 'Weblinks moved 1 link from user !source_uid to user !target_uid.', 'Weblinks moved @count links from user !source_uid to user !target_uid.', array('!source_uid' => $account->uid, '!target_uid' => $move_to)));
+          watchdog('Weblinks', format_plural($count, 'Weblinks moved 1 link from user !source_uid to user !target_uid.', 'Weblinks moved @count links from user !source_uid to user !target_uid.', array('!source_uid' => $account->uid, '!target_uid' => $move_to)));
           break;
 
         case 'delete':
@@ -207,7 +197,7 @@
     }
   }
 }
- 
+
 /**
  * Implementation of hook_nodeapi().
  */
@@ -288,7 +278,7 @@
   $sql = 'SELECT l.vid, l.nid, l.url, l.last_checked, l.last_status, l.last_status_info, n.title, n.status as node_published '
     .'FROM {weblinks} l '
     .'JOIN {node} n USING (vid, nid) '
-    .'WHERE n.status=1 '. ($action_on_unpublished ? ' or (last_status <> "" and !ISNULL(last_status_info)) ' : '')
+    .'WHERE n.status=1 '. ($action_on_unpublished ? " or (last_status <> '' and !ISNULL(last_status_info)) " : '')
     .'ORDER BY';
   if ($checker_order) {
     // The admin has selected to give priority to links which are unchecked, unpublished or currently
@@ -308,7 +298,7 @@
   $result = db_query_range($sql, 0, $limit);
   while ($link = db_fetch_object($result)) {
     $url = $newurl = $link->url;
-    $last_status = $link->last_status != '' ? $link->last_status : t('unknown');
+    $last_status = $link->last_status != '' ? $link->last_status : t('Unknown');
     $last_status_info = $link->last_status_info;
     $status = 'dead';
     $extra = NULL;
@@ -323,11 +313,11 @@
     if (!$ignore[$status]) {
       $errors_found++;
       $extra = $response->error;
-      watchdog('Weblinks', '!url reports !status !extra.', array('!url' => check_plain($url), '!status' => $status, '!extra' => $extra));
+      watchdog('Weblinks', '@url reports @status @extra.', array('@url' => $url, '@status' => $status, '@extra' => $extra));
       if ($last_status != $status) {
         if ($detail_log != 0) {
           // The http status has changed and the 'none' reporting option is not selected, so report it to the log.
-          watchdog('Weblinks', 'Status changed from @last_status to @status for @title @url @extra.', array('@title' => $link->title, '@url' => $url, '@status' => $status,  '@last_status' => $last_status, '@extra' => $extra), WATCHDOG_WARNING);
+          watchdog('Weblinks', 'Status changed from @last_status to @status for @title @url @extra.', array('@title' => $link->title, '@url' => $url, '@status' => $status, '@last_status' => $last_status, '@extra' => $extra), WATCHDOG_WARNING);
         }
         // Reset the last_status_info.
         $last_status_info = $reset_value;
@@ -348,16 +338,16 @@
           $last_status_info++;
         }
       }
- 
+
       if ($status == '301' && $redir_update) {
         // Update the link because of redirect.
         $newurl = substr($response->redirect_url, 0, 1) == '/' ? $url . $response->redirect_url : $response->redirect_url;
-        watchdog('Weblinks', '!url updated to !new.', array('!url' => check_plain($url), '!new' => $newurl));
+        watchdog('Weblinks', '@url updated to @new.', array('@url' => $url, '@new' => $newurl));
         watchdog('Weblinks', '@title @url returned 301, updated to @new', array('@title' => $link->title, '@url' => $url, '@new' => $newurl));
         $status = '200';
         $last_status_info = 0;
        }
- 
+
       if ($unpublish) {
         // The option to unpublish links in error is selected. Get the number of days or cron runs
         // after which to unpublish.
@@ -379,12 +369,12 @@
         if ($status != $last_status) {
           watchdog('Weblinks',
             'Status changed from @last_status to @status for @title @url',
-            array('@title' => $link->title, '@url' => $url, '@status' => $status,  '@last_status' => $last_status));
+            array('@title' => $link->title, '@url' => $url, '@status' => $status, '@last_status' => $last_status));
         }
         else {
           watchdog('Weblinks',
             'Status @status unchanged for @title @url',
-            array('@title' => $link->title, '@url' => $url, '@status' => $status,  '@last_status' => $last_status));
+            array('@title' => $link->title, '@url' => $url, '@status' => $status, '@last_status' => $last_status));
         }
       }
       // Clear the last_status_info as the link is not in error.
@@ -397,7 +387,7 @@
         drupal_set_message(t('@title @url re-published.', array('@title' => $link->title, '@url' => $url)));
       }
     }
- 
+
     $link->last_status = $status;
     $link->last_status_info = $last_status_info;
     $link->last_checked = date('Y-m-d H:i:s', $now); // datetime format
@@ -409,9 +399,15 @@
 
   $summary_msg = variable_get('weblinks_checker_summary_msg', 0);
   if ($summary_msg) {
-    watchdog('Weblinks', 'Weblinks checked !links @titles',
-      array('!links' => format_plural(count($checked), '1 link', '@count links'), '@titles' => ($summary_msg == 2 && count($checked)) ? '('. implode(', ', $checked) .')' : ''),
-      WATCHDOG_NOTICE, l(t('Settings'), 'admin/settings/weblinks/checker'));
+    watchdog('Weblinks',
+      format_plural($count,
+        'Weblinks checked 1 link @titles.',
+        'Weblinks checked @count link @titles.',
+        array('@titles' => ($summary_msg == 2 && count($checked)) ? '('. implode(', ', $checked) .')' : '')
+      ),
+      WATCHDOG_NOTICE,
+      l(t('Settings'), 'admin/settings/weblinks/checker')
+    );
   }
 
   // If priority is being given to links in error and the number of links returning an error is equal
@@ -419,10 +415,16 @@
   // the bad links return to a good status or the URLs are fixed. Give a warning in the log to alert
   // the admin, who may wish to increase the number of links tested or change the priority of checking.
   if ($errors_found >= $limit && $checker_order) {
-    watchdog('Weblinks', '!links_in_error and the maximum number being checked per run is !limit. Other links will not get checked because priority is given to links in error, so you may wish to change your settings.',
-      array('!links_in_error' => format_plural($errors_found, 'There is 1 link in error', 'There are @count links in error'), '!limit' => $limit),
-      WATCHDOG_WARNING, l(t('Settings'), 'admin/settings/weblinks/checker'));
+    watchdog('Weblinks',
+      format_plural($count,
+        'There is 1 link in error and the maximum number being checked per run is !limit. Other links will not get checked because priority is given to links in error, so you may wish to change your settings.',
+        'There are @count links in error and the maximum number being checked per run is !limit. Other links will not get checked because priority is given to links in error, so you may wish to change your settings.',
+        array('!limit' => $limit)
+      ),
+      WATCHDOG_WARNING,
+      l(t('Settings'), 'admin/settings/weblinks/checker')
+    );
   }
- 
+
   variable_set('weblinks_checker_last', $now);
 }
