Simple:Press Documentation

Plugin: Report Post

Plugin Description

Plugin: Report Post – This Simple:Press plugin allow users having the proper permission to report posts with questionable content to forum Administrators.

Plugin Features

Installing this Simple:Press plugin adds:

  • A new Report Post section in the “Available Plugins – Install Simple:Press Plugins” panel under the forum Admin menu path Forum > Plugins > Available Plugins. From this panel the plugin can be activated, or deleted by the Admin.
  • When properly installed, a new folder in the “forum-plugin” folder named “report-post” containing the plugin’s files.

Activating this plugin provides:

  • A change to the new Report Post section in the “Available Plugins – Install Simple:Press Plugins” panel under the Admin menu path Forum > Plugins > Available Plugins so the Simple:Press plugin can be deactivated, uninstalled, or have its Options set up.
    • The Options link goes to the existing “Options – Email Settings” forum Admin panel.
    • The “Getting Started” link associated with the “Deactivate/Uninstall/Options” selections should be selected to view the pertinent information regarding the plugin.
  • A new “Report Post” section in the existing “Options – Email Settings” forum Admin panel where the list of e-mail addresses that are to be notified by email when a user is reporting a post with questionable content.
  • For the users with the permission “Can report a post to administrators”, a new “Report” button is displayed right above the post’s text in each post in the Topic View. This button is used to initiate the reporting of a post with questionable content.
  • A new “Report Questionable Post” form displayed when the “Report” button is selected.
    • In the form, the author and the textual content of the post being reported is displayed. The form also has a text input box where the reporting user can provide the reason the post is being reported.
  • Emails containing the information from the “Report Questionable Post” form sent to the email addresses on the list set up in the “Report Post” section of the “Options – Email Settings” forum Admin panel when a forum user reports a post with questionable content.

There is one (1) new permission, “Can report a post to administrators”, added to the permission sets due to this plugin.

Plugin Requirements

Simple:Press version 5.5.7 and above is required.

This plugin must be installed, activated, and its options set before it is operational.

As part of the installation, a “Report Post” section is added to the Plugin Management panel under the admin menu Forum > Plugins > Available Plugins. From this panel the plugin can be activated, deactivated, uninstalled, deleted, or its options set using its “Activate/Delete” and “Deactivate/Uninstall/Options” selections.

  • The Options link goes to the “Options – Email Settings” forum Admin panel with a new “Report Post” section.

There is one (1) new permission, “Can report a post to administrators”, added to the permission sets due to this plugin that must be enabled in the permission sets for the usergroups being allowed to report posts with questionable content.

The plugin has one (1) template tag ‘sp_PostIndexReportPost()’ incorporated into standard supplied Simple:Press themes.

  • If the location of the template tag in the themes as well as the argument and parameter values for the template tag are acceptable, nothing need be done.
  • If any item relating to the template tag is to be modified or if the other template tags are to be added to a theme, it is recommended that a Child or Custom theme is created first to accept the changes prior to installing this plugin.
  • In all cases the template tag should be called conditionally, if (function_exists(‘ ‘)) so that if the plugin is deactivated or does not exist, the website will continue to operate.

Plugin Installation and Activation

Please see Using Plugins on how to obtain and install this Simple:Press plugin.

  • Whatever method is used to add the Simple:Press plugin, the folder that should have been added to the forum plugin folder is named “report-post“.
  • If using the “Simple:Press Upload Plugin – Upload a Simple:Press Plugin” panel at the forum Admin menu Forum > Plugins > Plugin Uploader, the folder to browse for after downloading it from the Simple:Press site is “report-post.zip” before clicking the “Upload Now” button.

As mentioned there the default location for Simple:Press plugin folders is …/wp-content/sp-resources/forum-plugins. If this path is changed, it is important to note that the plugin’s folder and its content need to reside in the forum plugins folder wherever it has been moved and however it has been renamed. See Storage Locations for more information.

