Results 1 to 1 of 1

Thread: Block spam ads / posts based on keyword

  1. #1
    Thread Starter
    Junior Member timkoch's Avatar
    Join Date
    May 2011
    Location
    South Africa
    Posts
    41
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Block spam ads / posts based on keyword

    This is a very easy and effective solution for users who would like to automatically block spam ads based on specific keywords. Very very useful for sites that allow ad posting without registration.

    Open Step2.php. Before ?> <div id="step2"> add the following code:

    Code:
    $content = $postvals['post_content'];
            $keywords = array('abortion', '*****', 'pills');
            foreach ($keywords as $keyword) {
                if (stripos($content, $keyword) !== false) { 
                    die ("<h1 class='dotted'>Ad Blocked</h1><br><p>Your ad contains content that is against the terms and conditions of this website and has therefore been blocked. Please press the back button and change your ad.</p>");
                }
            }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. SPAM! Being flooded with spam accounts and posts.
    By ldesp in forum ClassiPress General Discussion
    Replies: 45
    Last Post: July 16th, 2014, 02:54 PM
  2. email setting change to block spam
    By consignor in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: September 13th, 2012, 09:22 AM
  3. How a Spam Person can Block you from Hotmail and get away with it
    By TheSyndicate in forum ClassiPress General Discussion
    Replies: 3
    Last Post: September 10th, 2012, 07:30 AM
  4. Anti-spam Email block
    By zxen in forum ClassiPress General Discussion
    Replies: 6
    Last Post: April 8th, 2012, 06:13 AM