Hi M-DVD
First of all thanks for your work.
I was having a lot of work fighting spammers until I found
www.stopforumspam.com because I administer 10 different forums.
My first idea when I found them was to do a mod myself for SMF, but then I found your mod already done, so if you don't mind I am going to use your mod instead and try to add a few things if I can.
The fist thing I have found is a small mistake in your function
chekDBSpammer.
I found it because I had in one of the forums I administer 600 members before I installed your mod.
In this particular forum 3 months ago there were only 30 members (it was open 2 years ago) and I was sure it was impossible all these 570 new members were all honest ones, so I started checking one by one in
www.stopforumspam.com That's a lot of ctrl+c ctrl+v so I decided to add to your mod a button to check all the members already in the forum in just one "click".
But it didn't work. I was getting all the time the same message some people are reporting here:
An Error Has Occurred! Error with DB Anti SPAM. Connection Failed.Then I did instead a button to check just one member and everything was going right until I arrived to a particular member that was giving me the same error message again all the time.
Then I realized the difference. This member had chosen a username with a white space in the middle.
For example if you check
username=pericolospalotes or
username=perico_los_palotes you get no error, but if you check
username=perico los palotes you get that error.
Then I went to
www.stopforumspam.com and try to check manually that username and found out that their search script had changed it to
username=perico+los+palotesSo the solution is obvious:
I just added the line:
$check_name = str_replace(" ", "+", $check_name);
Just at the beginning of the function, after the line:
global $sourcedir;
And now I have no problem with the buttons and I can check all the 600 members in less than 2 seconds. (By the way, 550 of them were actually spammers. I knew it.)
May be the people that were getting the same error were checking also usernames with white space in the middle. If this is the case it will be sorted just adding that line.
If you want to add to your mod the button to check all the members in the forum, the code I have been using is:
$result = db_query("
SELECT ID_MEMBER, memberName, emailAddress, memberIP
FROM {$db_prefix}members
", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($result))
{
$members[] = array(
'id' => $row['ID_MEMBER'],
'username' => $row['memberName'],
'email' => $row['emailAddress'],
'ip' => $row['memberIP']
);
}
mysql_free_result($result);
foreach ($members as $member)
{
$userid = $member['id'];
$grado_spam = chekDBSpammer($member['ip'], $member['username'], $member['email']);
if ($grado_spam != 0)
{
db_query("
UPDATE {$db_prefix}members
SET is_spammer = $grado_spam
WHERE ID_MEMBER = $userid
", __FILE__, __LINE__);
}
}
Anyway it's not finished, it has a few mistakes.
For example it set
is_spammer = 2 to honest members with common names like
"george" or
"ruth", so I will need to add another button to tell the script
"this member is not spammer" (I have been doing it today changing it manually inside the database, as they were just a few of them) and I will need to finish the HTML to put it properly inside the template (I have been using it in a separate page just linked to the forum via SSI) but it's a start.
Anyway I am more interested in develop a couple of buttons properly done inside the profile page (in admin mode only, of course). One for
"check this user to see if it's a spambot" (if I am suspicious with somebody) and another one for
"Submit this member's details to stopforumspam database" (before I delete a spammer).
If I have some free time and I do them before you do them yourself I will send you the code.
And again congratulations for your work.
I really like the way you write code.
