Stop forum spam for WeBid 1.0

Blocks registrations by people in the stopforumspam database

  1. renlok
    Wasn't made be me but was sent to me by my friend at https://www.acrossad.org/ with permission to share, so enjoy :)

    Title: Stop forum spam for WeBid
    Version(s): 0.8.x
    Credits: Rex Djere (http://www.acrossad.org/)
    Install Time: 5 mins
    Install Difficulty: easy
    Description:
    Demo: https://www.acrossad.org/market/index.php

    If you havn't made edits to your register.php page just upload the two files in the attached zip file. If you have make the edits below and upload registerLog.php.
    If you dont want to log registrations just delete the line
    PHP:
    file_put_contents('registerLog.php',$reportFILE_APPEND); 
    from register.php

    to install:
    in register.php search for
    PHP:
    include $include_path 'banemails.inc.php';
    and after add
    PHP:
    //########################STOP FORUM SPAM PATCH###################################################
    /* This patch blocks any registration if the user's ip or email address
    is found in the Stop Forum Spam database. If you like StopForumSpam's service,
    donate at http://www.StopForumSpam.com/donate */
    function register_check_spammer($username$userip$email){
        
    // all spammer variables default to false unless changed to true by stopforumspam database
        
    $emailIsSpammer "no";
        
    $ipIsSpammer "no";
        
    $realIpIsSpammer "no";
        
    $overallIsSpammer ="no";
        
    $isSpammer FALSE;

        
    // check email address
        
    $content file_get_contents("http://www.stopforumspam.com/api?email=".$email);
        if (
    substr_count($content'yes')!==0)
           
    $emailIsSpammer "<b>yes</b>";
       
           
    // check ip address
        
    $content file_get_contents("http://www.stopforumspam.com/api?ip=".$userip);
        if (
    substr_count($content'yes')!==0)
           
    $ipIsSpammer "<b>yes</b>";
       
        
    // check real ip address
        
    $content file_get_contents("http://www.stopforumspam.com/api?ip=".$_SERVER['REMOTE_ADDR']);
        if (
    substr_count($content'yes')!==0)
           
    $realIpIsSpammer "<b>yes</b>";
       
         if(
    $emailIsSpammer === "<b>yes</b>" || $ipIsSpammer === "<b>yes</b>" || $realIpIsSpammer === "<b>yes</b>")
         {
            
    $isSpammer TRUE;
            
    $overallIsSpammer "<b>yes</b>";
         }
        
    date_default_timezone_set('EST5EDT'); // sets default time zone. Should be set to your timezone or timezone that you wish to see your logs in.
        
    $report "<li><b>date/time logged:</b> ".date("F j, Y, g:i a"). " | <b>name:</b> ".$username." |
            <b>email:</b> "
    .$email." | <b>ip:</b> ".$userip." | <b>realIp:</b> ".$_SERVER['REMOTE_ADDR']." |
            <b>Is spammer(email/ip/realIp/overall)?</b> "
    .$emailIsSpammer."/".$ipIsSpammer."/".$realIpIsSpammer."/".$overallIsSpammer."\r\n";
        
    file_put_contents('registerLog.php',$reportFILE_APPEND); /*registrationLog.php is a report of ALL registrations.
        It should be protected from public viewing by a strong password.*/


        
    return $isSpammer;
    }
    //########################STOP FORMU SPAM PATCH###################################################
    then find
    PHP:
    if ($system->SETTINGS['spam_register'] == && !$resp->is_valid)
            {
                
    $ERR $MSG['752'];
            }
    and before it add
    PHP:
    // register_check_spammer is called below to check the user's data against the stop forum spam database
            
    if (register_check_spammer($_POST['TPL_nick'], $_SERVER['REMOTE_ADDR'], $_POST['TPL_email'])== TRUE)
            {
                
    $TPL_err 1;
                
    $TPL_errmsg "Sorry, your registration could not be processed.";
            }
            else
    To find out more about stopforumspam check out
    http://www.stopforumspam.com/donate help them out if you have heavy traffic & spare cash
    http://www.stopforumspam.com/contact
    http://www.stopforumspam.com/apis info about adding spammers to thier database