Recent Topics

1 Nov 26, 2008 09:55    

My b2evolution Version: 2.x

I currently use Turing test on my site, but I keep getting spammed by people who use the smilies on the comments form, type in a bunch of random letters and then submit the comment. How can I avoid this? Should I just remove the smilies option from the comments form? Or is there a way to get the blogging platform to recognise the repeated use of smilies as spam?

2 Nov 29, 2008 06:21

Here's a hack, it sets comment status to 'draft' if the message has more than 3 smiles. You can also set it to reject 'bad' comments.

Add the following code in plugins/_smilies.plugin.php on line 68 after 'PluginInit' function and reload plugins.

function BeforeCommentFormInsert( & $params )
{
	if( $params['action'] == 'save' )
	{
		$params['data'] = $params['original_comment'];
		$this->RenderItemAsHtml( $params );
		
		if( @preg_match_all( '/<img/', $params['data'], $matches ) )
		{	// 3 - max. allowed number of smiles in comment
			if( count($matches[0]) > 3 )
			{	// Too many smiles
				// Set comment status to 'draft'
				$params['Comment']->status = 'draft';
				// Uncomment the following line to reject 'bad' comments
				//$this->msg( 'Bad comment', 'error' );
			}
		}
	}
}

3 Nov 29, 2008 08:14

Thank you so much sam2kb! That works like a charm!!!

:)

4 Nov 29, 2008 08:19

Hello.

I'm pretty new to b2evo as I'm still configuring it. Can you describe a bit more how smileys are being used for spam, please?

Thanks in advance.

5 Nov 29, 2008 08:26

This is a sort of strange thing. Some people have been visiting my site and not liking what they see and decide to leave comments using only smileys and random letters.

Basically, I have several anti-spam functions; one which checks a blacklist of terms, a ‘turing test’ (the ‘what colour is the sky’ question), plus an IP address checker which ensures robots don’t abuse the site. All three work really well, and I actually never receive spam. The only time I do it seems was lately with these smiley comments; and I know they’re not robots because I can track people from Google searches, to my site, to their views on the site, to leaving a dud comment and exiting. So yeah, it’s just some nasty people having too little time and not enough sense.

Anyway, it's not the fault of b2evolution, I actually never get spammed. It's just the fault of a couple of people out there who abuse my commenting system because they don't like my site.

... Hope that makes sense :)

I've been using b2evo for about 2 years now and couldn't recommend it more.

6 Nov 29, 2008 08:32

Wow, how weird.

Thanks for the info!

7 Nov 29, 2008 08:34

Entirely weird. Hopefully the above code will end the problem though.

You're welcome!

8 Jan 14, 2009 07:57

When I get comments that I'd rather not put up with and know they're from a human being out there, my response is to edit their comment then reply. My "edit" will not be simple correction - I cause the commenter to express ignorance and ineptitude. Eventually the commenter realizes they can't win because I can edit and delete and all they can do is try again.

Remember that in this case you are dealing with a human who is actually focusing on you, so make damned sure they know "oh man I can't win here so I might as well do something else".


Form is loading...