Index: post.php =================================================================== --- post.php (revision 1) +++ post.php (working copy) @@ -219,8 +219,27 @@ $database->setQuery("SELECT review FROM #__sb_categories WHERE id=$catid"); $holdPost=$database->loadResult(); } + // the forum is nt moderated by default, so we check for spam + if ($holdPost == 0) { + include 'Akismet.class.php'; + $WordPressAPIKey = 'xxxxxxxxxxx'; + $MyBlogURL = 'http://bpms.intalio.com'; + $akismet = new Akismet($MyBlogURL ,$WordPressAPIKey); + $akismet->setCommentAuthor($sb_authorname); + $akismet->setCommentAuthorEmail($email); + + $akismet->setCommentType('forum'); + $akismet->setReferrer($_SERVER["HTTP_REFERER"]); + $akismet->setCommentContent($message); + //$akismet->setPermalink('http://www.example.com/blog/alex/someurl/'); + if($akismet->isCommentSpam()){ + $holdPost=1; + } + } + + $database->setQuery("INSERT INTO #__sb_messages (parent,thread,catid,name,userid,email,subject,time,ip,topic_emoticon,hold) VALUES('$parent','$thread','$catid','$sb_authorname','$my_id','$email','$subject','$posttime','$ip','$topic_emoticon','$holdPost')"); if ($database->query()) { @@ -1132,4 +1151,4 @@ \ No newline at end of file +?>