Simple:Press Documentation

Plugin: Hide Posters

Plugin Description

– This Simple:Press plugin adds the ability to hide posters user information in forums and posts. Once enabled on a forum, posters’ user information can be hidden in new topics by default and/or can be manually toggled from hidden/unhidden using the Forum Toolset available on the post.

WARNING:
This plugin and its ability to hide and unhide post author’s information is primarily designed for use by forum Admins and Moderators and not other usergroups within the forum. Anyone given the permission can use the Forum Toolset to change the hide poster status of any post in a forum allowing post hiding.The Plugin: Private Posts provides finer control and limits and is designed more for use by forum users themselves.
Note:
This plugin requires the manual modification to the website’s active theme. The active theme’s Topic View template (spTopicView.php) must be modified to replace a post’s normal user information with a custom message such as “User Information Hidden”. It is strongly recommended that standard supplied Simple:Press themes not be modified, but instead a Child Theme or Custom Theme be developed to accommodate the changes to the theme.

Plugin Overview

  • Enables the ability to hide posters’ user information in specified forums by forum Admins.
  • Enables the ability to hide posters’ user information in specified forums by forum users given permission.
  • Allows new topics in specified forums to be set to hide posters information by default.
  • Enables forum Admin to toggle existing topics from hidden/unhidden by using the Forum Toolset available on forum posts.
  • Enables forum Admin to grant users permission to toggle any new and existing topics from hidden/unhidden by using the Forum Toolset available on forum posts.

Plugin Features

Installing this Simple:Press plugin adds:

  • A new “Hide Posters” 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 “hide-poster” containing the plugin’s files.

Activating this plugin provides:

    • A change to the new “Hide Posters” section in the Plugin Management panel under the Admin menu path Forum > Plugins > Available Plugins so the plugin can be deactivated, or uninstalled.
      • There are no options for this plugin.
      • The “Getting Started” link associated with the “Deactivate/Uninstall” selections should be selected to view the pertinent information regarding the plugin.
    • A new check box “Enable ability to hide posters on this forum” in the “Extended Forum Options” section of the existing “Forums – Manage Groups and Forums” forum Admin panel where the forum Admin can select to allow forum Admins to hide posters in a specific forum.
      • Only forum Admins are allowed to hide posters with this enable/disable.
      • The “Forums – Manage Groups and Forums” forum Admin panel is accessed from the Forum Admin menu at Forum > Forums > Manage Groups And Forums and then by clicking on the “Edit This Forum” button associated with the forum receiving the ability to hide posters.
    • A new check box “Enable hide poster info by default on new topics form (if enabled in forum)” in the “Hide Poster Info” section of the existing “Options – Content Settings” forum Admin panel where the forum Admin can select to have the poster’s information hidden on new topics.
      • The “Options – Content Settings” forum Admin panel is accessed from the Forum Admin menu at Forum > Options > Content Settings.

