MyBB Community Forums

Full Version: Ryan G's Mods And Plugins - Updated for 1.4!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just installed your Akisment plugin. Recently I been under attack at Hackforums.net by a few sites spamming like crazy. I guess that means the site has reached a certain level of success. Today one place made almost 200 posts and unfortunately I wasn't awake at the time. My mods deleted and moved as many posts as possible but they just kept on spamming. I really hope Akismet can detect and auto ban these spammers for me. I will also be adding a moderator tool so that you can ban directly from a user profile. I really don't think it's cool that's not possible now.
labrocca Wrote:Just installed your Akisment plugin. Recently I been under attack at Hackforums.net by a few sites spamming like crazy. I guess that means the site has reached a certain level of success. Today one place made almost 200 posts and unfortunately I wasn't awake at the time. My mods deleted and moved as many posts as possible but they just kept on spamming. I really hope Akismet can detect and auto ban these spammers for me. I will also be adding a moderator tool so that you can ban directly from a user profile. I really don't think it's cool that's not possible now.

The Moderator CP in 1.4 will allow moderators to ban users easily.

Also, you can set after how many times a user is detected as posting spam before they're automatically banned via the Akismet settings. As for automatically detecting. It's the same servers that are used to blog spam on WordPress and other various systems that support Akismet, so that should give you an idea of how it works.
I had to unfortunately disable it. My members were for some reason getting mysql timeouts and didn't seem to be able to post. I am not sure if on the Akismet end it timed out or what but for about 30 minutes my site had 2 posts..I normally get 20-30 and I had members sending me PMs saying they couldn't post.

Here is an example error.

MySQL error: 2006
MySQL server has gone away
Query: SELECT pid FROM mybb_posts WHERE pid='' AND uid='6670' AND visible='-2'MySQL error: 2006
MySQL server has gone away
Query: UPDATE mybb_users SET lastactive='1208376912', timeonline=timeonline+37 WHERE uid='6670' LIMIT 1

And the mysql server was just fine. I even did a repair and optimize but no change. I might try and enable it again though. I really need this.

Do you have any idea what might cause this problem? I haven't really looked over the plugin code too heavily but it looks clean enough.

Oh and the second I disabled Akismet...I had 10+ posts in about 2 minutes.
I don't know what to tell you...

Neither of those queries are even in my akismet plugin.

I'll tell you what though, this is very interesting. I don't think in that query pid should = '' but I can't find a reason why it would suddenly disappear. This is the only function that is called before the pid is set in that query and there's nothing that changes it or unsets it.

function akismet_fake_draft(&$post)
{
	global $mybb, $isspam, $akismet;
	
	$exclude_array = explode(',', $mybb->settings['akismetuserstoignore']);
	
	if($mybb->settings['akismetswitch'] != 'on' || in_array($mybb->user['uid'], $exclude_array))
	{
		return;
	}
	
	if($mybb->settings['akismetfidsignore'])
	{
		$akismet_fids_ignore = explode(',', $mybb->settings['akismetfidsignore']);
		if(in_array($post->data['fid'], $akismet_fids_ignore))
		{
			return;
		}
	}
	
	if($mybb->settings['akismetuidsignore'])
	{
		$akismet_uids_ignore = explode(',', $mybb->settings['akismetuidsignore']);
		if(in_array($mybb->user['usergroup'], $akismet_uids_ignore))
		{
			return;
		}
	}	
	
	$akismet_array = array(
		'type' => 'post',
		'username' => $post->data['username'],
		'email' => $mybb->user['email'],
		'website' => $mybb->user['website'],
		'message' => $post->data['message'],
		'user_ip' => $mybb->user['ipaddress']
	);
	
	if(!$akismet)
	{
		$akismet = new Akismet($mybb->settings['bburl'], $mybb->settings['akismetapikey'],  $akismet_array);
	}
	
	if($akismet->check())
	{
		global $db;
		
		$isspam = true;
		
		// Update our spam count attempts
		++$mybb->user['akismetstopped'];
		$db->update_query(TABLE_PREFIX."users", array('akismetstopped' => $mybb->user['akismetstopped']), "uid = '{$mybb->user['uid']}'");
		
		// Check if the person should be banned
		if($mybb->settings['akismetnumtillban'] > 0 && $mybb->user['akismetstopped'] >= $mybb->settings['akismetnumtillban'])
		{
			$banned_user = array(
				"uid" => $mybb->user['uid'],
				"admin" => "Akismet",
				"gid" => 7,
				"oldgroup" => $mybb->user['usergroup'],
				"dateline" => time(),
				"bantime" => 'perm',
				"lifted" => 'perm',
				"reason" => "Automatically banned by the Akismet system for spamming."
			);
			$db->insert_query(TABLE_PREFIX."banned", $banned_user);
			
			$db->update_query(TABLE_PREFIX."users", array('usergroup' => 7), "uid = '{$mybb->user['uid']}'");
			
			// We better do this..otherwise they have dodgy permissions
			$mybb->user['banoldgroup'] = $mybb->user['usergroup'];
			$mybb->user['usergroup'] = 7;
			
			global $mybbgroups;
			
			$mybbgroups = $mybb->user['usergroup'];
			if($mybb->user['additionalgroups'])
			{
				$mybbgroups .= ','.$mybb->user['additionalgroups'];
			}
		}
		
		// Fake visibility
		// Essentially because you can't modify the $visible variable we need to trick it
	 	// into thinking its saving a draft so it won't modify the users lastpost and postcount
		// In akismet_verify, its set back to -4 so we can still uniquely verify that this is a spam message
		// before it's inserted into the database.
		$post->data['savedraft'] = 1;
	}
}


Can you tell me if the pid is set with akismet not activated?
I've updated Akismet to fix the "MySQL server has gone away" errors. More information can be found here: http://blog.akismet.com/2008/02/25/using-http-11/

Upgrade instructions are simple:

1) Download the latest files from the mods site
2) Replace inc/plugins/akismet.php with the latest
hello tikitiki, i have installed your plugin "private messages admin" and uploaded all files to their folders.
now i have activated the plugin and after clicking on "private messages admin" in the section statistics and logs, i get the error message: "Private Message Admin is currently not activated".

can you help me solving the problem?
greetz
thankyou tikitiki Wink
Akismet Mod 1.1.3, MyBB 1.2.13:

When in ACP I try to unmark ("No Spam" option) messages marked as spam:

Quote:MySQLi error: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
Query: UPDATE mybb_threads SET visible='1' WHERE tid IN ()

What's happened?
I'm using your Private Message Report system but where do I get the reported messages?
I used two of my demo accounts to pm one another and report the messages, but I couldnt find them anywhere in my Admin CP.
Hey, i'm using your private message report system. I PMed from my one demo account to the other demo, and then reported it, but I couldnt find the reported PM anywhere in my Admin CP. Kindly help.