Plugin: LMCommentModerator

Keep commenting open for all and still have full control over which comments that get posted.

General plugin info
Author:Leo
Current version:1.0.0
Download:NP_LMCommentModerator_v100.zip
Support: Plugin comments or forum thread
Compability:Nucleus CMS 3.60, NP_LMReplacementVars 1.1.0

Plugin overview

The NP_LMCommentModerstor plugin is for comment moderation. It will let you keep commenting open for all, while you will still have full control over which comments that get posted to the blog. Unregistered commenters will have the possibility to edit their comments for one hour.

The plugin includes a simple spam filter which let you whitelist or blacklist on member, ip, email address or website. In addition to that it have a spam filter API, that supports additional plugins for spam check.

The current skin and template variables in the Nucleus core for showing comments does not have the possibility to have plugins filter the comments shown. Because of this the NP_LMCommentModerstor plugin uses a helper plugin for handling comment filtering. This plugin is called NP_LMReplacementVars and gives alternative implementations of some key Nucleus core skin variables. It must be installed before the NP_LMCommentModerstor plugin can be installed. The NP_LMReplacementVars plugin can be downloaded from the NP_LMReplacementVars plugin page.

Installation

  • Upload the NP_LMCommentModerstor.php file and the lmcommentmoderator directory from the zip file to the Nucleus CMS plugins directory (nucleus/plugins) on your web server.
  • Go to the Plugins page in the admin area. You should be able to select the plugin in the dropdown list under the "Install New Plugin" section and press the "Install Plugin" button.

Upgrade

  • Take a backup of the current plugin files. You will need these if you want to rollback to the previous version after the upgrade.
  • Take a backup of the database used for you Nucleus installation.
  • Replace the old plugin files with the new ones. Do not uninstall the plugin.
  • If a plugin data upgrade is needed, will an upgrade plugin data option be available on the NP_LMCommentModerator plugin admin page. Choose this option to upgrade the plugin data.
  • After the plugin data upgrade has been performed may a rollback option and a commit option be available on the NP_LMCommentModerator plugin admin page. Not all upgrades support the rollback and commit option.
  • If you are not pleased with the new version of the plugin you may use the rollback option to rollback the plugin data upgrade. After the rollback of the plugin data upgrade you have to replace the new plugin files with the old plugin files.
  • If you are pleased with the new version of the plugin you should use the commit option to commit the plugin data upgrade. After the commit of the plugin data upgrade will any rollback and commit options disappear.

Configuration

The NP_LMCommentModerstor plugin has the following options on the blog level:

  • Delete NP_LMCommentModerator data tables on uninstall? - Should the plugin data be deleted un uninstall?
  • Spam check test modus? - Set the plugin spam check in test modus. If the word Ham is in the comment body, will the comment be categorized as Ham. If the word Spam is in the comment body, will the comment be categorized as Spam.
  • Spam check member comments? - Should comments by members be spam checked?
  • Enable member filter? - Enable member whitelist/blacklist.
  • Enable IP filter? - Enable IP whitelist/blacklist.
  • Enable Email filter? - Enable EMail whitelist/blacklist.
  • Enable Website filter? - Enable Website whitelist/blacklist.
  • Email address for admin notification - Email address to use for notification to the comment moderator.
  • Send notification on new Ham comments? - Should the plugin send a notification message when new comments are classified as Ham.
  • Send notification on comments added to the moderation queue? - Should the plugin send a notification message when comments are added to the moderation queue.
  • Send notification on new Spam comments? - Should the plugin send a notification message when new comments are classified as Spam.
  • Purge Spam comments after X days - How many days to keep spam comments before they are purged. If 0 will spam comments be kept forever.
  • Generate Bootstrap HTML? - Generate Bootstrap HTML for form input. Set to yes if your site uses Bootstrap.

Usage

After the plugin is installed and configured you need to change your skin to use the the NP_LMReplacementVars skin and template variables as described in the "NP_LMReplacementVars" section of this help document.