For Forum Admins and Forum Users with the “Can enable hide posters for a topic” permission

  • A new check box “Hide posters in this topic” in the options section of the “Add Topic” form where the post author can elect to hide or not hide the user information about forum members posting in the topic being added.
    • The check box is selected if it contains are green check mark. The check box can be deselected by clicking on it if it contains a green check mark to cause the check mark to be removed.
    • The available options can be seen once the “Options” button under the text input area of the “Add Topic” form has been selected/clicked.
    • The “Add Topic” form is accessed by clicking the “Add Topic” button when viewing a Forum or a Topic.
  • New entries “Disable hiding posters” or “Enable hiding posters” in the Forum Toolset menu where the setting for a post can be toggled between the two selections.
    • If the post is currently set to “hide posters”, the “Disable hiding posters” is displayed.
    • If the post is currently not set to “hide posters”, the “Enable hiding posters” is displayed.
    • On each post the Forum Toolset menu can be accessed by a forum Admin (or a forum user having permissions on that post that are provided in the toolset) by hovering the cursor over the upper left hand corner of column one of the post (where the Avatar normally is or where the special “hidden poster” message is displayed until the Forum Toolset icon (wrench crossed by a screwdriver) is visible and the message “Open the forum toolset” is displayed.

There is one (1) new permission added to the permission sets due to this plugin.

  • Can enable/disable hide posters for a topic.
  • The permissions on the “Permissions – Manage Permissions” forum Admin panel can be accessed from the WP Admin panel at:
    • Forum > Permissions > Manage Permission Sets and clicking the “Edit Permission” button for the permission sets to have the permissions enabled or disabled.

Plugin Requirements

Simple:Press version 5.6 and above is required.

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

As part of the installation, a “Hide Posters” 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, or deleted.

  • There are no options that need be set up for this plugin from the “Hide Posters” section of the Plugin Management panel, but there is functionality to be enabled as discussed in the Plugin Administrative Options section of this plugin page.

There is one (1) new permission added to the permission sets due to this plugin.

  • Can enable/disable hide posters for a topic.

The plugin does not have template tags so no recommendation regarding Custom or Child Themes is being made for potential changes to template tags.

Installing and Activating

Please see Using Plugins on how to obtain and install this 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 “hide-poster“.
  • 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 “hide-poster.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 “Hide Posters” plugin and click on “Activate”. The “Activate/Delete” label changes to “Deactivate/Uninstall” with a “Get Started” Link.

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

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

 

Plugin Administrative Options

After installing and activating, there are no Administrative Options to be set for this plugin from the “Hide Posters” section of the Plugin Management panel.

From the Forum Admin menu on the left of admin pages, select Forum > Forums > Manage Groups And Forums to see the list of groups and forums within the groups to select forums in which to allow poster information hiding.

  • Enable Ability To Hide Posters On A Forum by the Forum Admin
    Note:
    This option is also available on the new forum creation form to give the forum Admin maximum flexibility to only enable the hide posters information on specific forums.
    Note:
    This option also adds a “Hide posters in this topic” option to the “Add Topic” form for the forum Admin.
    • Allowing post author’s information on posts to be hidden in a forum is controlled by the forum Admin.
    • Each forum that is to have this ability must have the permission turned on.
    • By default only the forum Admin will have permission to hide posters information.
    • This is accomplished from the Simple:Press Administration panel Admin menu by clicking/opening Forum > Forums > Manage Groups And Forums, then clicking on the “Edit This Forum” button associated within the forum to be given the permission to view the forum’s “Forum – Manage Groups and Forums” forum Admin panel.
    • Scroll down the panel to the “Extended Forum Options” section.
    • Click the check box next to “Enable ability to hide posters on this forum” to set/enable the permission. When enabled, the check box contains a green check mark.
    • If there are no other forum permissions to set, click the “Update Forum” button 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 forum to have this permission.

From the Forum Admin menu on the left of admin pages, select Forum > Options > Content Settings to the “Options – Content Settings” forum Admin panel where the default can be set to hide poster information on the new topic form (if hiding is enable in the forum).

  • Setting the “Default” to Hiding Poster Information on the New Topic Form
    • On the “Options – Content Settings” forum Admin panel (Forum > Options > Content Settings) scroll down to the “Hide Poster Information” section.
    • Click the check box next to “Enable hide poster info by default on new topic form (if enabled in forum)” to set/enable the permission. When enabled, the check box contains a green check mark.
    • If there are no other forum permissions to set, click the “Update Content Options” button 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 option when followed by clicking the “Update Content Options” button to save the revised selection.

From the Forum Admin menu on the left of admin pages, select Forum > Permissions > Manage Permission Sets to see the permission sets available to select usergroups to have the permission to hide/unhide poster information on new topics and posts in forums where hiding posters is enabled.

WARNING:
This plugin and its ability to hide and unhide post author’s information is primarily designed for use by forum Admins and Moderators and not other usergroups within the forum. Anyone given the permission can use the Forum Toolset to change the hide poster status of any post in a forum allowing post hiding.
  • Assigning New Permissions
    • “Can enable/disable hide posters for a topic” permission
      • Allowing users to hide the post author’s information on posts in a topic in a forum is controlled by their group permissions.
      • Each usergroup that is to have this 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 “Creating” click the check box next to “Can enable/disable hide posters for a topic” to set/enable the permission. When enabled, the check box contains a green check mark.
      • If there are no other permissions to set, click the “Update Permission” button 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.

This plugin requires a manual modification to the active Simple-Press theme to replace the user post information with a custom message when poster information is being hidden.

  • If not already done, a Child Theme should be developed following the steps found at the Creating a Child Theme Codex page or as a secondary option a Custom Theme be developed as discussed at the Creating a Custom Theme Codex page.
  • If not already done, the file to be copied over from the Parent Theme is the Topic View template (‘spTopicView.php’). The modification is to cause all of the user post info section of the topic view template file to be replaced in the page with a custom message when the user post information is being hidden.
  • Once the template file ‘spTopicView.php’, to be modified is in the appropriate Child or Custom Theme subfolder, open it for editing, make the changes discussed below, annotate the file header with the date as well as a description of the file change, and save the edited file.
  • In the opened file look for the start Column 1, the User Section and the end of the section each of which may look something like:
# Column 1 of the post row
# ----------------------------------------------------------------------
sp_ColumnStart('tagClass=spUserSection spLeft&width=15%&height=50px');
sp_PostIndexUserDate('tagClass=spPostUserDate spCenter');
.
.
.
sp_SectionEnd('', 'user-identities');
if (function_exists('sp_PostIndexRepUser')) sp_PostIndexRepUser('tagClass=spCenter', '', __sp('Give/Take Reputation'));
sp_ColumnEnd();
  • The following additions are being made:
      • 1. Near the top the following is added to display the “User Information Hidden” message:
    if ($spThisTopic->forum_hide_posters && $spThisTopic->topic_hide_posters) {
    echo '
    User Information Hidden

    ‘; } else {

    2.Near the bottom, a “}” is being added between the ‘sp_SectionEnd()’ and the ‘sp_ColumnEnd()’ functions.

    }
  • In the end, it should look something like:
    Note:
    There may be more or less template functions within the ‘else’ section of code and the column widths might be different.