Activation is accomplished from the Admin Dashboard panel menu by selecting Forum > Plugins > Available Plugins from the drop down forum Admin menu. On the “Available Plugins – Install Simple:Press Plugins” panel select the Report Post plugin and click on “Activate”. The “Activate/Delete” label changes to “Deactivate/Uninstall/Options” with a “Getting Started” Link.

  • The “Getting Started” link associated with the “Deactivate/Uninstall/Options” selections should be selected to view the pertinent information regarding the plugin.

To deactivate the plugin, click on “Deactivate”. The “Deactivate/Uninstall/Options” label changes to “Activate/Delete”.
To re-activated the plugin, click on on “Activate”. The “Activate/Delete” label changes to “Deactivate/Uninstall/Options”.

Plugin Administrative Options

After activation, a) on the aforementioned “Available Plugins – Install Simple:Press Plugins” panel, click “Options” on the Report Post plugin section or b) under the Options entry on the forum menu on the left side forum admin page click the Email Settings sub-menu item to get the “Options – Email Settings” Admin panel with the “Report Post” section.

  • Specifying the List of Email Addresses to Receive the Email When a Post is Reported
    • Go to the “Report Post” section of the Admin panel.
    • In the text input box to the right of “Report post email address list:”, enter the comma separated list of email addresses to receive the report email when a user reports a post with questionable content.
      • The list can be changed at a later date by editing the list.
    • Click on the “Update Email Options” button at the bottom of the panel to save the settings.

From the Forum Admin menu on the left of admin pages, select Forum > Permissions > Manage Permission Sets to see the permission sets available.

  • Assigning New Permissions
    • Can report a post to administrators permission
    • Allowing users to report posts with questionable content is controlled by their group permissions.
    • Each member group that is to have that ability must have the permission turned on.
    • This is accomplished from the Simple:Press Administration panel Admin menu by clicking/opening Forum > Permissions > Manage Permission Sets.
    • Select “Edit Permission” for the permission set to be updated to view the “Permissions – Manage Permissions” panel.
    • Under “General” click the check box next to “Can report a post to administrators” to set/enable the permission. When enabled, the check box contains a green check mark.
    • Click “Update Permission” at the bottom of the page to have the selection saved.
    • At a later time clicking the check box when it has a green check mark removes the check mark and will remove the permission when followed by clicking “Update Permission” to save the revised selection.
    • Repeat these steps on each usergroup to have this permission.

To be complete for multilingual forums, the language translation files for this plugin should be installed or downloaded/properly placed in the appropriate forum-language folder for SP plugins using one of the procedures below in the “Plugin Language Translation” section of this page.

Plugin Language Translation

A plugin may not have language translation files, but in general each Simple:Press plugin has its own language translation files each with multiple pages for translating the forum plugin’s message strings.

Forum Plugin translation files are to reside in a unique forum folder location as defined by the “Simple:Press Plugin Language Files” entry on the “Integration – Storage Locations” forum Admin panel available through the forum Admin menu at Forum > Integration > Storage Locations.

  • The default location for forum plugin translation files is the folder “…/wp-content/sp-resources/forum-language/sp-plugins”.

Information regarding downloading language files, “mo’ language file placement, and translation (language localization) is found at Localization.

WARNING: On the Localization page, the Language Translation “.mo” Files Overview should be reviewed and well understood for naming convention and language translation file placement.

More information is available regarding translation files at Simple:Press Translations. which is the repository for Simple:Press language translation files. On the base page, select the “Getting Started Guide” link for basics about it’s use. On that page, select the “register a username here” link to obtain a password to the site. Use the “Contact Form” link to request the desired language if it is not currently available. The “Contact Form” link may also be used to volunteer to be a validator for a translation project.