Usually you should be able to use the default comment form templates provided by the NP_LMCommentModerator plugin. If you want to use customized version see the "Comment form templates" section of this help document.

The NP_LMCommentModerator plugin have some comment related template variables. These are "ModCategory", "CommentActions" and "CookieWarning". Each of these are described in individual sections in the help document. You should update the template used on your item page to include these template variables.

The plugin admin page will show any comments waiting for manual moderation. Blog admins are comment moderators, and can moderate comments on the blog they are admin for.

A guide describing how to set up the skin and templates of a Nucleus CMS installation to use the NP_LMCommentModerator plugin can be found here.

Moderation Category

The NP_LMCommentModerator plugin will add a moderation category property to comments. The available moderation categories are:

  • Ham - The comment has been categorized as Ham by either a spam filter of by a comment moderator. Ham comments will be shown to all. When a comment moderator categorizes a comment as Ham will spam filters that supports updating be updated.
  • Spam - The comment has been categorized as Spam by either a spam filter of by a comment moderator. Spam comments will only be shown to the comment author. When a comment moderator categorizes a comment as Spam will spam filters that supports updating be updated.
  • Show - The comment has been categorized as Show by a comment moderator. The comment will be shown to all. When the NP_LMCommentModerator plugin is installed will all existing comments be but in this category.
  • Hide - The comment has been categorized as Hide by a comment moderator. The comment will only be shown to the comment author.
  • Manual Moderation - New comments that the spam filter can't categorize as either Ham or Spam is categorized as Manual Moderation. Manual Moderation comments will be shown to the comment author and the comment moderators.
  • Members Only - The comment has been categorized as Members Only by a comment moderator. The comment will only be shown to logged in members.

When a comment moderator edit a comment can the moderation category of the comment be updated.

The comment sections of the Nucleus CMS admin area will show all comments regardless of moderation category. Plugins that handle comments and that not explicitly support the will NP_LMCommentModerator plugin will disregard moderation category. These plugins will need an update to support moderation category.

Spam filtering

The NP_LMCommentModerator plugin implements a modified subset of the Nucleus CMS SpamCheck API. A description of the NP_LMCommentModerator SpamCheck API is linked from the the NP_LMCommentModerator plugin admin page or it can be found here.

A simple whitelist/blacklist spam filter for IP, member, email and website comment attributes is included in the NP_LMCommentModerator plugin. This spam filter is administered from the NP_LMCommentModerator plugin admin page. If a comment attribute matches the filter value, will the comment get the filter category value. The spam filter is automatically updated when a comment moderator sets the moderation category of a comment to Ham or Spam.

In addition to the built in spam filter are two additional spam check plugins implementing the NP_LMCommentModerator SpamCheck API released by the NP_LMCommentModerator plugin author. These spam check plugins are NP_LMStopForumSpam and NP_LMSpamBotBehavior.

The order of the spam check plugins in the Nucleus CMS admin plugin list is the order the spam checks are executed. It is recommended to keep any spam check plugins bellow the NP_LMCommentModerator plugin in the Nucleus CMS admin plugin list.

Plugin administration page

The NP_LMCommentModerator plugin administration page has two main sections. One section for handling comments, and one section for administration of the built in spam filter.

Show comments

In the show comments section you can list all comments with moderation category Manual Moderation, Spam or Hide. Actions can be performed single comments or on all comments in the list. Available actions are:

  • Edit - Edit comment.
  • Show - Move comment to the Show moderation category.
  • Hide - Move comment to the Hide moderation category.
  • Ham - Move comment to the Ham moderation category, and update spam filters.
  • Spam - Move comment to the Spam moderation category, and update spam filters.

Show filter content

