So I really forgot all about this "mod" but after Peter77sx sent me a friendly reminder I figured I'd update it, plus rewrite this whole post.
The changes here are for AntiSpam ACP by Exreaction (get the mod at Lithium Studios) version 1.0.3 PL1.
The stop forum spam by default in AntiSpam ACP checks usernames and email addresses submitted, not IPs, also, when it gets a positive, it just says:
These quick changes adds in checking against blacklisted IP addresses, and Email address, and removes username checking (since I feel blacklisting userOne or more of the fields entered was marked as spam.
names is a bad way of doing things).
Keep in mind I'm a noob at php and the code is a bit messy, but it should work. I did these changes once before on my board and it worked. The changes I am posting here I believe are the same I use, but I don't have an active phpBB install so I haven't tested. So if you do these changes and it doesn't work for ya let me know .
Step 1. Install latest version AntiSpam ACP v1.0.3 PL1.
Step 2. Open the file /antispam/asacp.php
Step 3. Find this:
Code: Select all
// Stop Forum Spam stuff
if (!sizeof($error) && $config['asacp_sfs_action'] > 1)
{
if (!function_exists('get_remote_file'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
$stop_forum_spam_urls = array(
'api?username=' . urlencode($data['username']),
'api?email=' . urlencode($data['email']),
//'api?ip=' . $user->ip,
);
foreach ($stop_forum_spam_urls as $url)
{
$errstr = $errno = '';
$file = get_remote_file('stopforumspam.com', '', $url, $errstr, $errno);
if ($file !== false)
{
$file = str_replace("\r\n", "\n", $file);
$file = explode("\n", $file);
$appears = $frequency = false;
foreach ($file as $line)
{
if (strpos($line, '<appears>') !== false && strpos($line, '</appears>') !== false)
{
$start = strpos($line, '<appears>') + 9;
$end = strpos($line, '</appears>') - $start;
$appears = (substr($line, $start, $end) == 'yes') ? true : false;
}
else if (strpos($line, '<frequency>') !== false && strpos($line, '</frequency>') !== false)
{
$start = strpos($line, '<frequency>') + 11;
$end = strpos($line, '</frequency>') - $start;
$frequency = (int) substr($line, $start, $end);
}
}
if ($appears && $frequency >= $config['asacp_sfs_min_freq'])
{
self::$sfs_spam = true;
}
}
}
if (self::$sfs_spam)
{
switch ($config['asacp_sfs_action'])
{
case 3 :
$config['require_activation'] = USER_ACTIVATION_SELF;
break;
case 4 :
$config['require_activation'] = USER_ACTIVATION_ADMIN;
break;
case 5 :
$user->add_lang('mods/asacp');
$error[] = $user->lang['PROFILE_SPAM_DENIED'];
break;
}
}
}
Code: Select all
// Stop Forum Spam stuff
if (!sizeof($error) && $config['asacp_sfs_action'] > 1)
{
if (!function_exists('get_remote_file'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
$stop_forum_spam_urls = array(
//'api?username=' . urlencode($data['username']),
'api?email=' . urlencode($data['email']),
//'api?ip=' . $user->ip,
);
foreach ($stop_forum_spam_urls as $url)
{
$errstr = $errno = '';
$file = get_remote_file('stopforumspam.com', '', $url, $errstr, $errno);
if ($file !== false)
{
$file = str_replace("\r\n", "\n", $file);
$file = explode("\n", $file);
$appears = $frequency = false;
foreach ($file as $line)
{
if (strpos($line, '<appears>') !== false && strpos($line, '</appears>') !== false)
{
$start = strpos($line, '<appears>') + 9;
$end = strpos($line, '</appears>') - $start;
$appears = (substr($line, $start, $end) == 'yes') ? true : false;
}
else if (strpos($line, '<frequency>') !== false && strpos($line, '</frequency>') !== false)
{
$start = strpos($line, '<frequency>') + 11;
$end = strpos($line, '</frequency>') - $start;
$frequency = (int) substr($line, $start, $end);
}
}
if ($appears && $frequency >= $config['asacp_sfs_min_freq'])
{
self::$sfs_spam = true;
}
}
}
if (self::$sfs_spam)
{
switch ($config['asacp_sfs_action'])
{
case 3 :
$config['require_activation'] = USER_ACTIVATION_SELF;
break;
case 4 :
$config['require_activation'] = USER_ACTIVATION_ADMIN;
break;
case 5 :
$user->add_lang('mods/asacp');
$error[] = $user->lang['PROFILE_SPAM_DENIED_EMAIL'];
break;
}
}
}
// Stop Forum Spam stuff
if (!sizeof($error) && $config['asacp_sfs_action'] > 1)
{
if (!function_exists('get_remote_file'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
$stop_forum_spam_urls = array(
//'api?username=' . urlencode($data['username']),
//'api?email=' . urlencode($data['email']),
'api?ip=' . $user->ip,
);
foreach ($stop_forum_spam_urls as $url)
{
$errstr = $errno = '';
$file = get_remote_file('stopforumspam.com', '', $url, $errstr, $errno);
if ($file !== false)
{
$file = str_replace("\r\n", "\n", $file);
$file = explode("\n", $file);
$appears = $frequency = false;
foreach ($file as $line)
{
if (strpos($line, '<appears>') !== false && strpos($line, '</appears>') !== false)
{
$start = strpos($line, '<appears>') + 9;
$end = strpos($line, '</appears>') - $start;
$appears = (substr($line, $start, $end) == 'yes') ? true : false;
}
else if (strpos($line, '<frequency>') !== false && strpos($line, '</frequency>') !== false)
{
$start = strpos($line, '<frequency>') + 11;
$end = strpos($line, '</frequency>') - $start;
$frequency = (int) substr($line, $start, $end);
}
}
if ($appears && $frequency >= $config['asacp_sfs_min_freq'])
{
self::$sfs_spam = true;
}
}
}
if (self::$sfs_spam)
{
switch ($config['asacp_sfs_action'])
{
case 3 :
$config['require_activation'] = USER_ACTIVATION_SELF;
break;
case 4 :
$config['require_activation'] = USER_ACTIVATION_ADMIN;
break;
case 5 :
$user->add_lang('mods/asacp');
$error[] = $user->lang['PROFILE_SPAM_DENIED_IP'];
break;
}
}
}
Step 4. Open /language/en/mods/asacp.php
Step 5. On line 44 find:
Code: Select all
'PROFILE_SPAM_DENIED' => 'One or more of the fields entered was marked as spam.',
Code: Select all
'PROFILE_SPAM_DENIED_EMAIL' => 'The email address you have entered has been blacklisted as a spammer at <a href=\'http://stopforumspam.com/\'>StopForumSpam.com</a> and thus, registration has been blocked. If you feel this is incorrect please contact the Board Administrator via email to have your account registered, you can also visit <a href=\'http://stopforumspam.com/\'>StopForumSpam.com</a> to find more details about this and find out how to be removed so you don\'t experience this issue on future website.',
'PROFILE_SPAM_DENIED_IP' => 'The IP address you are registering from has been blacklisted as a spammer at <a href=\'http://stopforumspam.com/\'>StopForumSpam.com</a> and thus, registration has been blocked. If you feel this is incorrect please contact the Board Administrator via email to have your account registered, you can also visit <a href=\'http://stopforumspam.com/\'>StopForumSpam.com</a> to find more details about this and find out how to be removed so you don\'t experience this issue on future website.',
NOTE: You can change the array to you liking to say what you want it to say.
And that be it. Setup stopforumspam.com settings in the ACP and it should work. You can test by using an email like [email protected] and test the IP block by using a well know proxy that is blacklisted.
Hope this helps .