PDA

View Full Version : Anti-Spam Options - Automated Post Reporter


MarkFL
04-06-2015, 09:00 PM
This mod will automatically generate a report thread when a new user posts a reply to a thread that has been inactive for a time (necro-posting) and/or has included certain words in the content of their post (and signature if you want). This includes the case where the new user edits an existing post they have made to add such words.

In the included screenshots, you can see the options provided via the AdminCP to configure the product to suit your needs, the default message shown to new users upon editing a post to add flagged words, an example of a thread as listed in the designated report forum, and the body of the generated report.

I want to give a profound word of thanks to BirdOfPrey5 (https://vborg.vbsupport.ru/member.php?u=258922) because it was the study of his XML files and the fact that he allows his code to be reused that allowed me to be able to package my products. :up::cool:

Updated version 1.1:


User is allowed to chose excluded usergroup(s) from list of available groups
User is allowed to chose destination forum for generated reports from list of available forums
User is allowed to opt out of generating reports (moderate posts only)
Bug fixed where user editing existing post to include flagged words was shown moderation queue message even when posts were not moderated


Updated version 1.2


Excluded usergroup selection is 2 columns to save space
Added the option to exclude users by username
New users may now be blocked from creating/editing signatures containing flagged words
Customize the error message shown to such users
Destination forum for generated reports is also a 2 column format
if no destination forum is selected when saving the settings the first time, the forum used for user-reported posts is auto-selected
Bug fixed with regards to the first post of a thread being put into the moderation queue and user post counts


Updated version 1.2a


Resolved conflict with "Automatic Tagger From Message Content and Title"


Updated version 1.2.1


Include new user's IP address in report post, with link to resolve IP
Report which flagged word(s) were found in post content and/or signature


Updated version 2.0


Added the option whether to exclude users by postcount
Allow standard wildcards in flagged word definitions
Allow product to either act globally or in select forums


Updated version 2.1


Added the option whether to include posts/signature in report whether flagged or not.


Updated version 2.2


Allowed domains: sites to which links are allowed.
Quoted content (as long as it has not been altered) is exempt from being checked for flagged words.
When a new user's post goes into moderation, they are shown a static error message, rather than vBulletin's fleeting message new users often fail to be able to read/understand.


Updated version 2.2a


Found and fixed a syntactical error preventing selected forums setting from working correctly.


Updated version 2.3


Will now auto-add the unresolved report thread prefix when creating the report if "Report Thread Prefix Management" is installed and active.


Updated version 2.3.5


Data-type for destination forum fixed to positive integer.


Updated version 2.4


Fixed broken link to post when the reported post is the first in a thread.


Updated version 2.5


Replaced usergroup and forum selection settings with select elements.
Added the option to decide whether to display the product's moderation queue message or to use vBulletin's default message and redirect.
If your automated reports go to the same forum as user reported posts, then any subsequent user reports will be appended to the thread generated by this product.


Installation:

Download and extract the attached zip file, then upload the contents of the "upload" folder to your forum's root directory.

In AdminCP go to Plugins & Products -> Manage Products -> Add/Import Product.

Click on "Choose File" and browse to the product xml file that was included in the .zip file.

Click "Import"

You MUST enable the product by going to:

AdminCP -> Options -> MarkFL: Automated Post Reporter v1.1

And clicking "Yes" for "Reporting System Enabled?"

Support for this product can be found here:


MHB - Automated Post Reporter (http://mathhelpboards.com/vbulletin-products-61/automated-post-reporter-22042.html)
TAZ - Automated Post Reporter (https://theadminzone.com/threads/automated-post-reporter.145230/)

MarkFL
04-07-2015, 02:13 AM
Reserved.

hoangserip
04-07-2015, 05:35 PM
thanks for the great hack,
I will test now!

v123shine
04-08-2015, 05:40 AM
Very nice plugin, many thanks dude ;)

Alan_SP
04-08-2015, 03:54 PM
This looks very useful. :up:

MarkFL
04-09-2015, 10:07 AM
I've just released a new version, as described above.

To upgrade, download and extract the attached zip file and upload the contents of the "upload" folder to your forum root, as the included php file has been modified.

In AdminCP go to Plugins & Products -> Manage Products -> Add/Import Product.

Click on "Choose File" and browse to the product xml file that was included in the .zip file.

Set "Allow Overwrite" to "Yes."

Click "Import"

You MUST enable the product by going to:

AdminCP -> Options -> MarkFL: Automated Post Reporter v1.1

And clicking "Yes" for "Reporting System Enabled?"

MarkFL
04-14-2015, 01:53 AM
I've just added some more options and fixed another bug. If installing for the first time, follow the instructions in the product post, or if upgrading follow the instructions in the preceding post for v1.2.

Skyrider
04-14-2015, 12:53 PM
I received this today:

Fatal error: Cannot redeclare contains() in /home/xx/forums.xx.com/includes/functions_autotaggerfromcontentandtitle.php on line 64

When I attempted to make a new thread that got flagged by this system. I get this every time I make a new thread, even when the flagged words are not in them.

$checkpost = preg_replace("/\[IMG\].*?http/si", "", $newpost['message']);

Is line 64.

Awesome system though! I do would like to make a suggestion that it shows in the report "which" flagged word triggered the report. Maybe displaying IP as well in the reported posts?

ForceHSS
04-14-2015, 01:15 PM
I received this today:



When I attempted to make a new thread that got flagged by this system. I get this every time I make a new thread, even when the flagged words are not in them.

$checkpost = preg_replace("/\[IMG\].*?http/si", "", $newpost['message']);Is line 64.

Awesome system though! I do would like to make a suggestion that it shows in the report "which" flagged word triggered the report. Maybe displaying IP as well in the reported posts?
functions_autotaggerfromcontentandtitle.php is not a default vb file what custom plugin did you get this from

MarkFL
04-14-2015, 01:36 PM
I received this today:

Fatal error: Cannot redeclare contains() in /home/xx/forums.xx.com/includes/functions_autotaggerfromcontentandtitle.php on line 64

When I attempted to make a new thread that got flagged by this system. I get this every time I make a new thread, even when the flagged words are not in them.

$checkpost = preg_replace("/\[IMG\].*?http/si", "", $newpost['message']);

Is line 64.

What hack are you running that uses the cited custom PHP file? I will install it on my dev site and see if I can duplicate the issue and resolve it.

Awesome system though! I do would like to make a suggestion that it shows in the report "which" flagged word triggered the report. Maybe displaying IP as well in the reported posts?

I will include these in the next update. :D

Skyrider
04-14-2015, 01:56 PM
Argh, my bad. Was multi-tasking that I didn't even notice that the PHP files were completely different. Line 64 of functions_autotaggerfromcontentandtitle.php is:

function contains($text, $tag, $related_words) {

From this plugin:

https://vborg.vbsupport.ru/showthread.php?t=234026

Seems to be conflicting with your system.

MarkFL
04-14-2015, 02:08 PM
Argh, my bad. Was multi-tasking that I didn't even notice that the PHP files were completely different. Line 64 of functions_autotaggerfromcontentandtitle.php is:

function contains($text, $tag, $related_words) {

From this plugin:

https://vborg.vbsupport.ru/showthread.php?t=234026

Seems to be conflicting with your system.

Okay, my hack and the one you are using both declare a function of the same name. I have renamed the function in mine and this should resolve the issue.

Please download and install the current version (1.2a) and let me know if this fixes the issue on your end. :D

MarkFL
04-15-2015, 04:29 AM
...I do would like to make a suggestion that it shows in the report "which" flagged word triggered the report. Maybe displaying IP as well in the reported posts?

I have included these changes in the latest version 1.2.1. :cool:

Skyrider
04-15-2015, 05:02 AM
Awesome, thanks! The system works perfectly now, and I love that the words are included now. I do have a suggestion though if you don't mind. I noticed that the system is using the *.php file in order to make the full report, eg, what text is being used.

Is there a way that a template & Languages & Phrases can be used instead?

So the text itself (the whole report) can be adjusted to fit the forums without changing the php file(s).

And can the Postcount Threshold also be -1? (checking every single member, regardless of the postcount).

Again, thanks for this system. It's very useful.

---

EDIT:

Maybe exclude specific sections/sub-sections would be nice as well ^_^.

MarkFL
04-15-2015, 05:32 AM
Awesome, thanks! The system works perfectly now, and I love that the words are included now. I do have a suggestion though if you don't mind. I noticed that the system is using the *.php file in order to make the full report, eg, what text is being used.

Is there a way that a template & Languages & Phrases can be used instead?

So the text itself (the whole report) can be adjusted to fit the forums without changing the php file(s).

And can the Postcount Threshold also be -1? (checking every single member, regardless of the postcount).

Again, thanks for this system. It's very useful.

---

EDIT:

Maybe exclude specific sections/sub-sections would be nice as well ^_^.

I will look into all of these points very soon. I was actually already thinking of giving the option to choose "Active Forums." :D

Skyrider
04-15-2015, 06:43 AM
:) appreciate it!

Mind if I make another suggestion? :P

Is there anyway that the bad word filter can have a system that "must" include a specific word, and also report the rest of it? Hard to explain, so I'll give an example:

Suppose, you would filter "http://google.com". <- yes, this entire url.

That would report all posts/threads & signatures with "http://google.com" in it, but ignores anything beyond that if it includes a longer url, eg http://google.com/searchresulthere.

When that happens, the bad word is not being reported at all, seeing the system only sees "http://google.com" as a bad word. Anything added after the link, well.. you get the drill. What I'd personally like to see is if it is possible that when you filter a specific word or URL in this case, that anything beyond that ( http://google.com/*) <- like this *, gets reported as well.

I've seen on some plugins they are using such method, I just forgot what the plugins were/are called. I think the other systems were using Quotation Marks for this kind of job, eg as bad words.

test1,test2,test3,"http://google.com",test4,test5

So that http://google.com and anything beyond that url gets reported as well.

Hard to explain, but I think you understand.

The reason why I'm suggesting is this because we don't want the word itself to be filtered, but the url and anything that is being added inside that url. This is to prevent words being used of the url in the filter.

MarkFL
04-15-2015, 12:17 PM
As it is, if you enter http://google.com as a flagged word, then if a new user has https://www.google.com/search?q=gauss&ie=utf-8&oe=utf-8 in their post, the post will be reported. Are you saying you would want the option that this not to be reported?

Skyrider
04-15-2015, 12:27 PM
Odd, I'd have to try it out again then. I attempted http://google.com to be as a bad word, but when I enter a full google URL as your post, it didn't report it. Let me double check to see if this is still the case.

MarkFL
04-15-2015, 12:35 PM
Okay, I see the issue...if http://google.com is entered as the flagged word, then https://www.google.com* will not be reported...what would have to be entered as the flagged word is https://www.google.com.

Skyrider
04-15-2015, 02:34 PM
I think you noticed my issue now :D, though I might as well give an example with the URL I had in mind.

I've filtered:

http://steamrep.com/

Now, when I make new thread / post with this included:

http://steamrep.com/search?q=skyrider

The system is not reporting it, while http://steamrep.com is in the bad word list. Hence, would it be possible that that the system can detect the bad word seeing "http://steamrep.com" is already in the bad word list.

MarkFL
04-15-2015, 02:39 PM
In this case for the meantime, I would suggest flagging both:

http://tf2outpost.com,http://www.tf2outpost.com

I will look into allowing wildcards in the flagged words for the next update though, so that you could flag something like:

http://*tf2outpost.com

Skyrider
04-15-2015, 02:50 PM
Ah, I see.. I really, failed to notice the www. Silly me. Can't believe I overlooked that.

MarkFL
04-15-2015, 02:54 PM
...I've filtered:

http://steamrep.com/

Now, when I make new thread / post with this included:

http://steamrep.com/search?q=skyrider

The system is not reporting it, while http://steamrep.com is in the bad word list. Hence, would it be possible that that the system can detect the bad word seeing "http://steamrep.com" is already in the bad word list.

When I try this on my local dev site, the post is flagged. :confused:

Skyrider
04-15-2015, 03:48 PM
I edited the site above, but nevermind my reply! I was stupid enough to skip over the "www" in the URL.

MarkFL
04-16-2015, 05:39 AM
I have updated the product to include the ability to not exclude users by postcount, the ability to use standard wildcards in flagged word definitions, and the ability to select the forums in which the product is active. :D

Skyrider
04-18-2015, 04:56 AM
Awesome! I'll update asap!

We've been using the system for a few days ago, and I'm loving it thus far. There is just 1 thing that we noticed though. Thus far that the signature may or may not be a small issue. Every time a user posts, and is using the same signature for every post, it's spamming up the report section we use for systems like this.

I'm not sure. But, is it possible that once the signature has been reported once any other duplicate (exact same signature) check will be ignored? Until the signature changes again.

Oh.. and, sorry for all the replies from me. But, is it possible there can be an option to show Signature Content in the report or not when only the post has been flagged with bad word content? EG, if nothing in the signature has been reported, it could perhaps have an option to hide the signature information in the reported post, seeing only words in the post itself were flagged.

MarkFL
04-19-2015, 03:30 AM
There is just 1 thing that we noticed though. Thus far that the signature may or may not be a small issue. Every time a user posts, and is using the same signature for every post, it's spamming up the report section we use for systems like this.

I'm not sure. But, is it possible that once the signature has been reported once any other duplicate (exact same signature) check will be ignored? Until the signature changes again.

I am thinking this would require making a new table in the database to track reported signatures, and as a relatively new vBulletin coder is something I will have to learn how to do first, but I will definitely keep this in mind for the future.

Oh.. and, sorry for all the replies from me. But, is it possible there can be an option to show Signature Content in the report or not when only the post has been flagged with bad word content? EG, if nothing in the signature has been reported, it could perhaps have an option to hide the signature information in the reported post, seeing only words in the post itself were flagged.

Keep the replies coming...your suggestions have helped me make this product more robust. Thank you for your interest and helpful feedback. :D

This (adding the option to only add the signature to the report if it contains flagged words) is something I will add tomorrow. :)

MarkFL
04-19-2015, 02:05 PM
I have updated to version 2.1 which gives the option whether to include posts/signatures in the report whether flagged or not. If set to "Yes" then both posts and signatures will be in the report, but if set to "No" then only that which is flagged is included. :D

MarkFL
04-30-2015, 06:40 AM
Updated version 2.2 includes:


Allowed domains: sites to which links are allowed.
Quoted content (as long as it has not been altered) is exempt from being checked for flagged words.
When a new user's post goes into moderation, they are shown a static error message, rather than vBulletin's fleeting message new users often fail to be able to read/understand.

Nirjonadda
04-30-2015, 02:47 PM
Please can you add option Block Censored Words in Posts? Options included to limit checking on thread titles or only post bodies, or both. Also option to use on specific forums instead of all forums on your site.

MarkFL
04-30-2015, 02:56 PM
Please can you add option Block Censored Words in Posts? Options included to limit checking on thread titles or only post bodies, or both. Also option to use on specific forums instead of all forums on your site.

This add-on isn't meant to block the usage of words, only report on their usage and then place the post into the moderation queue. :D

There already is the option to choose which forums on which this product is active. Adding the post title to the check isn't a bad idea though, so look for that most likely in the next update.

If you are looking to block words from being posted in the first place, I would point you to this product which works very well:

Block Censored Words in Posts by BOP5 VB4 (https://vborg.vbsupport.ru/showthread.php?t=255546)

MarkFL
06-11-2015, 04:09 PM
Updated version 2.3


Will now auto-add the unresolved report thread prefix when creating the report if "Report Thread Prefix Management" is installed and active.

MarkFL
07-28-2015, 01:59 PM
Updated version 2.4


Fixed broken link to post when the reported post is the first in a thread.

blah100
07-31-2015, 03:51 AM
Is it possible to disable the error message from displaying to the poster of said moderated message? Getting an error message annoys members and they try to get around it by posting the same/similiar message again. Is it possible to have it so that both the staff and the original poster of the message sees his/her post, thus making it so that the poster doesn't think anything is wrong and sees no reason to make a duplicate/similar post? I'm not asking to add this option to the modification, I'm happy to be able to do this on my own if you let me know what I'll have to modify.

MarkFL
07-31-2015, 03:59 AM
Well, my intent with the message to the user is to explain that their post/thread has been added to the moderation queue and will be dealt with ASAP, thereby preventing them from thinking their post just disappeared.

Now, in the product's settings you can choose to set "Moderate Posts?" to "No" and then the user will see his post has been posted like normal, but a report is generated that your staff will see and can then take action. :D

blah100
07-31-2015, 04:47 AM
Ah ok. I was hoping that the post still get moderated and that no one on the forum but the staff and the poster his/herself would see it until the staff took care of the post. I guess that's not possible.

MarkFL
07-31-2015, 04:52 AM
Well, that would most likely be possible, and so I will certainly look into the possibility of making this an option. :)

blah100
07-31-2015, 04:57 AM
Oh thank you very very much :)

MarkFL
08-01-2015, 01:33 AM
Updated version 2.5


Replaced usergroup and forum selection settings with select elements.
Added the option to decide whether to display the product's moderation queue message or to use vBulletin's default message and redirect.
If your automated reports go to the same forum as user reported posts, then any subsequent user reports will be appended to the thread generated by this product.


On the issue of users being able to view their own moderated posts, I would direct you to the following thread:

Users can see own moderated threads prior to approval (https://vborg.vbsupport.ru/showthread.php?t=277604)

e24h
08-01-2015, 01:55 AM
Oh thank you very very much

muffel
08-14-2015, 06:46 AM
I have installed this nice plugin. But I have some questions:
We are using this for being able to get infos when an user write special keywords in his post. Then 2-3 admins should be notified. Is it possible in any way, that the admins get a PM or eMail when a post is reported?

MarkFL
08-14-2015, 07:41 AM
I have installed this nice plugin. But I have some questions:
We are using this for being able to get infos when an user write special keywords in his post. Then 2-3 admins should be notified. Is it possible in any way, that the admins get a PM or eMail when a post is reported?

I will look into adding this as a feature for a future release. :)

muffel
08-14-2015, 07:43 AM
Ok, thank you very much! And let me ask another question: Where will a post be reported?

I have enabled your add-on and have put in one keyword. But the admin gets no report anywhere - what can I do?

MarkFL
08-14-2015, 07:54 AM
Ok, thank you very much! And let me ask another question: Where will a post be reported?

I have enabled your add-on and have put in one keyword. But the admin gets no report anywhere - what can I do?

The report will be posted to the forum you have set in "Destination Forum For Reports." A report will only be generated when a non-exluded user has fewer posts than the threshold you set and includes one of the "Flagged Words" in their post and/or signature or if they attempt to necro-post, where you define the threshold in days for that.

muffel
08-14-2015, 10:03 AM
The posting with the "flagged word" in it gets in the status that has to be moderated.
But there is no report that the user that id is set under "Userid For OP Of Report Threads" will see.

MarkFL
08-14-2015, 01:05 PM
The posting with the "flagged word" in it gets in the status that has to be moderated.
But there is no report that the user that id is set under "Userid For OP Of Report Threads" will see.

Do you have "Generate Reports?" set to "Yes"?

muffel
08-17-2015, 04:48 AM
Problem is solved... I did not see the postings that were generated - I am sorry ;)
Thank you.

