Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added DISCUSSION_SPAM_CHECK trigger #206

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ClayDowling
Copy link

Added the trigger and performed a small refactor to put all of the spam
checking logic into a single method. A note was also added to the
README concerning use of the trigger.

The intent of this pull request is to add a trigger for interaction with the StopForumSpam plugin. The trigger is used by ClayDowling/StopForumSpam#4 and there is a demo running at http://claydowling.com

Added the trigger and performed a small refactor to put all of the spam
checking logic into a single method.  A note was also added to the
README concerning use of the trigger.
* @return bool
*/
protected function _add($comment, $parent) {
global $ID;
protected function _not_spam($comment) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rename it to something that is not a double negative?
(_not_spam()===false is just isSpam(), it isn't?)

@michitux
Copy link
Member

In general I think this is a very good idea. However, there are at least two issues to solve before merging this:

Some more thoughts:

  • The word block check could be the default action such that it can also be disabled by a plugin handling the event.
  • Being able to pass a custom message for the user might be a good idea.
  • Instead of not saving the message a possible action could also be to save the comment as hidden such that it needs to be explicitly approved by a moderator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants