NP_CommentCensor.php

The CommentCensor plugin will block the display of offensive words/phrases in comments. Each blog maintains its own list of offensive words. By default, the actual comment text, as stored in the database, is not changed. But it can be set to not allow offensive comments to be saved. Offensive words/phrases will be replaced by the string ”****” when the comment is displayed on the blog.

Note: If you want to censor items, as well as comments, please use the NP_Censor plugin.

Note from the developer: This is not designed to be a SPAM fighting plugin, though one could imagine it used for such a purpose with the block option enabled. I believe it would require a lot of management for minimal results as a SPAM fighting tool. It is intended to keep church or children sites from displaying naughty words, to keep Voldemort's name off the blogs at the Ministry of Magic, or to censor mention of the Yankees on a Red Sox fan's site. It is as the name implies a censor.

General Plugin info
Author: Frank Truscott
Current Version: 0.2.3
Download: NP_CommentCensor.zip size=1KB, 1 file
Demo: none
Forum Thread: here

Upgrading 0.1 to 0.2

  1. Save your list of banned words for each blog
  2. Uninstall version 0.1
  3. Unzip the file and upload the contents to your plugin directory
  4. Install the plugin…
  5. Set the list of offensive phrases in the blog settings for each blog needing censorship

Upgrading 0.2 to 0.2.x

  1. Copy new NP_CommentCensor.php over the old file.

Installing

  1. Unzip the file and upload the contents to your plugin directory
  2. Install the plugin…
  3. Set the list of offensive phrases in the blog settings for each blog needing censorship

How to use the plugin

Compatibility Note: If you have NP_CommentControl, or any other plugin that subscribes to the PreAddComment event, you will need to move NP_CommentCensor up in the list of plugins so that it is listed before NP_CommentControl.

Simply set the list of banned words in the blog settings for each blog needed censorship. Below is an example of how it works.

If your list of banned words is:

Blasted, darn, foul up, uck 

The comment

I am so peeved at the Darn filthy ducks that continue to foul up our blasted sidewalks.

will be displayed as

I am so peeved at the **** filthy d****s that continue to **** our **** sidewalks.

If you set the “Should comments with banned words be blocked” option to 'yes', the user will not be able to submit comments with offensive words. He will instead see an error indicating why he could not submit the comment.

Available SkinVars and/or TemplateVars

  • There are no available SkinVars or TemplateVars for this plugin.

Options

  • In the settings for each blog, there will be a field where the blog administrator can maintain a comma-separated list of words and phrases to be censored from comments.
  • In the settings for each blog, there will be a field where the blog administrator can set whether comments with offensive words will be blocked (not saved to db). Default is no.

Tips and Tricks

Wishlist

Bugs

  • required PHP5 (str_ireplace)- thanks shimmy (fixed in 0.2.1)
  • some non-alphanumeric characters in the banned words list were causing strange results - thanks shimmy (fixed in 0.2.3)
  • Strange results with submission blocking enabled when NP_CommentControl is also installed. - thanks shimmy (workaround: NP_CommentCensor needs to appear higher in Plugin list than NP_CommentControl)

please report to the forum thread here.

History

  • Version 0.2.3, released 9-08-2006
    • fixed bug where some non-alphanumeric characters in the banned words list were causing strange results.
    • added warning in plugin Description when CommentControl is also installed to notify user that CommentCensor must appear higher in plugin list.
  • Version 0.2.2, private release
  • Version 0.2.1, released 9-06-2006
    • fixed bug that made PHP5 necessary (used str_ireplace)
  • Version 0.2, released 9-06-2006
    • added PreAddComment event to block objectional comments from being saved. Option set per blog. Requires uninstall of 0.1.
  • Version 0.1, released 8-28-2006
    • initial release

Plugin review

NP_CommentCensor version 0.2.3 works with Nucleus CMS version 3.31 - 2007-10-27 ftruscot

commentcensor.txt · Last modified: 2008/09/26 21:01 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki