[01/12/06] Spam Words

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
52
76%
Very Good
9
13%
Good
4
6%
Fair
0
No votes
Poor
3
4%
 
Total votes: 68

TwiZted22
Registered User
Posts: 9
Joined: Thu Aug 09, 2007 1:25 am

Re: [01/12/06] Spam Words

Post by TwiZted22 »

I keep getting this error every time I try to post an edited topic. Any ideas?
GENERAL ERROR:

Error in posting

DEBUG MODE

SQL 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 ' post_flagged = 1, 0, post_flagged = 0 WHERE post_id = 226' at l

UPDATE phpbb_posts SET post_username = '', enable_bbcode = 1, enable_html = 1, enable_smilies = 1, enable_sig, post_flagged = 1, 0, post_flagged = 0 WHERE post_id = 226

Line : 241
File : functions_post.php
Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Re: [01/12/06] Spam Words

Post by Joe Belmaati »

It looks like you have foo-bar'ed one of the edits in functions_post.php
SQL 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 ' post_flagged = 1, 0, post_flagged = 0 WHERE post_id = 226' at l
Image
TwiZted22
Registered User
Posts: 9
Joined: Thu Aug 09, 2007 1:25 am

Re: [01/12/06] Spam Words

Post by TwiZted22 »

Joe Belmaati wrote:It looks like you have foo-bar'ed one of the edits in functions_post.php
SQL 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 ' post_flagged = 1, 0, post_flagged = 0 WHERE post_id = 226' at l
I'm guessing I need to delete something in that line?
frisco82
Registered User
Posts: 1
Joined: Tue Aug 21, 2007 5:59 pm

Patches

Post by frisco82 »

I have been working on a full mod version of Smap words + Akismet Hack (also included a couple of patches posted here) with config and pre-register support for Akismet.

I think it is finished but I will test a couple of days in my live board to see if any other problem arises.

I found a couple of glitches, the first is the mass add feature that after the suggested patch it splitted the words in weird chunks without meaning I just use as separators what it is explained in the description (comma, semi-colon, or line-break). So in admin_spamwords.php:

[ FIND ]

Code: Select all

			$list = preg_split("#[^A-Za-z-]#", $HTTP_POST_VARS['massad']);
[ REPLACE ]

Code: Select all

            $list = preg_split("#[,;\n]#", $HTTP_POST_VARS['massad']);
Also in the hack you made to add checks during registration, the checks are inserted just in the middle of the file so it is called every time the register page is loaded (3 times during register process). So the fixed instrucions should be:

Code: Select all

#
## ADDED FOR CHECK UPON REGISTERING
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$error = FALSE;
$error_msg = '';
#
#-----[ BEFORE, ADD ]------------------------------------------
#
function spamcheck($param)
{
   global $db;
   
   $sql = "SELECT * FROM " . SPAM_WORDS_TABLE;
   if (!($result = $db->sql_query($sql)))
   {
      message_die(GENERAL_ERROR, 'Could not get spam words from database', '', __LINE__, __FILE__, $sql);
   }

   $param = preg_replace("#\[.{12,16}\]#i", '', $param);
   $param = preg_replace('/\[url\]|\[\/url\]/si', '', $param);
   $param = preg_replace('#\[url=|\]|\[/url\]#si', '', $param);
   
   if ($row = $db->sql_fetchrow($result))
   {
      do
      {
         if (preg_match('#\b(' . str_replace('\*', '\w*?', phpbb_preg_quote($row['spam_word'], '#')) . ')\b#i', $param))
         {
            message_die(GENERAL_ERROR, 'Not allowed. Spam detected.');
         }
      }
      while ($row = $db->sql_fetchrow($result));
   } 
}

