<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>influenced dot net &#187; coopersguns</title>
	<atom:link href="http://www.influenced.net/tag/coopersguns/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.influenced.net</link>
	<description>Mark Hutton</description>
	<lastBuildDate>Wed, 14 Jul 2010 10:59:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Akismet SPAM Filtering in phpBB3</title>
		<link>http://www.influenced.net/2009/06/03/akismet-spam-filtering-in-phpbb3/</link>
		<comments>http://www.influenced.net/2009/06/03/akismet-spam-filtering-in-phpbb3/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 13:15:09 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[akismet]]></category>
		<category><![CDATA[bodybuilding]]></category>
		<category><![CDATA[coopersguns]]></category>
		<category><![CDATA[forums]]></category>
		<category><![CDATA[phpbb3]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.influenced.net/?p=142</guid>
		<description><![CDATA[Recently I&#8217;ve been seeing a shitload of Spambot signups and actual spam postings on my Coopersguns BodyBuilding forums phpBB 3 had a little spam hiatus whilst the spammers cracked the new captcha system, however it&#8217;s obviously been well and truly broken now I decided to clean the forums up and get rid of the spammers. [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been seeing a shitload of Spambot signups and actual spam postings on my <a href="http://www.coopersguns.com/forums/">Coopersguns BodyBuilding forums</a></p>
<p>phpBB 3 had a little spam hiatus whilst the spammers cracked the new captcha system, however it&#8217;s obviously been well and truly broken now</p>
<p>I decided to clean the forums up and get rid of the spammers.  I have employed 2 techniques:</p>
<ol>
<li>A phpBB3 mod called <a href="http://www.phpbb.com/mods/db/download/10115/">daroPL_AntiSpam</a></li>
<li>Some code I quickly conjured up to check with Akismet when a comment is posted</li>
</ol>
<p>I will obviously be talking about the latter here, follows are instructions on how to implement the Akismet check on posts:</p>
<p><strong>If you want to copy &#038; paste the following code snippets, hover over them and click the &#8216;copy&#8217; button</strong></p>
<p>1) Download <a href="http://akismet-php-curl-class.googlecode.com/files/akismet_curl_class.zip">akismet-php-curl-class</a><br />
2) Copy the akismet.curl.class.php from the archive to your phpBB3 forum&#8217;s &#8216;includes&#8217; folder (e.g. ~/public_html/forums/includes)<br />
3) Edit message_parser.php in the &#8216;includes&#8217; folder and make the following changes:</p>
<p>Find:</p>
<pre class="brush: php;">
if (!class_exists('bbcode'))
{
        include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
}
</pre>
<p>After it, insert the following</p>
<pre class="brush: php;">
if (!class_exists('akismet')) {
        include($phpbb_root_path . 'includes/akismet.curl.class.' . $phpEx);
}
</pre>
<p>Find: </p>
<pre class="brush: php;">
// Check number of links
if ($config['max_' . $mode . '_urls'] &amp;&amp; $num_urls &gt; $config['max_' . $mode . '_urls'])
{
	$this-&gt;warn_msg[] = sprintf($user-&gt;lang['TOO_MANY_URLS'], $config['max_' . $mode . '_urls']);
	return (!$update_this_message) ? $return_message : $this-&gt;warn_msg;
}
</pre>
<p>After it, insert the following:</p>
<pre class="brush: php;">
// Akismet SPAM check
if (($user-&gt;data['user_posts']&lt;=6) &amp;&amp; ($user-&gt;data['user_type']==0)) {

	$akismet_comment = array(
	    'comment_type'              =&gt; 'comment',
	    'comment_author'            =&gt; $user-&gt;data['username'],
	    'comment_author_email'      =&gt; $user-&gt;data['user_email'],
	    'comment_author_url'        =&gt; $user-&gt;data['user_website'],
	    'comment_content'           =&gt; $this-&gt;message,
	);

	$akismet = new akismet('YOURAKISMETAPIKEYHERE','http://www.yourforums.com/forums');

	if(!$akismet-&gt;error) {

		if($akismet-&gt;valid_key()) {

			if($akismet-&gt;is_spam($akismet_comment)) {

				$this-&gt;warn_msg[] = $user-&gt;lang['AKISMET_SPAM'];
				$a_to = &quot;you@youraddress.com&quot;;
				$a_subject = &quot;Attempted SPAM Post by &quot;.$user-&gt;data['username'];
				$a_body = $this-&gt;message;
				$a_headers = &quot;From: admin@yourforums.com&quot;;
				mail($a_to, $a_subject, $a_body, $a_headers);

			}

		}

	}

}
</pre>
<p>4) Edit posting.php in the &#8216;language/en/&#8217; folder (obviously you&#8217;ll need to add this to other languages your users use too)</p>
<p>Find:</p>
<pre class="brush: php;">
        'TOO_FEW_CHARS'                         =&gt; 'Your message contains too few characters.',
</pre>
<p>After it, insert the following:</p>
<pre class="brush: php;">
        'AKISMET_SPAM'                  =&gt; 'Your message looks like SPAM.',
</pre>
<p>5) Finished!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.influenced.net/2009/06/03/akismet-spam-filtering-in-phpbb3/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