This plugin’s available language translation files with translation statistics, and message translations can be viewed at Report Post within the repository for Simple:Press language translation files.

  • Installing this Simple:Press Plugin’s Language Translation “.mo” files
    The plugin’s language translations files for each language can be correctly located in two ways.

    • Using the Admin Word:Press “Site Language” and Simple:Press “Language Translation” Features
      WARNING: On the Localization codex page, the Language Translation “.mo” Files Overview should be reviewed and well understood for naming convention and language translation file placement.
        • Under the “Language Translation Selection Sequences” heading, the “Coordinated Language Translation File Download Using the Simple:Press ‘Language Translation’ Selection” section, follow the instructions at “Adding its Translation File(s) After Downloading/Activating a Simple:Press Theme or Simple:Press Plugin”.
          • Follow the instructions to select the “Site Language” and then get to the admin page with the “Integration – Language Translations” section where there should be an entry for “Report Post” along with an “Install” button.
          • Click on the “Install” button for this plugin to install the language translation file for the current “Site Language” language.
            • Note: If the message “No Translation Project Exists” is displayed rather than the “Install” button, a translation file for that language could not be found in GlotPress at this time. Consider posting in the Simple:Press forum if it is felt there needs to be one added.
          • Be sure to verify the locale (filename) for the “.mo” file matches the language code for the language as referenced in the “Warning” above. If it does not, change it to match.
          • As called out in the section, continue to change the “Site Language” language and repeat the process until all desired translation files for this plugin have been installed.

       

    • Manually Finding and Storing Simple:Press Plugin’s Language Translation ‘mo’ files
    • WARNING: On the Localization codex page, the Language Translation “.mo” Files Overview should be reviewed and well understood for naming convention and language translation file placement.
    • After reviewing the material discussed under the “Language Translation Selection Sequences” heading, the “Manual Installation of Simple:Press Language Translation Files section, follow the steps outlined at “Finding and Storing ANY Simple:Press Plugin’s Language Translation ‘mo’ files”.
    • Each time through the process at the step, “Scroll down the list and click on the name of the plugin whose language files are being sought to see the translation file Version Number available”, substitute “Report Post” for the phrase “the name of the plugin whose language files are being sought”.
    • Be sure to verify the locale (filename) for the “.mo” file matches the language code for the language as referenced in the “Warning” above. If it does not, change it to match.
    • Repeat the steps for each language it is desired to have a translation file (french, spanish, etc.) for the plugin on the website.

Plugin Usage

Forum users with the “Can report a post to administrators” permission can report a post with questionable content to the forum Administator(s).

  • Reporting a Post With Questionable Content
  • Navigate to the forum and the Topic View within that forum to view the post with questionable content.
  • Just above the body of the post, click on the “Report” button to have the “Report Questionable Post” form displayed.
    • If the “Report” button is not visible, the user does not have permission to report posts.
  • In the “Report Questionable Post” form, verify the name of the poster being reported and the post content being reported.
  • In the text input box below “Your Comments On this Post”, insert the information for the forum Admin regarding why this post is being reported.
  • To cancel the report and return to the forum, click the “Return to Forum” button at the bottom of the form.
    • The report is not sent, the comments in the report form are lost, and the user is returned to the post that was going to be reported.
  • To send the report, click the “Send Post Report” button at the bottom of the form. It will be sent to the email addresses set up by the forum Admin in the “Report Post” section of the “Options – Email Settings” forum Admin panel.
    • The “Email Notification Sent” message is displayed, and the reporter is returned to the post that was reported.
    • If sending the notification was not successful, the “Email Notification Failed” message is displayed, and the reporter is returned to the post that was to be reported.
      • If the email failed to be sent, contact the forum Administrator regarding the failure.

Individuals (typically forum Admins) whose email addresses were set up in the “Report Post” section of the “Options – Email Settings” forum Admin panel receive an email containing the information from the “Report Questionable Post” form when a forum user reports a post with questionable content.

  • After reviewing the email, the individuals can decide what action, if any, is warranted.

Plugin Special Notes

None

 

Template Tags Used in the Plugin

There is one (1) template tags available for this plugin that allow further customization of the plugin’s usage or otherwise customize the website. ‘sp_PostIndexReportPost()‘, is incorporated into standard supplied Simple:Press themes.

  • If the location of the template tag in the themes as well as the argument and parameter values for the template tag are acceptable, nothing need be done.
  • If any item relating to the template tag is to be modified or if the other template tags are to be added to a theme, it is recommended that a Child or Custom theme is created first to accept the changes prior to installing this plugin.
  • In all cases the template tag should be called conditionally, if (function_exists(‘ ‘)) so that if the plugin is deactivated or does not exist, the website will continue to operate.