In the show filter section you can list the content of the member, email, website or IP filter. Actions can be performed on single filters in the list. Available actions are:

  • Ham - Sets the moderation category for the filter to Ham. Spam checked comments matching the filter value will have its moderation category set to Ham.
  • Spam - Sets the moderation category for the filter to Spam. Spam checked comments matching the filter value will have its moderation category set to Spam.
  • Moderate - Sets the moderation category for the filter to Manual Moderation. Spam checked comments matching the filter value will have its moderation category set to Manual Moderation.
  • Lock - Locks the filter. The moderation category for the filter can not be updated by a comment moderator manually setting the comment category to Spam or Ham for a matching comment.
  • Unlock - Unlocks the filter. The moderation category for the filter can not be updated by a comment moderator manually setting the comment category to Spam or Ham for a matching comment.
  • Disable - Disables the filter. Disabled filters will be ignored during spam check.
  • Enable - Enables the filter.
  • Delete - Deletes the filter.

Comment form templates

The NP_LMCommentModerator plugin adds some new comment form templates and uses modified versions of existing ones. These comment form templates are "Comment Loggedin Form", "Comment Not Loggedin Form", "Comment Loggedin Edit Form", "Comment Not Loggedin Edit Form" and "Comment Can Not Edit Form". The default contents of these templates can be displayed from the plugin admin page.

Do not edit the comment form template files provided in the NP_LMCommentModerator plugin directory. These files will be overwritten when you upgrade the plugin. If you need to override the default comment form template provided by the plugin this should be done in the NP_LMCommentModerator section of a Nucleus template. To utilize a comment form template in a Nucleus template, add the Nucleus template name to the CommentForm skin variable like this <%LMReplacementVars(CommentForm,mytemplate/item)%>.

ModCategory

Template variable used to insert the text associated with the moderation category of a comment. It is used in the comment part of a nucleus template. The text associated with each moderation category can be set in the ModCategory fields in the nucleus template given as parameter. If the template field for an moderation category is empty will the default value for the moderation category be used instead. The default value for each moderation category can be displayed from the plugin admin page.

<%LMCommentModerator(ModCategory,lm/item)%>

The parameters are:

  • template - Name of the Nucleus template to use. If blank will only default values be used.

CommentActions

Template variable used to insert the available comment actions for a comment. It is used in the comment part of a nucleus template.

<%LMCommentModerator(CommentActions)%>

CookieWarning

Template variable used to insert the cookie warning for a comment. It is used in the comment part of a nucleus template. The cookie warning will be shown to non-members on the latest comment they made, if the comment can be edited. The text for the cookie warning can be set in the Cookie Warning field in the nucleus template given as parameter. If the template field for the cookie warning is empty will the default value be used insted. The default value for the cookie warning can be displayed from the plugin admin page.

<%LMCommentModerator(CookieWarning,lm/item)%>

The parameters are:

  • template - Name of the Nucleus template to use. If blank will only the default value be used.

NP_LMReplacementVars

The replacement skin and template variables for <%archive()%>, <%blog()%>, <%commentform()%>, <%comments()%> and <%item()%> in the NP_LMReplacementVars plugin must be used by your blog if you want this plugin to function. See the documentation for the NP_LMReplacementVars plugin for further information on how to use the comments and comment form replacement skin variables.

Support and Bug reports

For additional support and/or bug reports please use the Nucleus forum plugin announce thread or the plugin page comment section.

Compability

This version of the NP_LMCommentModerstor plugin is tested against version 3.66 of LMNucleus CMS. The minimum version of Nucleus CMS needed for using this plugin is 3.60.

The minimum version of the NP_LMReplacementVars plugin needed by this plugin is version 1.1.0.

Version History

  • v1.0.0 2014-04-13: by Leo (http://nucleus.slightlysome.net/leo)
    • Initial release.

Download

Download NP_LMCommentModerator v1.0.0. The latest version of the NP_LMCommentModerator plugin can be downloaded from the NP_LMCommentModerator plugin page.

The latest version of the NP_LMReplacementVars plugin can be downloaded from the NP_LMReplacementVars plugin page.


Add Comment

Spam and off topic comments will be deleted.

Allowed BBCode:[b] [i] [u] [s] [color=] [size=] [quote] [code] [email] [url]