Check Website
Inclusion Status
It is currently Sun Aug 19, 2018 6:05 am

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: [CODE] Integrating the spam filter into SMF v2.0
PostPosted: Thu Sep 13, 2012 9:32 pm 
Offline
Site Admin

Joined: Thu May 28, 2009 10:25 am
Posts: 6016
Open /sources/register.php

Find (approx line #363);

Code:
// Include the additional options that might have been filled in.
foreach ($possible_strings as $var)


Add BEFORE;

Code:
   /// BEGIN SPAM MOD
   $username = $_POST['user'];
   $emailaddr = $_POST['email'];
   $ip = $_SERVER['REMOTE_ADDR'];
   // Either use the existing URL, or download a copy of the check_spammers.zip file to your server and use that instead.
   //
   // http://temerc.com/forums/viewtopic.php?f=71&t=6103
   //
   $fspamcheck = file_get_contents('http://temerc.com/Check_Spammers/check_spammers_plain.php?name='.$username.'&email='.$emailaddr.'&ip='.$ip);
   if (strpos($fspamcheck, 'TRUE') !==False) {
      // Notify admin via e-mail
      $blockedby = str_replace(' TRUE', '', $fspamcheck);
      $blockedby = str_replace(' ', ' & ', $blockedby);
      $msg = 'The following was blocked by the '.$blockedby.' filter<br><br>Username: '.$username.'<br><br>Email: '.$emailaddr.'<br><br>IP: '.$ip;
      // Change your@email.addr to the e-mail address you want e-mail reports sent to
      $to = "your@email.addr";
      $from = "nobody@".$_SERVER['SERVER_NAME'];
      $subject = "Spammer blocked by hpHosts Spam filter";
      $headers =    "MIME-Versin: 1.0\r\n" .
      "Content-type: text/html; charset=ISO-8859-1; format=flowed\r\n" .
      "Content-Transfer-Encoding: 8bit\r\n" .
      "From: " . $from . "\r\n" .
      "X-Mailer: hpHosts Spam Filter";
      // Important: If you do NOT want email notifications, add // to the beginning of the following line.
      mail($to, $subject, $msg, $headers);
      // Notify user
      fatal_lang_error('known_spammer_blocked');
      // You could always redirect them to a custom error if you prefer, by commenting out the above, and uncommenting the following.
      // redirectexit('banned.html');
   }
   /// END SPAM MOD


Open /Themes/default/languages/index.english.php

Find;

Code:
$txt['debug_hide_queries'] = '[Hide Queries]';


Add AFTER;

Code:
$txt['known_spammer_blocked'] = 'Spam registration blocked';


If you are hosting the SBST locally, then change;

http://temerc.com/Check_Spammers/check_spammers_plain.php

to;

http://YOUR_DOMAIN/PATH_TO_CHECK_SPAMMERS/check_spammers_plain.php

_________________
Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Keeping it FREE!



IP:
top
Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
hpHosts and hpHosts Online are copyright © Malwarebytes Corp - All Rights Reserved

Powered by phpBB © 2000-2009 phpBB Group