The Template Tags can be viewed by selecting their link below.

Action and Hooks Used in the Plugin

There are Actions and Hooks available in the Plugin’s Template Tag. The Template Tag’s Action and Hooks can be viewed by selecting its link below.

There are three (3) other Actions and Hooks available for this plugin.
In file ‘sp-report-post-components.php’

  • apply_filters(‘sph_ReportPost’, $out) – Allows modification of the fields in the “Report Post” form display code just prior to being output/returned.
  • apply_filters(‘sph_report_post_email_msg’, $msg, sp_esc_int($_POST[‘postid’]), $report, $reporter) – Allows modification of the message sent in an email to forum Admins when a user is reporting a post with questionable content just before the email is sent.
  • apply_filters(‘sph_report_post_email_subject’, sprintf(__(‘[%s] questionable post report’, ‘sp-report’), get_option(‘blogname’)), $posted, $reporter) – Allows modification of the subject line/title of the email sent to forum Admins when a user is reporting a post with questionable content just before the email is sent.

Plugin and Template Tag Changelog

Since Simple:Press version 5.2.

Codex page sync’d to code version 5.6.0 and plugin version 1.2.12.



Individual Template Tags


 

sp_PostIndexReportPost

Description

sp_PostIndexReportPost() – This template tag displays the button used as the link to the “Report Post” form used to report a post of questionable content to the forum Administrator.

Usage

sp_PostIndexReportPost($args, $label=”, $toolTip=”);

Arguments

$args – List of arguments for controlling display.
Type:
(string) (optional)
Default:
‘tagId’ => ‘spPostIndexReport%ID%’
‘tagClass’ => ‘spPostReportPost’
‘icon’ => ‘sp_ReportPost.png’
‘iconClass’ => ‘spIcon’

‘tagId’: CSS Id for the Div. The %ID% is replaced with the post ID.
‘tagClass’: CSS Class for the Div.
‘icon’: Filename of the file containing the icon to to be displayed with the button.
‘iconClass’: CSS Class for the icon displayed with the button.

$label – Text displayed on the button along with the icon.
Type:
(string) (optional)
Default:
None

$toolTip – Text displayed when hovering the cursor over the button.
Type:
(string) (optional)
Default:
None

Special Notes

In standard supplied Simple:Press themes this template tag is included in the Topic View page (‘spTopicView.php’) file.

    The exception is the Reboot theme where it is not included in ‘spTopicView.php’, but is included in ‘spTopicViewDesktop.php’ and ‘spTopicViewMobile.php’ files.

The function is be called conditionally, if (function_exists(‘ ‘)), so that if the plugin is deactivated or does not exist, the website will continue to operate.

If the template tag is to be altered within the theme in any way, it is suggested a Custom or Child theme be made to accept the template tag. Please see discussion at Template Tags Used in the Plugin.

The function requires the use of file ‘sp-report-post-tag.php’.

Examples

Display the report post button using the defaults but with “tagClass” of “spButton spRight”, “Report” as the label on the button, and the message “Report this post to admin” when the cursor is hovered over the button.

if (function_exists('sp_PostIndexReportPost')) sp_PostIndexReportPost('tagClass=spButton spRight', __sp('Report'), __sp('Report this post to admin'));

 

Actions and Hooks Used in the sp_PostIndexReportPost Template Tag

  • apply_filters(‘sph_PostIndexReportPost_args’, $a) – Allows modification of the arguments to the template tag. $a contains the parsed arguments.
  • apply_filters(‘sph_PostIndexReportPost’, $out, $a) – Allows modification of the display code just prior to being output/returned. $out will contain the html display code.

Changelog

See Plugin and Template Tag Changelog for Template Tag changes and Codex page syncing to code versions.


More Topics In SimplePress: Plugins


Copyright © 2006-2019 Simple:Press. All Rights Reserved.