# Column 1 of the post row
# ----------------------------------------------------------------------
sp_ColumnStart('tagClass=spUserSection spLeft&width=15%&height=50px');
if ($spThisTopic->forum_hide_posters && $spThisTopic->topic_hide_posters) { //Added for Hide Posters plugin
echo '
User Information Hidden

‘; //Added for Hide Posters plugin } else { //Added for Hide Posters plugin sp_PostIndexUserDate(‘tagClass=spPostUserDate spCenter’); sp_UserAvatar(‘tagClass=spPostUserAvatar spCenter&context=user’, $spThisPostUser); sp_PostIndexUserName(‘tagClass=spPostUserName spCenter’); sp_PostIndexUserLocation(‘tagClass=spPostUserLocation spCenter’); sp_PostIndexUserRank(‘tagClass=spPostUserRank spCenter’); sp_PostIndexUserSpecialRank(‘tagClass=spPostUserSpecialRank spCenter’); sp_PostIndexUserMemberships(‘tagClass=spPostUserMemberships spCenter’); if (function_exists(‘sp_PostIndexUserReputationLevel’)) sp_PostIndexUserReputationLevel(‘tagClass=spPostReputationLevel spCenter’); sp_PostIndexUserPosts(‘tagClass=spPostUserPosts spCenter’, __sp(‘Forum Posts: %COUNT%’)); if (function_exists(‘sp_PostIndexCubePoints’)) sp_PostIndexCubePoints(‘tagClass=spPostUserCubePoints spCenter’, __sp(‘CubePoints’)); if (function_exists(‘sp_PostIndexMyCred’)) sp_PostIndexMyCred(‘tagClass=spPostUserMyCred spCenter’, __sp(‘MyCred ‘), __sp(‘MyCred’)); sp_PostIndexUserRegistered(‘tagClass=spPostUserRegistered spCenter’, __sp(‘Member Since:
%DATE%’)); sp_PostIndexUserStatus(‘tagClass=spCenter spPostUserStatus’, __sp(‘Online’), __sp(‘Offline’)); sp_SectionStart(‘tagClass=spCenter’, ‘user-identities’); sp_PostIndexUserWebsite(”, __sp(‘Visit my website’)); sp_PostIndexUserTwitter(”, __sp(‘Follow me on Twitter’)); sp_PostIndexUserFacebook(”, __sp(‘Connect with me on Facebook’)); sp_PostIndexUserMySpace(”, __sp(‘See MySpace’)); sp_PostIndexUserLinkedIn(”, __sp(‘My LinkedIn network’)); sp_PostIndexUserYouTube(”, __sp(‘View my YouTube channel’)); sp_PostIndexUserGooglePlus(”, __sp(‘Interact with me on Google Plus’)); sp_SectionEnd(”, ‘user-identities’); if (function_exists(‘sp_PostIndexRepUser’)) sp_PostIndexRepUser(‘tagClass=spCenter’, ”, __sp(‘Give/Take Reputation’)); } //Added for Hide Posters plugin sp_ColumnEnd();

  • Once the Child or Custom theme has been established and the changes have been made to the ‘spTopicView.php’ file, be sure to activate the theme on the website from the Forum Admin menu at Forum > Themes > Available Themes where it is shown in the “Available Themes – Select Simple:Press Theme” forum Admin panel.