BrettC Frontier
10-29-2015, 02:44 PM
Quick feature request, as we've come across a fair amount of false positives on our boards due to the ? * wild card matching on simple words/small words.

As like the default vbulletin censor filter, could we get {} added to words as an exact match of a word or group of words rather relying on a string match of a segment within a word?

MarkFL
10-29-2015, 02:59 PM
Quick feature request, as we've come across a fair amount of false positives on our boards due to the ? * wild card matching on simple words/small words.

As like the default vbulletin censor filter, could we get {} added to words as an exact match of a word or group of words rather relying on a string match of a segment within a word?

Once time permits, I will look into adding this as a feature. :D

muffel
12-27-2015, 03:37 PM
Hello, we are using this Add-On now since 5 months - and all is fine.

Just one question: At the current version, if a user writes a posting with one word which is in the black list, then the posting will be set to "moderated" and will be reported.
But if the user writes the posting without a word of the black-list... and after that he makes a change on this posting and now adds the word which is in the black-list, the posting will not be set to moderated and will not be reported. Is the function of this add-on maybe also possible if the user changes his posting?

Thank you!

MarkFL
12-27-2015, 04:04 PM
I just double-checked on my dev site, and when a new user who posts first with no flagged words, and then edits a post to add a flagged word, the post is added to the moderation queue, and a report is generated to show the original post content, and the edited content containing the flagged word.

Nirjonadda
12-29-2015, 06:01 PM
Does this work awaiting moderation in notifications area?

MarkFL
12-29-2015, 06:33 PM
Does this work awaiting moderation in notifications area?

You would need a product that adds moderated items to notifications, such as:

FractalizeR: Show items, awaiting moderation in notifications area (https://vborg.vbsupport.ru/showthread.php?t=241301)

BrettC Frontier
01-09-2016, 02:28 PM
This is a long shot at this point, but would it be possible to rework how the Flagged words function?

Rather a comma delimited list, could it be set to one word (or phrase?) per line, with a | as the delimiter with the following. Additionally, the comma could remain as a word separator.

badwebsiteurl|reason it's flagged
badword1,badword2|reason it's flagged

So in the automated report we would end up with:

A user has:

Posted flagged word(s) in their post content: badwebsiteurl
reason it's flagged.

Details concerning this user and the thread to which they posted are as follows:

I've had a few requests from my moderation team on this and was wondering if this could be added in at some point. There's a few websites that have been used on our communities that have "issues" as in, mobile users get spammed by scare-ware that their mobile is infected and needs to be cleaned (postimg mobile).

muffel
04-29-2016, 09:33 AM
I just double-checked on my dev site, and when a new user who posts first with no flagged words, and then edits a post to add a flagged word, the post is added to the moderation queue, and a report is generated to show the original post content, and the edited content containing the flagged word.

Hello. I am sorry to ask again. But this does not work in our Forum.

When someone at first makes a post without the flagged word, then the posting ist online.
When he then edits his posting and adds one flagged word, then the posting keeps online.
Is there a workaround for this?

Thank you!

MarkFL
04-29-2016, 09:47 AM
Hello. I am sorry to ask again. But this does not work in our Forum.

When someone at first makes a post without the flagged word, then the posting ist online.
When he then edits his posting and adds one flagged word, then the posting keeps online.
Is there a workaround for this?

Thank you!

I am unable to replicate this issue, so I have to assume another product you have installed is interfering.

I will update this product, and in the process go through the code with a fine comb. :)

muffel
02-07-2017, 10:45 AM
Hello MarkFL,

thank you again. Now all works in our forum.

There was an old plugin from VB3 still active... and interfering.
It was called "Usergroup Allow HTML" - and I think we do not need this anymore, because it is now included in VB4. After I deacitivated it, your addon here works also with the edited posts.

Thank you very much for your help via PN.

muffel