В отдельном файле spam_filtr.php рисуется функция:
Код: Выделить всё
<?php
function spam_test($message){
$ignortxt[1] = 'vova@mail.ru';
// $ignortxt[] = 'ecosun.org';
$ignortxt[] = '<h1><strong>';
$ignortxt[] = '<a href';
$ignortxt[] = 'viagra';
$ignortxt[] = 'xanax';
$ignortxt[] = 'good site';
$ignortxt[] = 'Vali';
$ignortxt[] = 'agra';
$ignortxt[] = 'hotmail.com';
$ignortxt[] = 'yahoo.com';
$ignortxt[] = 'yandex.com';
$ignortxt[] = 'tramadol';
$ignortxt[] = 'mkostya';
$ignortxt[] = 'free20';
$ignortxt[] = 'k7.pl';
$ignortxt[] = 'phenterm';
$ignortxt[] = 'poker';
$ignortxt[] = 'aol.com';
$ignortxt[] = 'freewebs';
$ignortxt[] = 'casino';
$ignortxt[] = 'rohostin';
$ignortxt[] = 'blogspot.com';
$ignortxt[] = 'Куплю Windows Куплю Office';
// $ignortxt[] = 'gmail.com';
// здесь аналогично вставлять свои строки,
// наличие которых интерпретируется как спам
$IgnoreFlag=FALSE;
$inn = 1;
while (isset($ignortxt[$inn])){
if (strstr($message,$ignortxt[$inn])){$IgnoreFlag = 1;};
$inn++;};
if ($IgnoreFlag == 1){$IgnoreFlag=TRUE;};
// отсечение постов со множеством ссылок
if (count(split("http://",$message)) > 11){$IgnoreFlag=TRUE;};
// более 10 ссылок фильт сделать не даст.
// Если надо больше - правоть цифру "11"
return ($IgnoreFlag);
};
?>
Код: Выделить всё
В файле includes/funcrion_post.php
### После строк:
//
// This function will prepare a posted message for
// entry into the database.
//
### Вставить строку:
include ('includes/spam_filtr.php');
### Далее, в этом же файле, после строк:
// Check message
### вставить:
if (spam_test($message)){die('Спамеры идут лесом-лесом-полем-лесом!');};
// тут можно и свой текст вставить, кто на что горазд
SPAM-фильтр готов! И работает!

P.S. Возможно, я что-то сделал криво, ибо ламер, пусть уважаемые Гуру поправят, как лучше.
В список запретных строк можно вписать и маты, а форумчан предупредить, что маты будут отсекаться как спам.