Support Forums

Old 08-18-2007, 05:24 AM   #1
Senior Member
 
free2take's Avatar
 
Join Date: Mar 2006
Location: Ireland
Posts: 228
Rep Power: 17
free2take is a jewel in the rough
Default Help Filter Ad Theifs

Hi there,

I got some complaints that people were contacting my site users via the site email to try and pull them onto rivals sites, so I did this little bit of code in contact.php to catch these fishing emails.

PHP Code:
$textContent str_replace("##comments##"$comments$textContent);


//Search for .com / .co.uk / .net /.tv etc in comments and if present 
            //redirect contact to webaccount if found, to avoid spammers
            //(if find wblink)
            //{$to = spam account}
            //(end if)
            #
            
$filter = array('.tv','.TV','.net','.co.uk','com','www.','www','WWW','WWW.');
            
//$filter = ('COM');
                        
            
function straipos($haystack$filter$offset=0)
            {
             
$occ= Array();
            
             for (
$i 0;$i<sizeof($filter);$i++)
                      {
                          
$pos strpos($haystack,$filter[$i],$offset);
                        if (
is_bool($pos)) continue;
                        
$occ[$pos] = $i;
                        }
            if (
sizeof($occ)<1) return false;
            
ksort($occ);
            
reset($occ);
            list(
$key,$value) = each($occ);
            return array(
$key,$value);
            }        
                        
            
//Redirect unwanted mails
            
if (straipos($comments$filter0)==true
            {
             
$to "[email protected]";
            }                                    
$mail = new Mailer(); 
Simply make a new email account for your site spammer@... then add any words you want filered out to the list and they get redirected to your spam account. Could be neat to also tie this into the bad words table so you filter those emails aswell not sure if this already happens.

Working great for me but be sure to test in dev first !
__________________
v4.08
free2take is offline   Reply With Quote
Old 11-20-2007, 11:27 AM   #2
Senior Member
 
Join Date: Jan 2007
Posts: 123
Rep Power: 11
HotAir is on a distinguished road
Default

That looks very interesting - I'd like to give it a try.

Where did you add your code in contact.php - to the top or bottom, or someplace else?

Thanks
Jim
__________________
V3.1.10 Developer - live
V4.1.0 Beta 2 - sandbox
HotAir is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modification: Scam Filter civ v3.1 Modules & Modifications 53 10-13-2008 06:16 PM
Registration Filter Module SkGold v3.1 Modules & Modifications 6 01-24-2007 12:25 PM
E-Mail filter and IP/Domain blocking... bgordon v3.1 Modules & Modifications 2 11-10-2006 11:06 PM


All times are GMT -4. The time now is 08:09 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0