RandomByte :: Forum :: Wiki
 
Table of Contents

Info

This is a quick hack to implement Akismet spam checking on phpBB message posts..

Step 1

Copy Akismet.class.php into the base directory of your phpBB install

Step 2

Open posting.php

-- Find --
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
 
-- After, Add --
//Akismet - START
include($phpbb_root_path . 'Akismet.class.php');
//Akismet - END
 
 
-- Find --
prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);
 
-- After, Add --
//Akismet - START
      if ( $error_msg == '' )
      {        
        $akismet = new Akismet('http://www.your-site.net/forum/', 'your-wp-api-key');
        $akismet->setCommentAuthor($username);
        $akismet->setCommentContent($message);         
        if($akismet->isCommentSpam())
            $error_msg = "Error: Your message looks like spam.";
      }  
//Akismet - END
 
 
-- Find --
if( $preview )
 
-- Replace With --
//Akismet - START       
      $akismet = new Akismet('http://www.your-site.net/forum/', 'your-wp-api-key');
      $akismet->setCommentAuthor($username);
      $akismet->setCommentContent($message);       
      if($akismet->isCommentSpam())
          $error_msg = "Error: Your message looks like spam.";
 
//	if( $preview )
  if( $preview and ($error_msg == ''))
//Akismet - END
 
phpbb_akismet.txt · Last modified: 2007/07/24 17:36 by 190.11.130.249
 
Recent changes RSS feed Creative Commons License