diff -r 000000000000 -r 4d846a385063 plugins/SampleSpamcheck.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/SampleSpamcheck.php Mon Jan 26 11:03:29 2009 -0500 @@ -0,0 +1,43 @@ +attachHook('spam_check', 'sample_spam_check($string, $name, $email, $url, $ip);'); + +function sample_spam_check(&$string, &$name, &$email, &$url, &$ip) +{ + // Define our word list + $words = array('boob', 'titty', 'teenage', 'viagra'); + foreach ( $words as $word ) + { + if ( stristr($string, $word) ) + return false; + } + // This name always means trouble. + if ( $name == 'Pojo' ) + return false; + // Block hotmail e-mail addresses + if ( preg_match('/@hotmail\.com$/', $email) ) + return false; + // Check URL for bad words + foreach ( $words as $word ) + { + if ( stristr($url, $word) ) + return false; + } + // block IPs + if ( $ip == '127.0.1.1') + return false; + + // Always return true if all checks pass! + return true; +}