Page 40 of 43

Re: [01/12/06] Spam Words

Posted: Wed Aug 15, 2007 4:30 am
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

Re: [01/12/06] Spam Words

Posted: Wed Aug 15, 2007 10:49 am
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

Re: [01/12/06] Spam Words

Posted: Wed Aug 15, 2007 9:17 pm
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?

Patches

Posted: Tue Aug 21, 2007 6:24 pm
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.

Re: [01/12/06] Spam Words

Posted: Thu Aug 30, 2007 12:22 am
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.

Re: [01/12/06] Spam Words

Posted: Tue Sep 04, 2007 7:51 pm
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

Re: [01/12/06] Spam Words

Posted: Wed Sep 05, 2007 10:38 am
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....

Error in Edit!

Posted: Thu Sep 20, 2007 6:11 am
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? :?:

Re: [01/12/06] Spam Words

Posted: Thu Sep 20, 2007 7:56 am
by Joe Belmaati
post_flagged = 1, post_flagged = 0
Looks like you messed up the edits in functions_post.php

Re: [01/12/06] Spam Words

Posted: Thu Sep 20, 2007 8:28 am
by wfarmer
Thank you Joe! it must be this part:
enable_sig, post_flagged = $attach_sig

Sould be:
enable_sig = $attach_sig
right?

Re: [01/12/06] Spam Words

Posted: Thu Sep 20, 2007 6:14 pm
by Joe Belmaati
Post the entire line and I will correct it fo you.

Re: [01/12/06] Spam Words

Posted: Fri Sep 28, 2007 2:08 am
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

Re: [01/12/06] Spam Words

Posted: Mon Oct 01, 2007 2:09 pm
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.

Re: [01/12/06] Spam Words

Posted: Tue Oct 02, 2007 8:41 pm
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

Re: [01/12/06] Spam Words

Posted: Fri Oct 05, 2007 12:20 pm
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: