Simple:Press Documentation

Plugin: Announcements

Plugin Description

Plugin: Announcements – A plugin allowing for composition and displaying of an announcement on the forum pages.

Plugin Features

  • Allows the Forum Admin to decide if an announcement is to be displayed.
  • Allows the Forum Admin to compose the announcement to be displayed.
  • Allows the Forum Admin to stop displaying the announcement while keeping the announcement available for display at a later time.

Plugin Requirements

Requires Simple:Press version 5.5.0 and above.

The plugin must be activated and its options set up before it is operational.

As part of the installation, an “Announcement” section is added to the Plugin Management panel under the forum Admin menu – Plugins/Available Plugins. From this panel the Announcement plugin can be activated, deactivated, uninstalled, and its options set up using its “Activate/Delete” and “Deactivate/Uninstall/Options” selections. The Options link goes to the new Announcement Options panel where the Forum Admin can  activate/deactivate the announcement, compose an announcement displayed to those who visit the forum, and select from a list of location options where the announcement is to be displayed on the forum pages.

The plugin’s template tag is included in all current themes. If the default positions and layouts are acceptable, nothing need be done. If template tag changes are going to be made, it is recommended that a Child Theme is created first before installing this plugin. Information on installing themes is located on our Creating a Custom Theme page.

Plugin Installation and Activation

Please see Using Plugins on how to obtain and install the Announcements plugin. As mentioned there the default location for 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. On the Simple:Press Administration page menu, click “Plugins” to open the Plugins drop-down menu, and select “Available Plugins”. Select the “Announcement” plugin on the “Plugin Management” panel and click on “Activate”. The “Activate/Delete” label changes to “Deactivate/Uninstall/Options”. To deactivate the plugin, click on “Deactivate”. The “Deactivate/Uninstall/Options” label changes to “Activate/Delete”.

Plugin Administrative Options

From the aforementioned “Available Plugins” panel and “Plugin Management” section, click “Options” on the “Announcement” plugin to get the “Announcements and News” panel with “Options” section. From the “Options” section:

  • Select the location to display the announcement
    • Click on the button adjacent to the location options to select that location for displaying the announcement. The button indicates it is selected by turning green in color.
  • Select the users allowed to see the announcement
    • Click on the button adjacent to “Only display to logged in users” if only logged in users are allowed to see the announcement. The button indicates it is selected by turning green in color. If the announcement is for everyone visiting the forum, do not select the button.
  • Composing the announcement
    • Under the “Message” section, select the text box and type in the announcement to be displayed.
  • Implementing the choices
    • Click on the “Update” button at the bottom of the page implement the display choices and the announcement.
  • Not displaying an announcement
    • Remove any text from the “Message” section text box.
    • Click on the “Update” button to clear the display of a message.
    • or
    • If it is desired to maintain the announcement for later use, but not display it now, on the aforementioned “Available Plugins” panel and “Plugin Management” section, click “Deactivate”. The “Deactivate” label changes to “Activate”. By Clicking the “Activate” button at a later time, the existing announcement can be displayed again without having to re-type it.

Plugin Language Translation

A plugin’s message strings can be translated from English to other languages and then the translation displayed if language translation files are available. Some plugins may not have such files.

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

More information is available regarding translation files at Simple:Press Translations. 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.

The Announcements plugin’s available language translation files with translation statistics, and message translations can be viewed at Announcements Translations. If available, export the file for the selected language to its proper forum language sub-folder as a “mo” file using the export link at the bottom of the page displaying the actual message translations for the language selected. The default location for plugin language files is …/wp-content/sp-resources/forum-language/sp-plugins. If this path is changed, it is important to note that the plugin’s language file needs to reside in the language sub-folder for sp plugins wherever it has been moved and however it has been renamed. See Storage Locations for more information.

Plugin Usage

Forum visitors or users do not have actions associated with the use of this plugin.  They may be able to see the announcement message depending upon the options settings.

The Forum Admin selects the location on the forum page to display the announcement, whether or not only logged in users can view the announcement, and composes the announcement to be displayed.

Plugin Special Notes

None

Template Tags used in the Plugin

There is one (1) Template Tag available for this plugin that allows you to further customize it’s usage or otherwise customize your website. The Template Tag can be viewed by selecting its link below.

Actions and Hooks Used in the Plugin

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

Plugin and Template Tag Changelog

Since Simple:Press version 5.5.1

Codex page sync’d to code version 5.5.1.



Individual Template Tags

The one (1) Template Tag available for Plugin: Announcement is detailed below.


sp_AnnounceMessage

Description

sp_AnnounceMessage() – Displays the Announcement Message.

Usage

sp_AnnounceMessage($args);

Arguments

$args – List of arguments for controlling display.
Type:
(string) (optional)
Default:
‘tagId’ => ‘spAnnounceMessage’
‘tagClass’ => ‘spAnnounceMessage’
‘echo’ => 1
‘get’ => 0

‘tagId’: CSS ID for the Div.
‘tagClass’: CSS Class for the Div.
‘echo’: Flag to indicate whether to write out the generated html display code or just return the html display code. One (1) is true and causes the html display code to be written to the display. Zero (0) is false and causes the html display code to be returned instead of written out.
‘get’: Flag to indicate whether to short circuit the template tag display process and simply return data or to proceed with normal HTML display code generation. One (1) is true and the template tag display process is not done and data is returned. Zero (0) is false and normal html display code generation happens.

Special Notes

This function is supplied in the Announcements  members’ plugin.

Examples

Display the message put into the message option admin screen for the Announce Plugin.

sp_AnnounceMessage($args);

Actions and Hooks Used in sp_AnnounceMessage Template Tag

  • apply_filters(‘sph_AnnounceMessage_args’, $a) – Allows modification of the arguments to the template tag. $a contains the parsed arguments.
  • apply_filters(‘sph_AnnounceMessage’, $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.