Posted: 12/08/2009 07:12 AM
Filtering out Emails and URLs from Messages
Ramil just did his thing to help me stop three type of spammers/hustlers to my site.
1. Female hustler who provides members her email account so they can hustle the poor soul on her own turf
2. Male hustlers (we have a few) who are equivalent to female hustlers promising the ladies a job, visa, etc for their precious pennies (I can't believe we have men trying to hustle poor Asian women).
3. Webmaster spammers who spam my site with their site URL to steal members.
INSTRUCTIONS (note: tested on 2.5.3 but should work on all 2.5.x versions - always backup before making changes)
FNS.MISC.PHP
Open: includes/fns/fns.misc.php
Find: preg_quote($word,'/')
Replace with: $word
Control Panel
Now we need to make sure we add the filter and that your settings are correct in your control panel. Note that the following instructions are for 2.5.3. If you are using a different version of vldPersonals, your settings may be located in a different area of the CP.
ADDING THE FILTER IN THE CP:
Go to: Settings - Member modules - from drop down choose Messaging - add the following code to your Filtered words to block out emails and URLs from messages:
[A-Za-z0-9_\.\-]+@[A-Za-z0-9_\.\-]+\.[A-Za-z]{2,6}
[A-Za-z0-9_\.-]+\.[a-zA-Z]{2,4}
CHECKING YOUR PERMISSIONS
Your permissions are probably set correctly by default, but if you want to check to be sure, do this in your CP:
- CP - Settings - member groups - Admins - Member Profile Privileges - Enforce Word Filter = No
- CP - Settings - member groups - Regular Members - Member Profile Privileges - Enforce Word Filter = Yes
Continue checking/setting privileges as you desire for each group. In the above, most webmasters would have the Admin setting set to NO so the admin is not filtered. However, for all other groups you would want to set the filter to YES for each group you want to filter out emails and URLs when they send a message.
TESTING
If you want to test it out, be sure to do so as Regular members (not admin). You may have to create some dummy accounts to test.
Thanks Ramil...I know it took you some time to research and figure this out. I appreciate your support and effort
1. Female hustler who provides members her email account so they can hustle the poor soul on her own turf
2. Male hustlers (we have a few) who are equivalent to female hustlers promising the ladies a job, visa, etc for their precious pennies (I can't believe we have men trying to hustle poor Asian women).
3. Webmaster spammers who spam my site with their site URL to steal members.
INSTRUCTIONS (note: tested on 2.5.3 but should work on all 2.5.x versions - always backup before making changes)
FNS.MISC.PHP
Open: includes/fns/fns.misc.php
Find: preg_quote($word,'/')
Replace with: $word
Control Panel
Now we need to make sure we add the filter and that your settings are correct in your control panel. Note that the following instructions are for 2.5.3. If you are using a different version of vldPersonals, your settings may be located in a different area of the CP.
ADDING THE FILTER IN THE CP:
Go to: Settings - Member modules - from drop down choose Messaging - add the following code to your Filtered words to block out emails and URLs from messages:
[A-Za-z0-9_\.\-]+@[A-Za-z0-9_\.\-]+\.[A-Za-z]{2,6}
[A-Za-z0-9_\.-]+\.[a-zA-Z]{2,4}
CHECKING YOUR PERMISSIONS
Your permissions are probably set correctly by default, but if you want to check to be sure, do this in your CP:
- CP - Settings - member groups - Admins - Member Profile Privileges - Enforce Word Filter = No
- CP - Settings - member groups - Regular Members - Member Profile Privileges - Enforce Word Filter = Yes
Continue checking/setting privileges as you desire for each group. In the above, most webmasters would have the Admin setting set to NO so the admin is not filtered. However, for all other groups you would want to set the filter to YES for each group you want to filter out emails and URLs when they send a message.
TESTING
If you want to test it out, be sure to do so as Regular members (not admin). You may have to create some dummy accounts to test.
Thanks Ramil...I know it took you some time to research and figure this out. I appreciate your support and effort
Current mood:
514
14
2








Comments
I should only work on certain fields.
Does the normal block function still work if the code is changed in this way?
Find: preg_quote($word,'/') => Replace with: $word
My answer:
No I don´t think it will work. I try it and can´t use the old word block functions now. Maybee I did something wrong ... if it should work please tell me.
Does the normal block function still work if the code is changed in this way?
Find: preg_quote($word,'/') => Replace with: $word
Also, I know the problem, but some spammer are very inventive.
So they use
mysite
dt
cOm
or something.
I see it happening all the time, also for emails on an other site I use.
First filter I will try to understand is the one used for emails -- for example to find the email bob@yahoo.com you use this experssion
[A-Za-z0-9_\.\-]+@[A-Za-z0-9_\.\-]+\.[A-Za-z]{2,6}
[
A-Z matches all characters between A and Z
a-z matches all characters betwee a and z
0-9 matches all numbers beween 0 and 9
_\.\- NOT SURE WHAT THIS DOES??
]
+@ I think the + signs means to literally match the character @
[
A-Za-z0-9 this string of characters have the same meaning as above.
_\.\- NOT SURE WHAT THIS DOES??
]
+\, not sure, but I think this represents the period. NOT SURE WHY we use the \ while in the @ we did not??
[
A-Za-z same as the above
]
{2,6} NOT SURE WHAT THIS DOES??
THE EXPESSION USED FOR URL - for example: www.vldcrowd.com
[A-Za-z0-9_\.-]+\.[a-zA-Z]{2,4}
[
A-Z find all characters between A and Z
a-z find all characters between a and z
0-9 find all numbers between 0 and 9
_\.- NOT SURE WHAT THIS DOES??
]
+\. DOES THIS REPRESENT THE FIRST PERIOD??
[
a-zA-Z same as above
{2,4} NOT SURE WHAT THIS DOES??
Anyone else want to guess??
Pages
1 2