68 Classifieds Forums  

Go Back   68 Classifieds Forums > v3.1.x Help & Support > v3.1 Modifications
Register Projects FAQ Members List Calendar Search Today's Posts Mark Forums Read

v3.1 Modifications Questions on modifying 68 Classifieds. Please note these are not supported by 68 Classifieds, and may make future updates more difficult.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-18-2007, 05:24 AM
free2take's Avatar
free2take free2take is offline
Senior Member
 
Join Date: Mar 2006
Location: Ireland
Posts: 172
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, $filter, 0)==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 !
__________________
www.free2take.net
Don't lose it just reuse it!
V 3.1
Reply With Quote
 


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -4. The time now is 04:51 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.