• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[splendidpoint.com] AntiSPAM - Prevent Links and Emails

Status
Not open for further replies.
moderated posts going into the moderation que seem to be missing this check. we're getting moderated posts w/ URLs that shouldn't be. any idea how I can fix this?

Hmmm, if I understood you correctly, you have a usergroup whose all posts are sent to moderation. These posts still contain links in them. Is that what you are saying? If yes, I will take a look.

PS, what about video? embeded video still seems to still get thru since they aren't really urls

The reason for that is that they use the media bbcode, and not a url. This only blocks URLs and Emails.
 
Hmmm, if I understood you correctly, you have a usergroup whose all posts are sent to moderation. These posts still contain links in them. Is that what you are saying? If yes, I will take a look.

Yes that's what I'm saying. Thank u

I tried going thru the code myself but couldn't find the issue.
 
Yes that's what I'm saying. Thank u

I tried going thru the code myself but couldn't find the issue.

OK this is what I did and it works fine.
  1. Created a New Usergroup called "testgroup"
  2. Went to ACP->Options->AntiSPAM Options and checked the checkbox for testgroup.
  3. Set the usergroup permission Follow message moderation rules to Not Set (No) for this testgroup to pre-moderate their posts.
  4. Created a new user and assigned him the group "testgroup".
  5. logged in as this new user and tried to post with a link in it and got the error message.
Are you sure you are doing everything correctly?
 
OK this is what I did and it works fine.
  1. Created a New Usergroup called "testgroup"
  2. Went to ACP->Options->AntiSPAM Options and checked the checkbox for testgroup.
  3. Set the usergroup permission Follow message moderation rules to Not Set (No) for this testgroup to pre-moderate their posts.
  4. Created a new user and assigned him the group "testgroup".
  5. logged in as this new user and tried to post with a link in it and got the error message.
Are you sure you are doing everything correctly?

Those r the same steps I followed. They are posting & I'm getting them in the mod que w/ urls. :(

Thank u for ur time
 
With urls? That's strange.

Can you give me admincp access to your forum in pm. I can take a look and possibly fix it.
 
On another note. If you are already moderating the members posts, meaning a Mod will always look and approve those, why do you still want to deny URLS?
 
On another note. If you are already moderating the members posts, meaning a Mod will always look and approve those, why do you still want to deny URLS?
Yes, id rather Have the posts blocked instead of having to edit each one.

I'm gonna jump on my computer
 
With urls? That's strange.

Can you give me admincp access to your forum in pm. I can take a look and possibly fix it.


I'm sorry to bother you. i just made a probation account & tested it myself.

when the ACP / "AntiSPAM Options" / Minimum Message Count was set to 30, i wasn't able to post URLS.

when I switched the setting to "0" zero I was & should not have been able to. it was my understanding the setting it to 0 would ignore the post count restriction.

I reset it to 50 & that will work fine for me & solve my problem in this situation but there does appear to be an issue w/ setting post count to zero.

by the way, can I set it to a number higher than 50? looking at your code I don't see why it can't be.
 
I'm sorry to bother you. i just made a probation account & tested it myself.

Nopes you are not bothering me at all... :)

when the ACP / "AntiSPAM Options" / Minimum Message Count was set to 30, i wasn't able to post URLS.

when I switched the setting to "0" zero I was & should not have been able to. it was my understanding the setting it to 0 would ignore the post count restriction.

I reset it to 50 & that will work fine for me & solve my problem in this situation but there does appear to be an issue w/ setting post count to zero.

No, it doesn't work that way. Setting to "0" effectively disables the addon, meaning a person with "0" post count will be able to post links.

by the way, can I set it to a number higher than 50? looking at your code I don't see why it can't be.

If you read the description in the setting, it says

"Members minimum message count required to post links. Enter a value between 0 and 50. A setting of O turns the Minimum Message Count check off."
 
OK, setting it to a high number didn't work out because it was effecting people I didn't want it to.

if i set the addon to apply to the registered group & under 30 posts

then someone w/ the main usergroup - registered AND under 30 posts gets hit. - so far so good

someone w/ main usergroup - "registered" & addon usergroup - "Full Member" should not regardless of # of posts but they do. since they are in both the "registered" & full member" groups. the code doesn't recognize that the addon group actually makes them part of a promoted group.

still, thanks & I'm working on tweaking it to work better for me.
 
. the code doesn't recognize that the addon group actually makes them part of a promoted group.

still, thanks & I'm working on tweaking it to work better for me.

Yeah you can tweak it for that. It only considers primary usergroups for which the check is applied.
 
just wanted to stop back in & thank you. I tweaked the code to ignore the ACP options & instead apply to users in my probationary usergroup (with no promotions) & users in my discipline addon group. there's little point in sharing the edit since it only applies to my situation.

I did however add to your code to have it block embed video too

in every file inside the AntiSPAM\ControllerPublic folder this code exists
Code:
                $email_pattern = '/[^@]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+/';
   
                if (preg_match($url_pattern, $message) || preg_match($email_pattern, $message))
                {
                    $links = 1;
                }

edit all 7 files in that folder & change the above code to the below code to have it also catch embeded [ media ] & if you have XenMedio installed it will also catch the [ medio ] tags.

Code:
                $email_pattern = '/[^@]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+/';
                $video_pattern = '/(\[\/media\]|\[\/medio\])/i';
                if (  preg_match($url_pattern, $message) || preg_match($email_pattern, $message) || preg_match($video_pattern, $message) ) {
                    $links = 1;
                }

I tried combined those 3 preg_matches into 1 big one but it didn't work out for me.
 
Status
Not open for further replies.
Top Bottom