How to set up Nucleus to use the LMCommentModerator plugin

By: Leo
On: 13/04-14 10:36

The LMCommentModerator plugin require some setup before it can be used. This is a step by step guide on how to set up your Nucleus installation to use the LMCommentModerator plugin for comment moderation. The examples in this guide is based on the default skin of a clean LMNucleus installation, but it should not be much different than setting it up on an existing installation.

The use of the skin and template variables from the LMReplacementVars plugin for displaying items and comments is required for the LMCommentModerator plugin to work. If you have other plugins that show items or comments in any form on your blog and where the plugin don't support the LMReplacementVars plugin will you probably see comments that should be hidden. In these circumstances must you upgrade the problem plugin or change to a similar plugin that supports LMReplacementVars.

It is recommended that you take a backup of your current Nucleus database before you start to set up the LMCommentModerator plugin.

Install the LMReplacementVars plugin

Before the LMCommentModerator plugin can be installed, must you install the LMReplacementVars plugin. Download link and install instructions can be found on the LMReplacementVars plugin page. The LMReplacementVars plugin require no additional configuration before it can be used.

Install the LMCommentModerateor plugin

The LMCommentModerator plugin can now be installed. Download link and install instructions can be found on the LMCommentModerator plugin page.

Setting the LMCommentModerateor plugin options

Plugin options

To get notifications emails you have to register the notification email address in the Email address for admin notification option.

You might want to set the Send notification on new Spam comments? option to Yes if you want to double check that the spam filtering work as intended. But when the spam activity increases and you are tired of getting spam notification emails you should set it to No.

As the time goes will you get many spam comments in the system. To automatically purge the spam comments set the Purge Spam comments after X days option. I normally to set this option to 30 days.

Otherwise should the default values for the options be sufficient for most situations.

Editing the Main Index of your blog skin

Edit the Main Index of the skin your blog uses and change the Main Index to use the LMReplacementVars replacement skin variables for <%blog()%>. Remember to also edit the skins used by feeds.

  • Replace <%blog(template)%> with <%LMReplacementVars(Blog, template)%>.

For the default Nucleus skin will the updated container div of the Main Index look like the following:

<div id="container">
<div class="content">
<%LMReplacementVars(Blog, default/index, amount=10)%>
</div>
</div>

Editing the Archive of your blog skin

Edit the Archive of the skin your blog uses and change the Archive to use the LMReplacementVars replacement skin variables for <%archive()%>.

  • Replace <%archive(template)%> with <%LMReplacementVars(Archive, template)%>.

For the default Nucleus skin will the updated container div of the Archive look like the following:

<div id="container">
<div class="content">
<div class="contenttitle">
<h2>Archives</h2>
</div>
You are currently viewing archive for <%archivedate%>
</div>
<div class="content">
<%LMReplacementVars(Archive, default/index)%>
</div>
</div>

Editing the Item Page of your blog skin

Edit the Item Page of the skin your blog uses and change the Item Page to use the LMReplacementVars replacement skin variables for <%item()%>, <%comments()%> and <%commentform()%>.

  • Replace <%item(template)%> with <%LMReplacementVars(Item, template)%>.
  • Replace <%comments(template)%> with <%LMReplacementVars(Comments, template)%>.
  • Replace <%commentform%> with <%LMReplacementVars(CommentForm, template)%>. Use the same template for the commentform skin variable as you used for the comments skin variable.

For the default Nucleus skin will the updated container div of the Item Page look like the following:

<div id="container">
<div class="content">
<%LMReplacementVars(Item, default/item)%>
</div>
<div class="content">
<div class="contenttitle">
<h2>Comments</h2>
</div>
<a name="c"></a>
<%LMReplacementVars(Comments, default/item)%>
</div>
<div class="content">
<div class="contenttitle">
<h2>Add Comment</h2>
</div>
<%LMReplacementVars(CommentForm, default/item)%>
</div>
</div>

Editing the Main Index and Archive template

Edit the templates used for showing by the Main Index and Archive. Change them to use the LMReplacementVars replacement template variable for <%comments()%>.

  • Replace <%comments%> with <%LMReplacementVars(Comments)%>.

For the default Nucleus skin is the <%comments%> template variable used in the Index Body part of the template called default/index.

Editing the Item Page template

Edit the template used for showing by the Item Page and add the following template variables to the Comments Body part of the template:

  • <%LMCommentModerator(CommentActions)%>
  • <%LMCommentModerator(ModCategory, template)%>
  • <%LMCommentModerator(CookieWarning, template)%>
  • <%LMReplacementVars(CommentForm, template)%> - Shows the edit comment form if the comment is being edited. This template variable should be placed after the comment body.

A id attribute identifying the comment must be added to the first HTML element of each comment. The LMCommentModerator plugin depends on this to show the correct comment when editing a comment or to show the correct comment after adding/editing a comment. In the comment template can the id attribute be generated by the following: id="comment<%commentid%>"

For the default Nucleus skin will the updated Comments Body part of the default/item template contain like the following:

<div class="itemcomment id<%memberid%>" id="comment<%commentid%>">
<h3><a href="<%userlinkraw%>"
title="<%ip%> | Click to visit <%user%>'s website or send an email">
<%user%></a> wrote:</h3>
<div class="commentbody">
<%body%>
</div>
<div class="commentinfo">
<%date%> <%time%> 
<%LMCommentModerator(CommentActions)%>
<%LMCommentModerator(ModCategory, default/item)%>
<%LMCommentModerator(CookieWarning, default/item)%>
</div>
</div>
<%LMReplacementVars(CommentForm, default/item)%>

Customizing forms and texts

If you need to customize the comment forms or the text produced by the ModCategory or CookieWarning template variables, you can do this in the LMCommentModerator section of the template used as parameter to the skin and template variables.

For the default Nucleus skin you would want to customize the add comment forms in the Comment Loggedin Form and Comment Not Loggedin Form part of the default/item template to not include a header. This is because a header is already included in the Main Index of the skin.

Install spam check plugins

In addition to the built in spam filter in the LMCommentModerator plugin are two spam check plugins released by the LMCommentModerator plugin author. These are:

  • LMStopForumSpam - Download link and install instructions can be found on the LMStopForumSpam plugin page. The default configuration for LMStopForumSpam can be used.
  • LMSpamBotBehavior - Download link and install instructions can be found on the LMSpamBotBehavior plugin page. The default configuration for LMSpamBotBehavior can be used, but you should enable the bot behavior image to improve bot detection. See the LMSpamBotBehavior documentation on how to enable this option.

It is recommended that both spam check plugins are installed.

The end result

Your Nucleus blog should now be set up to use the LMCommentModerator plugin. For further reading i suggests the documentation for the LMCommentModerator plugin and the documentation for the LMReplacementVars plugin.

The below screenshots show some examples on how the LMCommentModerator plugin looks in the default Nucleus skin after applying the examples in this guide.

Unregistered user editing his comment

Moderator view of comments

Moderator view of admin page


Add Comment

Spam and off topic comments will be deleted.

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

Blog Filter

Filtered by labels: None.

Search site