#
#-----[ FIND ]------------------------------------------
#
		$avatar_sql = user_avatar_gallery($mode, $error, $error_msg, $user_avatar_local, $user_avatar_category);
	}

	if ( !$error )
	{
#
#-----[ AFTER, ADD ]------------------------------------------
#
if($mode == 'register')
{
	$check_fields = array($username, $email, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature);
      array_map('spamcheck', $check_fields);
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
I hope this will help others.
kato1o
Registered User
Posts: 1
Joined: Wed Aug 29, 2007 7:34 am

Re: [01/12/06] Spam Words

Post by kato1o »

I've installed the mod and everything seemed to install ok...
except, i am unable to save any submitted changes to my configuration.
after I click submit, it says :
Spam words configuration updated

Click Here to return to Spam Word Configuration

Click Here to return to the Admin Index

but then when i try to test it by logging on as a different user, and putting spam in the message, I'm supposed to receive an error message. However, it lets the spam get through and posts it, although it keeps it in the log as containing spam words.
and then when i go back to the configuration panel, none of my changes were saved! :(

if anyone can help me with this issue, i'd love it.
crag364
Registered User
Posts: 97
Joined: Thu Jul 26, 2007 1:24 pm

Re: [01/12/06] Spam Words

Post by crag364 »

Hi,

I tried installing this mod today as its just what I need but now when you try and post you get this message:

Code: Select all

Error in posting

DEBUG MODE

SQL Error : 1136 Column count doesn't match value count at row 1

INSERT INTO phpbb_posts (topic_id, enable_smilies, enable_sig, post_flagged, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES (788, 13, 5, '', 1188933401, '57c2c84e', 1, 1, 1, 0, 0)

Line : 240
File : functions_post.php
I've checked the code in functions_post.php and it all seems ok. Can anyone give me any pointers?

Many thanks,

Craig
Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Re: [01/12/06] Spam Words

Post by Joe Belmaati »

crag364 wrote:Hi,

I tried installing this mod today as its just what I need but now when you try and post you get this message:

Code: Select all

Error in posting

DEBUG MODE

SQL Error : 1136 Column count doesn't match value count at row 1

INSERT INTO phpbb_posts (topic_id, enable_smilies, enable_sig, post_flagged, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES (788, 13, 5, '', 1188933401, '57c2c84e', 1, 1, 1, 0, 0)

Line : 240
File : functions_post.php
I've checked the code in functions_post.php and it all seems ok. Can anyone give me any pointers?

Many thanks,

Craig
Well, that code snip is definitely foo-bar'ed. You've got enable_sig twice there....
Image
wfarmer
Registered User
Posts: 2
Joined: Thu Sep 20, 2007 6:07 am

Error in Edit!

Post by wfarmer »

whenever anyone try's to edit thier post this keeps coming up

Code: Select all

Error in posting

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near ' post_flagged = 1, post_flagged = 0 WHERE post_id = 196908' at line 1

UPDATE posts SET post_username = '', enable_bbcode = 1, enable_html = 1, enable_smilies = 1, enable_sig, post_flagged = 1, post_flagged = 0 WHERE post_id = 196908

Line : 241
File : functions_post.php 

How can this be solved? :?:
Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Re: [01/12/06] Spam Words

Post by Joe Belmaati »

post_flagged = 1, post_flagged = 0
Looks like you messed up the edits in functions_post.php
Image
wfarmer
Registered User
Posts: 2
Joined: Thu Sep 20, 2007 6:07 am

Re: [01/12/06] Spam Words

Post by wfarmer »

Thank you Joe! it must be this part:
enable_sig, post_flagged = $attach_sig

Sould be:
enable_sig = $attach_sig
right?
Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Re: [01/12/06] Spam Words

Post by Joe Belmaati »

Post the entire line and I will correct it fo you.
Image
lancevance
Registered User
Posts: 10
Joined: Thu Jun 10, 2004 4:00 pm

Re: [01/12/06] Spam Words

Post by lancevance »

I need to turn off the log, it has gotten too big.
I am getting the following message : Fatal error: Allowed memory size of 10485760 bytes exhausted (tried to allocate 4554726 bytes) in /ooxxzz/admin_spamwords_log.php on line 241

Thanks!
-=Steve Myers
Nothing is easy
Registered User
Posts: 173
Joined: Sun Apr 02, 2006 1:10 am

Re: [01/12/06] Spam Words

Post by Nothing is easy »

You don't need to turn the log off. Just open the log in the ACP and select the delete function which then deletes all entries in the log.


2 Questions for Joe though.

1) Is there a maximum for the number of spam word entries? I have over 1000 now and was just concerned that I may reach a maximum.

2) I installed your patch that checks the registration fields. Is there a way that I can get it to create a log entry (making use of the existing log fields) with say the registration email address and the offending word found?

Finally, I know I have asked this before but a 3.0 version of this would be great. It seems that people are complacent because of lack of spam using the 3.0 RC versions but your mod goes further than just dealing with bots by preventing spam from real users. It has stopped my competitor sites from spamming me completely (the log shows their attempts being blocked).

So any chance of either you or someone else creating a 3.0 version? I created the 3.0 Mod request but there has been a lack of response.
lancevance
Registered User
Posts: 10
Joined: Thu Jun 10, 2004 4:00 pm

Re: [01/12/06] Spam Words

Post by lancevance »

I need to turn off the log, it has gotten too big. I can not view that log because of the following message : Fatal error: Allowed memory size of 10485760 bytes exhausted (tried to allocate 4554726 bytes) in /ooxxzz/admin_spamwords_log.php on line 241

I want to keep using phpBB Spam Words, but with out the log function.


Thanks!
-=Steve Myers
Nothing is easy
Registered User
Posts: 173
Joined: Sun Apr 02, 2006 1:10 am

Re: [01/12/06] Spam Words

Post by Nothing is easy »

lancevance wrote:I need to turn off the log, it has gotten too big. I can not view that log because of the following message : Fatal error: Allowed memory size of 10485760 bytes exhausted (tried to allocate 4554726 bytes) in /ooxxzz/admin_spamwords_log.php on line 241

I want to keep using phpBB Spam Words, but with out the log function.


Thanks!
-=Steve Myers
From the pm you sent me it would appear that you are not asking your question the way it should be phrased to get the answer you want.
Your pm to me said:
lancevance wrote:Did you read my post?/ I can't open phpBB Spam Words in the ACP. DUH!
Yes I did read your post and was trying to help. Your original post said nothing about not being able to open Spam Words in the ACP and nor does your re-post. It talks about the log becoming too big. Spam Words is one file and the Log is another. So as phrased I would still have answered the same way.

Or if it really is the Log that you can't open then just use phpmyadmin to delete the entries from the log or run an SQL script to delete the entries and then remember to delete the entries using the delete function periodically.

btw including a DUH! in a response is not exactly condusive to receiving help is it? :roll:
Post Reply

Return to “[2.0.x] MOD Database Releases”