If it is desired, other Display changes might be made by revising the change added to the top of the ‘spUserSection’ section.

    • With the initial change when posters info is being hidden, instead of seeing the post’s user information a message is displayed saying “User Information Hidden”. This message can be altered by changing the “echo” call in the template file ‘spTopicView.php’. For instance if the message “Hidden” were to be desired, the ‘echo’ call would be:
if ($spThisTopic->forum_hide_posters && $spThisTopic->topic_hide_posters) {
echo '
Hidden

‘; } else {

    • Additionally, if a custom picture (avatar, icon) were to be displayed along with the text “User Information Hidden” the picture could be uploaded through the website’s wordpress media and an additional ‘echo’ call using the url of the picture could be added:
if ($spThisTopic->forum_hide_posters && $spThisTopic->topic_hide_posters) {
echo '
User Information Hidden

‘; echo ‘http://mysite.com/wp-content/uploads/2013/05/mask.pn’; } else {

    • Just replace the ‘http://mysite.com/wp-content/uploads/2013/05/mask.png’ with the url of your image and adjust the height and width to your preference if necessary.

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 Hide Posters 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 “Hide Posters” 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 “Hide Posters” 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 Admins and Forum Users with the “Can enable/disable hide posters for a topic” permission use this plugin to hide poster information when creating new topics in forums with the hide posters enabled.

  • Creating a New Topic and Hiding Poster Information
    • Navigate to a forum or a topic in a forum and click the “Add Topic” button to display the “Add Topic” form.
    • At some point while completing the post, scroll down to view the “Options” section or click on the “Options” button to see the “Options” section of the form.
    • In the “Options” section, click on the check box to the left of “Hide posters in this topic” to select it.
      • The check box is selected if there is a green check mark in it.
      • Clicking a check box containing a green check mark removes the check mark and deselects the check box.
    • After completing the sections of the new topic post, click on the “Submit Topic” button at the bottom of the form to submit the topic post.

The “Hiding” status on topics/posts in a forum with hide posters enabled can be changed using the “Forum Toolset” available on each post that has hide posters enabled.

  • A forum Admin can change the hide poster status on any topic/post in a forum that has hide posters enabled.
  • Forum users with the “Can enable/disable hide posters for a topic” can change the status on any topic/post in a forum that has hide posters enabled.
  • Hiding and Unhiding Poster Information Using the Forum Toolset on a Post
    • Navigate to the forum and click on a topic in a forum to view it and all of its posts.
    • On a post meeting the above criteria, hover the cursor over the upper left hand corner of column one (1) of the post (where the Avatar normally is or where the special “hidden poster” message is displayed until the Forum Toolset icon (wrench crossed by a screwdriver) is visible and the message “Open the forum toolset” is displayed.
    • Click on the “Forum Toolset” button to display the “Forum Tools” popup with its options.
      • If the post currently has hide posters enabled, the option “Disable hiding posters” is displayed.
      • If the post currently has hide posters disabled, the option “Enable hiding posters” is displayed.
    • To change the post’s hide posters status, click on the currently displayed option.
      • The post’s user information column changes (to either hidden or showing) and when the Forum Toolset option is again viewed, it has toggled to the other option.
      • If the post now has hide posters enabled, the option “Disable hiding posters” is displayed.
      • If the post now has hide posters disabled, the option “Enable hiding posters” is displayed.

Plugin Special Notes

Note:
This plugin requires the manual modification to the website’s active theme. The active theme’s Topic View template (‘spTopicView.php’) must be modified to replace a post’s normal user information with a custom message such as “User Information Hidden”. It is strongly recommended that standard supplied Simple:Press themes not be modified, but instead a Child Theme or Custom Theme be developed to accommodate the changes to the theme.

Template Tags Used in the Plugin

There are no Template Tags used in this plugin.

Actions and Hooks Used in the Plugin

There are no Actions and Hooks available in Template Tags for this plugin.

There are other Actions and Hooks available in this plugin to modify aspects of this plugin.
In file ‘sp-hide-poster-components.php‘:

  • apply_filters(‘sph_hide_poster_form_label’, __(‘Hide posters in this topic’, ‘sp-hide-poster’)) – Allows modification of the display code associated with the label “Hide posters in this topic” just prior to being output/returned.
  • apply_filters(‘sph_post_tool_hide_poster’, $out) – Allows modification of the display code associated with the forum Toolset entry for “Disable Hide Posters” and “Enable Hide Posters” just prior to being output/returned.

Plugin and Template Tag Changelog

Since Simple:Press version 5.0.

Codex page sync’d to code version 5.6.4 and plugin version 1.0.12.

More Topics In SimplePress: Plugins


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