Simple:Press Documentation

Plugin: Font Resize

Plugin Description

Plugin: Font Resize – This Simple:Press plugin adds a font resizing link to the forum display for users to change the size of all the forum fonts. The font options are small, default (medium), and large.

Plugin Features

Installing this Simple:Press plugin adds:

  • A new Font Resize 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 “font-resize” containing the plugin’s files.

Activating this plugin provides:

    • A change to the new “Font Resize” 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 font resizing button placed by default on the top right of the forum display page above the header.

    • Three (3) links exist in the button to allow decreasing from the default size, increasing from the default size, or resetting the forum font display size to the default (middle) size.

There are no new permissions added to the permission sets due to this plugin.

Plugin Requirements

Simple:Press version 5.2 and above is required.

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

As part of the installation, a “Font Resize” 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.

There are no new permissions added to the permission sets due to this plugin.

The plugin does have a template tag, but it is not used in any Simple:Press theme so no recommendation regarding Custom or Child Themes is being made.

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 “font-resize“.
  • 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 “font-resize.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” and then “Plugins” from the drop down Forum Admin menu. On the Simple:Press Administration panel select the “Font Resize” plugin on the “Plugin Management” panel and click on “Activate”. The “Activate/Delete” label changes to “Deactivate/Uninstall”.

To deactivate the plugin, click on “Deactivate”. The “Deactivate/Uninstall” label changes to “Activate/Delete”. Activating the plugin again reinstates plugin functionality.

Plugin Administrative Options

There are no admin option settings that require setting for this plugin.

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.

Note: THIS PLUGIN HAS A TRANSLATION PROJECT, BUT DOES NOT CURRENTLY CONTAIN ANY LANGUAGE TRANSLATION FILES.

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 the Font Resize Project within the repository for Simple:Press language translation files.

Note: The remainder of the “Plugin Translation” section is NOT APPLICABLE because there are no translation files within the Font Resize project.
  • 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 “Font Resize” 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 “Font Resize” 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 Special Notes

Currently there is a translation Project for the “Font Resize” plugin, but there are no language files within that project at this time.

Plugin Usage

Forum users can adjust the font size used on the forum pages among three (3) options.

    • Forum Display Font Resizing
    • This plugin introduces a forum font resizing button by default on the top right of the forum display just above the page header.
    • The default button appearance is:

    • Clicking on the small “A” reduces the size of the font in the forum.
    • Clicking on the middle “A” resets the size of the font to the default or middle size.
    • Clicking on the large “A” on the right increases the font size in the forum.
  • The selection is retained in a cookie so after being set, the font size is retained from forum visit to visit until the selection is changed by the user.

Template Tags Used in the Plugin

There is one (1) Template Tag used in this plugin and it is NOT used in any Standard Simple:Press themes. It does not reside in a template tag file within the plugin’s template tag folder either, but is in the Font Resize plugin file itself, ‘sp-font-resize-plugin.php’.

If the template tag is to be altered in any way, care should be taken to document/capture the changes made to the file so the modifications can be re-constituted if the plugin’s file, ‘sp-font-resize-plugin.php’, is ever updated by Simple:Press. Capturing the modifications in comments within the file is not sufficient because the file itself will be deleted and the comments lost if there is an update from Simple:Press.

Because the template tag is not used in any Simple:Press theme no recommendation regarding Custom or Child Themes is being made.

The Template Tag can be viewed by selecting its 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 no other Actions and Hooks available for this plugin.

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.1.



Individual Template Tags


 

sp_FontResizer

Description

sp_FontResizer() – This template tag displays the button used as the links to the three (3) font resizing options.

Usage

sp_FontResizer($args, $toolTipMinus=”, $toolTipReset=”, $toolTipPlus=”, $label=”);

Arguments

$args – List of arguments for controlling display.
Type:
(string) (optional)
Default:
‘tagClass’ => ‘spFontSizeControl’
‘boxClass’ => ‘spButton’
‘fontChar’ => ‘A’
‘echo’ => 1

tagClass‘: CSS Class for the Div.
boxClass‘: CSS Class of the Font Resizer box.
fontChar‘: The character to be displayed in the font resizer button. The character is displayed three (3) times with the size of the character indicating the relative size of the forum font resulting from clicking on that character.
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.

$toolTipMinus – Text displayed when hovering the cursor over the font character in the button that causes the font to be made the smallest (decreased) size.
Type:
(string) (optional)
Default:
None

$toolTipReset – Text displayed when hovering the cursor over the font character in the button that causes the font to be made the middle (default/reset) size.
Type:
(string) (optional)
Default:
None

$toolTipPlus – Text displayed when hovering the cursor over the font character in the button that causes the font to be made the largest (increased) size.
Type:
(string) (optional)
Default:
None

$label – Text displayed along side the button containing the font size adjusting character links.
Type:
(string) (optional)
Default:
None

Special Notes

In standard supplied Simple:Press themes this template tag is not included.

The plugin places the template tag in the upper right corner of the forum page above the header.

If the template tag is to be altered in any way, care should be taken to document the changes made outside the changed file so they can be re-constituted if there is an update to the plugin’s file, ‘sp-font-resize-plugin.php’, where the template tag resides.

The function requires the use of file ‘sp-font-resize-plugin.php’.

Examples

Display the font resize button using the defaults but with “tagClass” of “spFontSizeControl spRight”, where “$tipMinus” = “__sp (‘decrease forum font size’)” causes the message “decrease forum font size” to be displayed when the cursor is hovered over the smallest sized font character in the button, “$tipReset” = “__sp(‘reset forum font size’)” causes the message “reset forum font size” to be displayed when the cursor is hovered over the middle font character in the button, and “$tipPlus” = “__sp(‘increase font size’)” causes the message “increase font size” to be displayed when the cursor is hovered over the largest sized font character in the button.

sp_FontResizer('tagClass=spFontSizeControl spRight', $tipMinus, $tipReset, $tipPlus);

 

Actions and Hooks Used in the sp_FontResizer Template Tag

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