Originally Posted by
Emancipator
As you regulars know I love to write code and I do alot of it. I am however stumped on a SIMPLE and effective method to stop comment spam. I have been looking all over the internet for about the last 2 hours doing reading on it and dont see any really good and EASY to implement solution for comment spam. Keep in mind im not using wordpress or any other prebuilt blogging system. I am just looking for some simple way to obfuscate or block those lame-o spammers.
Feedback with links? Thanks Guys and Gals!
I made a comments component for Joomla with the following features that relate to spam control:
Toggle "registered users post only"
Toggle "force comment preview"
Toggle linking to commenters website (when turned off, the link is a rel=nofollow
Toggle "email mandatory"
Review comments yes/no
On my website I have all these options turned off, except for the email one. I used to get dozens of spam mails on various topics, then I put in the following function in, and since then I am getting no spam messages at all.
In the mean while, friendly visitors can publish feedback on the site instantly.
PHP Code:
if (eregi($common_spam_pat,$mc_comment_name) || eregi($common_spam_pat,$mc_comment_email) || eregi($common_spam_pat,$mc_comment_homepage) || eregi($common_spam_pat,$mc_comment)) {
mosRedirect("index.php?option=content&task=view&id=$id&Itemid=$Itemid", _COM_C_SPAM);
}
This functions compares the form input fields to an array of trigger words, these are my trigger words:
.
.
.
.
/* Profanity warning for the faint-hearted */
.
.
.
.
.
$common_spam_pat= "sleepdeprivation|sleepdisorders|insomnia|phenterm ine|phentemine|vicodin|hydrocodone|levitra|ultram| ultram|cialis|soma|soma|diazepam|gabapentin|celebr ex|viagra|fioricet|ambien|valium|zoloft|finasterid e|lamisil|meridia|allegra|diflucan|zovirax|valtrex |lipitor|proscar|acyclovir|sildenafil|tadalafil|xe nical|melatonin|xanax|herbal|drugs|lortab|adipex|p ropecia|carisoprodol|tramadol|shemale|gangbang|coc k|anal|orgy|cock|anal|orgy|singleschristian|dating christian|cumeating|creampies|cumsucking|cumswappi ng|cumfilled|cumdripping|krankenversicherung|cumpu ssy|suckingcum|drippingcum|pussycum|swappingcum|ea tingcum|cum|cum|sperm|christiandating|jewishsingle s|sexmeetings|swinging|swingers|personals|sleeping |libido|grannies|mature|enhaement|sexual|gayteen|t eenchat|gaychat|adultfinder|adultfriend|friendfind er|friendadult|finderadult|finderfriend|discreteeo unters|cheatingwives|housewives|sex.|snowballing|f at|fat|diet|pills|weight|supplement|texasholdem|po ker|casino|blackjack|mortgage|refinaing|cashadvae| cashmoney|payday|netwasgroup.com|nic4u.com|wear4u. com|foxmediasolutions.com|liveplanets.com|aeternat ech.com|continentaltirebowl.com|chemsymphony.com|i nfolibria.com|globaleducationeurope.net|soma.125mb .com|mitglied.lycos.de|foxmediasolutions.com|jroun dup.com|feathersandfurvanlines.com|conecrusher.org |sbjbroadcasting.com|edthompson.com|codychesnutt.c om|artsmallforsenate.com|axionfootwear.com|protzon beer.com|candiria.com|bigsitecity.com|coresat.com| istarthere.com|amateurvoetbal.net|alleghanyeda.com |xadulthosting.com|datashaping.com|zick.biz|newpri eton.com|dvdsqueeze.com|xopy.com|webdevboard.com|d evaddict.com|eatoni.com|whiteguysgroup.com|guestbo okz.com|webdevsquare.com|indfx.net|snap.to|2y.net| astromagia.info|jixx.de|freesms";
You can add any terms to the list to fight spammers that still get through, and you might have to remove some words if the topic of your site in related to any of em.
Bookmarks