Jump to content

ask for spam plugin

- - - - -

  • Please log in to reply
2 replies to this topic

#1
leeyo

leeyo

    Newbie

  • Members
  • PipPip
  • 12 posts
I want to find a plugin about spam filter.
first i want to build the word library in my local site.
and can cut words.
such as while has (fuc.k you) in the word library.and the user submit (fuc.k ** you).so certainly it won't match.
and efficient.

(the dot between fuc.k is to stop the codecall from filter this word,and of course it's an example how to ingore the filter)

OR
if you don't know any plugin , you can also write your thought about how program.

i hope you guys know what i mean.god bless.

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#
Plugin to what system?
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#3
Mark Wylde

Mark Wylde

    Learning Programmer

  • Members
  • PipPipPip
  • 46 posts
I would recommend you try something like this. It's how I've done it in the past:
<?php


// A list of all the words you want to ban

$filterlist = array('silly', 'stupid', 'wicked');


// The message you want to filter

$message = 'That silly girl went on a date with that stupid stoopid boy who was wicked.';


// Run the filter function

echo (filtermessage($filterlist,$message));


/* -------------------------------------------------------------------------------

	Function: filtermessage

    Description: Filter out a selection of words from a message and replace

				them with a word of your choice

    Usage:	filtermessage( array('silly'), 'silly person', 'removed');

   ------------------------------------------------------------------------------- */

function filtermessage($filterlist, $message, $replace = '[removed]'){


	foreach($filterlist as $currentword){

		// Remove any words straight out from the list

		$message = eregi_replace(trim($currentword), ' ' . $replace . ' ',$message);


		// Get each individual word

		$words = explode(' ', $message);


		// Check each word for a phonetic match

		foreach($words as $word) {

			if(metaphone(trim($word)) == metaphone(trim($currentword))) {

				$message = eregi_replace($word, ' ' . $replace . ' ',$message);

			}	

		}

	}

	return $message;


}


?>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users