? LICENSE.txt
Index: akismet.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/akismet/akismet.admin.inc,v
retrieving revision 1.3
diff -a -u -r1.3 akismet.admin.inc
--- akismet.admin.inc	1 Aug 2008 23:14:51 -0000	1.3
+++ akismet.admin.inc	18 Sep 2008 23:16:34 -0000
@@ -1,5 +1,10 @@
 <?php
-// $Id: akismet.admin.inc,v 1.3 2008/08/01 23:14:51 drewish Exp $
+// $Id: akismet.admin.inc,v 1.2 2008/05/26 23:37:31 drewish Exp $
+
+/**
+ * @file
+ * Akismet Module Administration pages
+ */
 
 /**
  * Implementation of hook_settings().
@@ -94,7 +99,7 @@
   $form['general']['akismet_blocks_counter'] = array(
     '#type' => 'select', '#title' => t('Number of blocks'),
     '#default_value' => variable_get('akismet_blocks_counter', 1),
-    '#options' => array(0=>t('none'), 1=>1, 2=>2, 3=>3, 4=>4, 5=>5),
+    '#options' => array(0 => t('none'), 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5),
     '#description' => t('The akismet module may generate a number of blocks for you to display the current spam counter anywhere on your site. The number of blocks is variable to help you keep your <a href="!admin-block">blocks administration panel</a> as clean as possible. This option allows you to specify how many blocks you wish to use. If you do not plan to show the spam counter to your visitors, set this option to <em>none</em>.',
       array(
         '!admin-block' => url('admin/block'),
@@ -114,7 +119,7 @@
   $form['node_options']['akismet_check_nodetypes'] = array(
     '#type' => 'checkboxes', '#title' => t('Check for spam in these node types'),
     '#options' => node_get_types('names'),
-    '#default_value' => variable_get('akismet_check_nodetypes', array()),
+    '#default_value' => variable_get('akismet_check_nodetypes', NULL),
     '#description' => t('Use this option to <em>enable</em> or <em>disable</em> spam check for nodes of types specified here. When this option is enabled, a request will be sent to the <a href="!akismet">Akismet Service</a>, in real time. If the <a href="!akismet">Akismet Service</a> was down, nodes would simply be queued for manual moderation. Users with <a href="!admin-access">@admin-nodes</a> permission and <a href="!admin-access">spam moderators</a> are exempt from this check.',
       array(
         '!akismet' => url('http://akismet.com'),
@@ -247,7 +252,7 @@
   $form['anti_spambot']['akismet_antispambot_rules'] = array(
     '#type' => 'checkboxes', '#title' => t('Identify spambots by'),
     '#options' => $anti_spambot_rules,
-    '#default_value' => variable_get('akismet_antispambot_rules', array()),
+    '#default_value' => variable_get('akismet_antispambot_rules', NULL),
     '#description' => t('These rules will be applied before sending any request to the <a href="!akismet">Akismet Service</a>. If a request to send content matches any of these rules, the actions defined below will be triggered. Requests to send content are checked against spam that is stored locally (visible from the <a href="!moderation-queue">moderation queue</a>).',
       array(
         '!akismet' => url('http://akismet.com'),
@@ -418,7 +423,7 @@
       'unpublished' => 'n.status = 0',
       'published' => 'n.status = 1'
     );
-    
+
     $sql_nodes_stmt = 'SELECT n.*, u.name, IFNULL(s.content_id, 0) AS spam_mark '. $sql_from .' INNER JOIN {users} u ON n.uid = u.uid '. $sql_where;
     $sql_nodes_cnt = 'SELECT COUNT(*) AS cnt '. $sql_from .' '. $sql_where;
   }
@@ -493,7 +498,7 @@
     $options[$key] = $operation_info['title'];
   }
   $form['options']['operation'] = array('#type' => 'select', '#options' => $options, '#default_value' => '');
-  $form['options']['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
+  $form['options']['submit'] = array('#type' => 'submit', '#value' => t('Moderate'));
 
   if ($mode == 'nodes') {
     $sql_stmt = str_replace('%cond', $sql_nodes_cond[$submode], $sql_nodes_stmt);
@@ -526,7 +531,11 @@
   while ($content = db_fetch_object($result)) {
     if ($mode == 'nodes') {
       $items[$content->nid] = '';
-      $form['title'][$content->nid] = array('#value' => l($content->title, 'node/'. $content->nid, array('title' => truncate_utf8($content->body, 128))) .' '. theme('mark', node_mark($content->nid, $content->changed)));
+      $form['title'][$content->nid] = array(
+        '#value' => l($content->title, 'node/'. $content->nid, array(
+          'attributes' => array(
+            'title' => truncate_utf8($content->body, 128),
+          ))) .' '. theme('mark', node_mark($content->nid, $content->changed)));
       $form['type'][$content->nid] = array('#value' => node_get_types('name', $content));
       $form['author'][$content->nid] = array('#value' => theme('username', $content));
       $form['status'][$content->nid] = array('#value' => ($content->status ? t('published') : t('not published')));
@@ -538,7 +547,13 @@
     else { // comments
       $items[$content->cid] = '';
       $content->name = $content->uid ? $content->registered_name : $content->name;
-      $form['title'][$content->cid] = array('#value' => l($content->subject, 'node/'. $content->nid, array('title' => truncate_utf8($content->comment, 128)), NULL, 'comment-'. $content->cid) .' '. theme('mark', node_mark($content->nid, $content->timestamp)));
+      $form['title'][$content->cid] = array(
+        '#value' => l($content->subject, 'node/'. $content->nid, array(
+          'attributes' => array(
+            'title' => truncate_utf8($content->comment, 128)
+          ),
+          'fragment' => 'comment-'. $content->cid,
+        )) .' '. theme('mark', node_mark($content->nid, $content->timestamp)));
       $form['author'][$content->cid] = array('#value' => theme('username', $content));
       $form['status'][$content->cid] = array('#value' => ($content->status == COMMENT_PUBLISHED ? t('published') : t('not published')));
       if ($content->spam_mark) {
@@ -674,7 +689,8 @@
 
   // Make sure we deal with a valid combination of mode, submode and operation.
   if (!isset($valid_operations[$operation])) {
-    return 'admin/content/akismet';
+    $form_state['redirect'] = 'admin/content/akismet'; 
+    return;
   }
 
   if ($form_state['values']['confirm']) {
@@ -700,10 +716,10 @@
           akismet_content_spam_operation($content_type, $content, 'submit-ham');
         }
 
-        if (in_array($operation, array('unpublish','submit-spam')) && $is_published) {
+        if (in_array($operation, array('unpublish', 'submit-spam')) && $is_published) {
           akismet_content_publish_operation($content_type, $content, 'unpublish');
         }
-        else if (in_array($operation, array('publish','submit-ham')) && !$is_published) {
+        else if (in_array($operation, array('publish', 'submit-ham')) && !$is_published) {
           akismet_content_publish_operation($content_type, $content, 'publish');
         }
 
@@ -713,9 +729,9 @@
     drupal_set_message($message);
   }
 
-  $path = 'admin/content/akismet/'. $mode;
+  $form_state['redirect'] = 'admin/content/akismet/'. $mode;
   if ($submode != 'spam') {
-    $path .= '/'. $submode;
+    $form_state['redirect'] .= '/'. $submode;
   }
-  return $path;
+  return;
 }
Index: akismet.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/akismet/akismet.install,v
retrieving revision 1.5
diff -a -u -r1.5 akismet.install
--- akismet.install	26 May 2008 23:39:16 -0000	1.5
+++ akismet.install	18 Sep 2008 23:16:34 -0000
@@ -2,6 +2,11 @@
 // $Id: akismet.install,v 1.5 2008/05/26 23:39:16 drewish Exp $
 
 /**
+ * @file
+ * Akismet module, installer
+ */
+
+/**
  * Implementation of hook_schema().
  */
 function akismet_schema() {
Index: akismet.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/akismet/akismet.module,v
retrieving revision 1.28
diff -a -u -r1.28 akismet.module
--- akismet.module	13 Jul 2008 07:48:00 -0000	1.28
+++ akismet.module	18 Sep 2008 23:16:39 -0000
@@ -1,5 +1,10 @@
 <?php
-// $Id: akismet.module,v 1.28 2008/07/13 07:48:00 drewish Exp $
+// $Id: akismet.module,v 1.26 2008/05/26 23:41:12 drewish Exp $
+
+/**
+ * @file
+ * Akismet: Uses the Akismet webservice to block spam.
+ */
 
 /**
  * Akismet Drupal and Module versions.
@@ -54,33 +59,33 @@
         ));
       $output .= t('<p>Akismet has caught <strong>@count spam</strong> for you since %since.</p>', array('@count' => akismet_get_spam_counter(), '%since' => akismet_get_counting_since()));
       return $output;
-     case 'admin/content/akismet/nodes/unpublished':
-       $output = t('Below is the list of <strong>unpublished nodes</strong> awaiting for moderation.');
-       $output .= ' '. t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
-       break;
-     case 'admin/content/akismet/nodes/published':
-       $output = t('Below is the list of <strong>published nodes</strong>.');
-       $output .= ' '. t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
-        break;
-     case 'admin/content/akismet/nodes': // spam
-       $output = t('Below is the list of <strong>nodes marked as spam</strong> awaiting for moderation.');
-       $output .= ' '. t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
-       break;
-     case 'admin/content/akismet/comments/unpublished':
-       $output = t('Below is the list of <strong>unpublished comments</strong> awaiting for moderation.');
-       $output .= ' '. t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
-       break;
-     case 'admin/content/akismet/comments/published':
-       $output = t('Below is the list of <strong>published comments</strong>.');
-       $output .= ' '. t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
-       break;
-     case 'admin/content/akismet/comments': // spam
-       $output = t('Below is the list of <strong>comments marked as spam</strong> awaiting for moderation.');
-       $output .= ' '. t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
-       break;
-   }
-   if (arg(0) == 'admin' && arg(1) == 'content '&& arg(2) == 'akismet' && !isset($_POST) && !empty($output)) {
-     $output .= '<br />'. t('<strong>Note:</strong> To interact fully with the <a href="!akismet">Akismet Service</a> you really should try putting data back into the system as well as just taking it out. If it is at all possible, please use the submit <em>ham</em> operation rather than simply publishing content that was identified as spam (false positives). This is necessary in order to let Akismet learn from its mistakes. Thank you.', array('!akismet' => url('http://akismet.com')));
+    case 'admin/content/akismet/nodes/unpublished':
+      $output = t('Below is the list of <strong>unpublished nodes</strong> awaiting for moderation.');
+      $output .= ' '. t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
+      break;
+    case 'admin/content/akismet/nodes/published':
+      $output = t('Below is the list of <strong>published nodes</strong>.');
+      $output .= ' '. t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
+      break;
+    case 'admin/content/akismet/nodes': // spam
+      $output = t('Below is the list of <strong>nodes marked as spam</strong> awaiting for moderation.');
+      $output .= ' '. t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
+      break;
+    case 'admin/content/akismet/comments/unpublished':
+      $output = t('Below is the list of <strong>unpublished comments</strong> awaiting for moderation.');
+      $output .= ' '. t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
+      break;
+    case 'admin/content/akismet/comments/published':
+      $output = t('Below is the list of <strong>published comments</strong>.');
+      $output .= ' '. t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
+      break;
+    case 'admin/content/akismet/comments': // spam
+      $output = t('Below is the list of <strong>comments marked as spam</strong> awaiting for moderation.');
+      $output .= ' '. t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
+      break;
+  }
+  if (arg(0) == 'admin' && arg(1) == 'content '&& arg(2) == 'akismet' && !isset($_POST) && !empty($output)) {
+    $output .= '<br />'. t('<strong>Note:</strong> To interact fully with the <a href="!akismet">Akismet Service</a> you really should try putting data back into the system as well as just taking it out. If it is at all possible, please use the submit <em>ham</em> operation rather than simply publishing content that was identified as spam (false positives). This is necessary in order to let Akismet learn from its mistakes. Thank you.', array('!akismet' => url('http://akismet.com')));
   }
 }
 
@@ -111,7 +116,7 @@
  */
 function akismet_perm() {
   $perms = array('administer akismet settings');
-  
+
   foreach (node_get_types('names') as $type => $name) {
     $perms[] = 'moderate spam in nodes of type '. $name;
   }
@@ -125,7 +130,8 @@
  * Implementation of hook_cron().
  */
 function akismet_cron() {
-  require_once('./'. drupal_get_path('module', 'akismet') . '/akismet_cron.inc');
+  module_load_include('inc', 'akismet', 'akismet_cron');
+  module_load_include('inc', 'comment', 'comment.admin');
   register_shutdown_function('akismet_cron_shutdown');
 }
 
@@ -179,8 +185,8 @@
   $items = array();
 
   $items['admin/settings/akismet'] = array(
-    'title' => t('Akismet'),
-    'description' => t('Use the Akismet Service to protect your site from spam.'),
+    'title' => 'Akismet',
+    'description' => 'Use the Akismet Service to protect your site from spam.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('akismet_settings'),
     'access arguments' => array('administer akismet settings'),
@@ -190,22 +196,22 @@
   $moderator_types = akismet_get_moderator_types();
   if (_akismet_is_moderator($moderator_types)) {
     $items['admin/content/akismet'] = array(
-      'title' => t('Akismet moderation queue'),
-      'description' => t('Manage the Akismet spam queue, appropving or deleting content in need of moderation.'),
+      'title' => 'Akismet moderation queue',
+      'description' => 'Manage the Akismet spam queue, appropving or deleting content in need of moderation.',
       'page callback' => 'akismet_callback_queue',
       'access callback' => '_akismet_is_moderator',
       'access arguments' => array($moderator_types),
       'file' => 'akismet.admin.inc',
-   );
+    );
     $items['admin/content/akismet/overview'] = array(
-      'title' => t('Overview'),
+      'title' => 'Overview',
       'type' => MENU_DEFAULT_LOCAL_TASK,
       'weight' => 0,
       'file' => 'akismet.admin.inc',
     );
     if (_akismet_is_node_moderator($moderator_types)) {
       $items['admin/content/akismet/nodes'] = array(
-        'title' => t('Nodes'),
+        'title' => 'Nodes',
         'page callback' => 'akismet_callback_queue',
         'page arguments' => array('nodes'),
         'access callback' => '_akismet_is_node_moderator',
@@ -215,22 +221,22 @@
         'file' => 'akismet.admin.inc',
       );
       $items['admin/content/akismet/nodes/spam'] = array(
-        'title' => t('Spam'),
+        'title' => 'Spam',
         'page arguments' => array('nodes'),
         'type' => MENU_DEFAULT_LOCAL_TASK,
         'weight' => 0,
         'file' => 'akismet.admin.inc',
       );
       $items['admin/content/akismet/nodes/unpublished'] = array(
-        'title' => t('Unpublished nodes'),
+        'title' => 'Unpublished nodes',
         'page arguments' => array('nodes', 'unpublished'),
         'type' => MENU_LOCAL_TASK,
         'weight' => 1,
         'file' => 'akismet.admin.inc',
       );
       $items['admin/content/akismet/nodes/published'] = array(
-        'title' => t('Published nodes'),
-        'callback arguments' => array('nodes', 'published'),
+        'title' => 'Published nodes',
+        'page arguments' => array('nodes', 'published'),
         'type' => MENU_LOCAL_TASK,
         'weight' => 2,
         'file' => 'akismet.admin.inc',
@@ -238,7 +244,7 @@
     }
     if (_akismet_is_moderator($moderator_types, 'comments')) {
       $items['admin/content/akismet/comments'] = array(
-        'title' => t('Comments'),
+        'title' => 'Comments',
         'page callback' => 'akismet_callback_queue',
         'page arguments' => array('comments'),
         'access callback' => '_akismet_is_moderator',
@@ -248,21 +254,21 @@
         'file' => 'akismet.admin.inc',
       );
       $items['admin/content/akismet/comments/spam'] = array(
-        'title' => t('Spam'),
+        'title' => 'Spam',
         'page arguments' => array('comments'),
         'type' => MENU_DEFAULT_LOCAL_TASK,
         'weight' => 0,
         'file' => 'akismet.admin.inc',
       );
       $items['admin/content/akismet/comments/unpublished'] = array(
-        'title' => t('Unpublished comments'),
+        'title' => 'Unpublished comments',
         'page arguments' => array('comments', 'unpublished'),
         'type' => MENU_LOCAL_TASK,
         'weight' => 1,
         'file' => 'akismet.admin.inc',
       );
       $items['admin/content/akismet/comments/published'] = array(
-        'title' => t('Published comments'),
+        'title' => 'Published comments',
         'page arguments' => array('comments', 'published'),
         'type' => MENU_LOCAL_TASK,
         'weight' => 2,
@@ -469,9 +475,8 @@
         break;
       }
 
-      // Also quit asap, if current user has administration permission
-      // or permission to post without spam checking.
-      if (akismet_is_spam_moderator($node->type) || user_access('post with no akismet checking')) {
+      // Also quit asap, if current user has administration permission.
+      if (akismet_is_spam_moderator($node->type)) {
         akismet_notify_moderators('node', $node, ($node->status ? TRUE : FALSE), FALSE);
         break;
       }
@@ -556,13 +561,7 @@
     if (!akismet_is_spam_moderator('comments')) {
       // ...also check if Akismet connections are enabled.
       if (variable_get('akismet_connection_enabled', 1)) {
-        // This is the simple hook method, *if* we already have the $cid.
         $form['#submit'][] = '_akismet_comment_form_submit';
-        if (!isset($form['cid']) || !isset($form['cid']['#value']) || !is_numeric($form['cid']['#value'])) {
-          // This is a bit more complex, because the user is creating a new comment, so
-          // how can we get the $cid? See comments below, within our own submit callback.
-          $form['#comment_form_param1'] = $form['#submit'];
-        }
       }
       // Inject anti-spambot code, if requested to.
       if (akismet_is_anti_spambot_enabled()) {
@@ -679,7 +678,7 @@
 /**
  * Comment form submit callback; check for spam.
  */
-function _akismet_comment_form_submit($form, &$form_state, $original_submit_callback = NULL) {  
+function _akismet_comment_form_submit($form, &$form_state) {
   // Our default destination. It doesn't need to override the original.
   $goto = NULL;
 
@@ -693,20 +692,7 @@
   // the URL the user should be sent when the form is submitted. It contains the
   // $cid in the last argument, in the form of "comment-$cid", the hash of the URL.
   else {
-    // Invoke the previous submit callbacks and capture their return values to try
-    // to get the $cid from there.
-
-    // The first critical part with this approach is that we have to emmulate the
-    // $form argument that form.inc::drupal_submit_form() expects. At this point in
-    // time, this function just uses the '#submit' element, but that could change in
-    // the future. We have to keep an eye here, or think about a completely different
-    // approach. Hopefully, this one will remain stable during the 4.x lifecycle.
-    $form = array('#submit' => $original_submit_callback);
-
-    // The second critical part is that we expect to find the $cid in the 3rd element
-    // of the $goto array, as described above.
-    $goto = drupal_submit_form($form_id, $form);
-    if (is_array($goto) && isset($goto[2]) && preg_match('#^comment-([0-9]+)$#', $goto[2], $match)) {
+    if (is_array($form_state['redirect']) && isset($form_state['redirect'][2]) && preg_match('#^comment-([0-9]+)$#', $form_state['redirect'][2], $match)) {
       $cid = $match[1];
     }
   }
@@ -744,10 +730,10 @@
 
         // Record the event to watchdog.
         if ($akismet_api_result == AKISMET_API_RESULT_ERROR) {
-          watchdog('content', 'Akismet service seems to be down, comment queued for manual approval: %subject', array('%subject' => $comment->subject), WATCHDOG_WARNING, l(t('view'), 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid));
+          watchdog('content', 'Akismet service seems to be down, comment queued for manual approval: %subject', array('%subject' => $comment->subject), WATCHDOG_WARNING, l(t('view'), 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)));
         }
         else {
-          watchdog('content', 'Spam detected by Akismet in comment: %subject', array('%subject' => $comment->subject), WATCHDOG_WARNING, l(t('view'), 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid));
+          watchdog('content', 'Spam detected by Akismet in comment: %subject', array('%subject' => $comment->subject), WATCHDOG_WARNING, l(t('view'), 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)));
           // If requested to, generate a delay so the spammer has to wait for a while.
           if (($seconds = variable_get('akismet_antispambot_delay', 60)) > 0) {
             sleep($seconds);
@@ -756,9 +742,6 @@
       }
     }
   }
-
-  // Return NULL or the destination returned by the original #submit callback.
-  return $goto;
 }
 
 /**
@@ -1017,14 +1000,17 @@
   $site_name = variable_get('site_name', t('Drupal'));
   if ($content_type == 'comment') {
     if (!($node = akismet_content_load('node', $content->nid))) {
-      watchdog('akismet', 'An error has ocurred while trying to notify moderators about a comment. The associated node could not be loaded.', array(), WATCHDOG_NOTICE, l(t('view'), 'node/'. $content->nid, NULL, NULL, 'comment-'. $content->cid));
+      watchdog('akismet', 'An error has ocurred while trying to notify moderators about a comment. The associated node could not be loaded.', array(), WATCHDOG_NOTICE, l(t('view'), 'node/'. $content->nid, array('fragment' => 'comment-'. $content->cid)));
       return;
     }
     $message_args = array(
       '@title-label' => t('Subject'),
       '@content-title' => $content->subject,
       '@content-type' => t('comment'),
-      '!content-link' => url('node/'. $content->nid, array('fragment' => 'comment-'. $content->cid, 'absolute' => TRUE))
+      '!content-link' => url('node/'. $content->nid, array(
+        'fragment' => 'comment-'. $content->cid,
+        'absolute' => TRUE,
+      )),
     );
   }
   else {
@@ -1032,7 +1018,7 @@
       '@title-label' => t('Title'),
       '@content-title' => $content->title,
       '@content-type' => $moderator_types[$content->type],
-      '!content-link' => url('node/'. $content->nid, array ('absolute' => TRUE))
+      '!content-link' => url('node/'. $content->nid, array('absolute' => TRUE)),
     );
   }
   $message_args['@content-status'] = ($is_published ? t('published') : t('not published')) . ($is_spam ? ' ('. t('marked as spam') .')' : '');
@@ -1260,12 +1246,12 @@
         $target = ($block_settings['newwin'] ? ' target="_blank"' : '');
         $block_args['text'] = array(
           'plain' => array(
-            'short' => t('Proudly protected by Akismet, @count spam caught since @since.', array('@site_name' => variable_get('site_name', 'drupal'), '@count' => $block_args['counter'], '@since' => $block_args['since'])),
-            'long'  => t('@site_name is proudly protected by Akismet, @count spam caught since @since.', array('@site_name' => variable_get('site_name', 'drupal'), '@count' => $block_args['counter'], '@since' => $block_args['since'])),
+            'short' => t('Proudly protected by Akismet. @count spam caught since @since.', array('@site_name' => variable_get('site_name', 'drupal'), '@count' => $block_args['counter'], '@since' => $block_args['since'])),
+            'long'  => t('@site_name is proudly protected by Akismet. @count spam caught since @since.', array('@site_name' => variable_get('site_name', 'drupal'), '@count' => $block_args['counter'], '@since' => $block_args['since'])),
           ),
           'html' => array(
-            'short' => t('Proudly protected by <a href="@akismet"@target>Akismet</a>, @count spam caught since @since', array('@site_name' => variable_get('site_name', 'drupal'), '!akismet' => url('http://akismet.com'), '@target' => $target, '@count' => $block_args['counter'], '@since' => $block_args['since'])),
-            'long'  => t('@site_name is proudly protected by <a href="!akismet"@target>Akismet</a>, @count spam caught since @since', array('@site_name' => variable_get('site_name', 'drupal'), '!akismet' => url('http://akismet.com'), '@target' => $target, '@count' => $block_args['counter'], '@since' => $block_args['since']))
+            'short' => t('Proudly protected by <a href="@akismet"@target>Akismet</a>. @count spam caught since @since', array('@site_name' => variable_get('site_name', 'drupal'), '!akismet' => url('http://akismet.com'), '@target' => $target, '@count' => $block_args['counter'], '@since' => $block_args['since'])),
+            'long'  => t('@site_name is proudly protected by <a href="!akismet"@target>Akismet</a>. @count spam caught since @since', array('@site_name' => variable_get('site_name', 'drupal'), '!akismet' => url('http://akismet.com'), '@target' => $target, '@count' => $block_args['counter'], '@since' => $block_args['since']))
           )
         );
         $text_version = ($block_settings['sitename'] ? 'long' : 'short');
@@ -1438,7 +1424,7 @@
   else { // comment
     $content_id = $content->cid;
     $content_title = $content->subject;
-    $content_link = l(t('view'), 'node/'. $content->nid, NULL, NULL, 'comment-'. $content->cid);
+    $content_link = l(t('view'), 'node/'. $content->nid, array('fragment' => 'comment-'. $content->cid));
     $user_mail = $content->mail;
   }
 
@@ -1514,7 +1500,7 @@
 
     if ($log_action) {
       $action = ($op == 'publish' ? t('Comment published') : t('Comment unpublished'));
-      watchdog('content', '@action: %subject', array('@action' => $action, '%subject' => $content->subject), WATCHDOG_NOTICE, l(t('view'), 'node/'. $content->nid, NULL, NULL, 'comment-'. $content->cid));
+      watchdog('content', '@action: %subject', array('@action' => $action, '%subject' => $content->subject), WATCHDOG_NOTICE, l(t('view'), 'node/'. $content->nid, array('fragment' => 'comment-'. $content->cid)));
     }
   }
 
@@ -1545,7 +1531,7 @@
 
   // Prepare data that varies depending on type of content.
   if ($content_type == 'comment') {
-    $comment_data['permalink'] = url('node/'. $content->nid, array('fragment' => 'comment-'. $content->cid, 'absolute' => TRUE));
+    $comment_data['permalink'] = url('node/'. $content->nid, array('fragent' => 'comment-'. $content->cid));
     $comment_data['comment_author_email'] = $content->mail;
     $comment_data['comment_author_url'] = $content->homepage;
     $comment_data['comment_content'] = $content->comment;
@@ -1694,7 +1680,7 @@
   global $base_url;
   $string = 'blog='. $base_url . base_path();
   foreach ($array as $key => $value) {
-    $string .= '&' . $key . '=' . urlencode(stripslashes($value));
+    $string .= '&'. $key .'='. urlencode(stripslashes($value));
   }
   return $string;
 }
@@ -1716,7 +1702,7 @@
     .'Content-Length: '. strlen($request) ."\r\n"
     .'User-Agent: '. AKISMET_API_USERAGENT ."\r\n"
     ."\r\n"
-    .$request;
+    . $request;
 
   $response = '';
   if (false !== ($fs = @fsockopen($host, AKISMET_API_PORT, $errno, $errstr, $fsock_timeout))) {
Index: akismet_cron.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/akismet/akismet_cron.inc,v
retrieving revision 1.5
diff -a -u -r1.5 akismet_cron.inc
--- akismet_cron.inc	24 Mar 2008 23:31:16 -0000	1.5
+++ akismet_cron.inc	18 Sep 2008 23:16:40 -0000
@@ -2,20 +2,25 @@
 // $Id: akismet_cron.inc,v 1.5 2008/03/24 23:31:16 drewish Exp $
 
 /**
+ * @file
+ * Akismet Cron-run
+ */
+
+/**
  * Shutdown function executed at cron time.
  */
 function akismet_cron_shutdown() {
   watchdog('cron', 'Akismet cron started at %time.', array('%time' => format_date(time(), 'custom', 'H:i:s')));
 
   // Expired content spam that we have to remove from each content repository.
-  $expired_content_spam = array('nids'=>array(), 'cids'=>array());
+  $expired_content_spam = array('nids' => array(), 'cids' => array());
   // Spam marks that we have to remove from the 'spam marks' table.
-  $obsolete_spam_marks = array('nids'=>array(), 'cids'=>array());
+  $obsolete_spam_marks = array('nids' => array(), 'cids' => array());
 
   // Retrieve the list of expired content spam, based on the age specified in the settings panel.
   $expire_spam_age = variable_get('akismet_remove_spam_age', 259200);
   if ($expire_spam_age > 0) {
-    $result = db_result(db_query('SELECT content_type, content_id FROM {akismet_spam_marks} WHERE spam_created < %d', time() - $expire_spam_age));
+    $result = db_query('SELECT content_type, content_id FROM {akismet_spam_marks} WHERE spam_created < %d', time() - $expire_spam_age);
     while ($s = db_fetch_object($result)) {
       $key = ($s->content_type == 'node' ? 'nids' : 'cids');
       $expired_content_spam[$key][] = $s->content_id;
@@ -58,8 +63,8 @@
       }
     }
     if ($delete_count > 0) {
-      $message = t('Akismet housekeeping') .': '. format_plural($delete_count, '1 expired spam node removed from database', '%count expired spam nodes removed from database').
-        '<br />'.t('Node ID List: %nids', array('%nids' => implode(',', $deleted_items)));
+      $message = t('Akismet housekeeping') .': '. format_plural($delete_count, '1 expired spam node removed from database', '%count expired spam nodes removed from database')
+        .'<br />'. t('Node ID List: %nids', array('%nids' => implode(',', $deleted_items)));
       watchdog('cron', $message);
       $clear_cache = TRUE;
     }
@@ -74,8 +79,8 @@
       }
     }
     if ($delete_count > 0) {
-      $message = t('Akismet housekeeping') .': '. format_plural($delete_count, '1 expired spam comment removed from database', '%count expired spam comments removed from database').
-        '<br />'.t('Comment ID List: %cids', array('%cids' => implode(',', $deleted_items)));
+      $message = t('Akismet housekeeping') .': '. format_plural($delete_count, '1 expired spam comment removed from database', '%count expired spam comments removed from database')
+        .'<br />'. t('Comment ID List: %cids', array('%cids' => implode(',', $deleted_items)));
       watchdog('cron', $message);
       $clear_cache = TRUE;
     }
@@ -94,7 +99,7 @@
     db_query('DELETE FROM {akismet_spam_marks} WHERE content_type = \'comment\' AND content_id IN (%s)', $spam_cids_list);
   }
   if ($spam_marks_removed > 0) {
-    $message = t('Akismet housekeeping') .': '. format_plural($spam_marks_removed, '1 spam mark removed from database', '%count spam marks removed from database');
+    $message = t('Akismet housekeeping') .': '. format_plural($spam_marks_removed, '1 spam mark removed from database', '@count spam marks removed from database');
     if (isset($spam_nids_list)) {
       $message .= '<br />'. t('Node ID List: %nids', array('%nids' => $spam_nids_list));
     }
