Simple:Press Documentation

Plugin: Share This

Plugin Description –

This Simple:Press plugin is for social sharing of forum topics and posts with Facebook, Twitter, Google Plus and more using the Share This service.

Note: The Share This plugin for WordPress does not have to be installed for this Simple:Press plugin to function.

  • Becoming a Registered Publisher with Share This at sharethis.com/createaccount is not a requirement, but sharing analytics data is only available to Registered Publishers.
  • A Share This generic public key is used if the forum Admin (or someone associated with the forum) is not a Registered Publisher with Share This.

Plugin Overview

    • Utilizes the Share This service to add social sharing buttons to the forum.
    • Provides buttons in the Group View to share the list of groups and forums on various social network websites.
    • Provides buttons in the Forum View to share the forum and its list of topics on various social network websites.
    • Provides buttons in the Topic View to share the topic and its list of posts on various social network websites.
    • Provides buttons in the posts in Topic View to share the post on various social network websites.
    • Comes with the most popular social sites included and the ability to add buttons for more if needed.
    • Offers 8 predefined widget popup themes from which to choose.

Example of Share This Buttons in a Topic Header

Plugin Features

Installing this Simple:Press plugin adds:

  • A new “Share This” 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 “share-this” containing the plugin’s files.

Activating this plugin provides:

    • A change to the new “Share This” 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 new “Share This Plugin” forum Admin panel with several sub-panels and sections.
      • The “Getting Started” link associated with the “Deactivate/Uninstall/Options” selections should be selected to view the pertinent information regarding the plugin.
    • A new sub-menu entry “Share This” under the Forum Admin menu “Components” entry that is a link to the new “Share This Plugin” forum Admin panel.
      • The “Share This” sub-menu entry can be accessed from the Forum Admin menu at Forum > Components.
    • A new “Share This Plugin” forum Admin panel containing several sub-panels with sections.
      • “Share This Plugin” subpanel with “Share This Options” section where options for the plugin are set up.
      • “Share This Plugin” subpanel with “Share This Buttons” section where the various social network website buttons from the Simple:Press ‘standard set’ can be selected.
      • “Share This Plugin” subpanel with “Share This Icon Style” section where the icon style for the various social network website buttons is selected.
      • “Share This Plugin” subpanel with “Share This Widget Theme” section where the Share This popup widget appearance is set up if it is being used.
      • The “Share This Plugin” forum Admin panel can be accessed from the Forum Admin menu at:
        • Forum > Components > Share This
        • Forum > Plugins > Available Plugins > Share This > Options
    • New buttons on the forum pages for forum users to share forum content on the selected social networks.
Note:
The configuration of the buttons seen on the forum pages is selected by the forum Admin via the sections on the “Share This Plugin” forum Admin sub-panels.

  • The individual social networks to have buttons displayed are selected in the “Share This Buttons” section.
  • The style of the buttons displayed (Icons, Small icons, Buttons, Horizontal counts, or Vertical Counts) is selected in the “Share This Icon Style” section.
    • In the Group View forum page header, new buttons selected by the forum Admin for forum users to share all the groups and all the forums, topics, and posts.
    • On the Forum View forum page, in the forum header new buttons selected by the forum Admin for forum users to share the entire forum with all its topics and posts.
    • On the Topic View forum page:
      • In the topic header new buttons selected by the forum Admin for forum users to share the topic and all its posts.
      • In each post of the topic new buttons selected by the forum Admin for forum users to share posts.
  • A new “Share this with your friends popup widget” displayed when the “Share” button (if it is used) is hovered over or clicked on (depending on the selection made by the forum Admin).
    • If “Use minor services in popup widget” is selected by the forum Admin, displayed along with the social network icons is the ‘More’ button where forum users can select additional social networks beyond the Simple:Press ‘standard set’ for sharing groups, forums, topics and posts.
      • The ‘More’ button consists of a grey square button with “…” on it, and when hovered over the “…” changes to the text “More”.
    • The “Theme” of the popup widget is selected by the forum Admin from the “Share This Plugin” forum Admin sub-panel with the “Share This Widget Theme” section.
  • Assorted new pages displayed after clicking the social network buttons used to complete the posting process.

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

Plugin Requirements

Simple:Press 5.6.2 and above is required.

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

As part of the installation, a “Share This” 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 “Share This Plugin” forum Admin panel having sub-panels with sections.

There are no new permissions added to the permission sets due to this plugin that must be enabled.

The plugin has four (4) template tags, ‘sp_ShareThisForumTag()’, ‘sp_ShareThisTopicTag()’, ‘sp_ShareThisTopicIndexTag()’, and ‘sp_ShareThisTag()’ incorporated into standard supplied Simple:Press themes. ‘sp_ShareThisTag()’ can also be used in other WordPress pages or widgets.

  • 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, 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 “share-this“.
  • 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 “share-this.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 Share This 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

Note:
It is recommended that a publisher ID be obtained at sharethis.com/createaccount.With this publisher ID specific to the forum Admin and the site, site specific sharing stats and information are available to the forum Admin from Share This. More information regarding analytics can be seen at Share This Analytics Reporting.Without a publisher ID, the Share This functionality can still be used, but sharing data is not provided. Additionally, the site will be using a generic public key and could run into API limits. Getting a Share This account is simple and free.

If desired, obtain a publisher ID at sharethis.com/createaccount.

After activation, a) on the aforementioned “Available Plugins – Install Simple:Press Plugins” panel, click “Options” on the Share This plugin section or b) under the Components entry on the forum menu on the left side forum admin page click the Share This sub-menu item to get the “Share This Plugin” Admin sub-panels.

    • “Share This Options” Section Set Up

This feature allows setting up the Share This options.

Note:
Options are selected or deselected as follows in this section:

  • The check box is selected if it contains a green check mark.
  • Clicking a check box containing a green check mark deselects the check box and removes the green check mark.
    • Go to the “Share This Plugin” panel and the “Share This Options” section of the Admin panel.
      • Please click on the section’s “Help” link for more information on this section’s feature(s).
    • If there is not already a green check mark in the check box, click on the check box to the left of “Use URL Shortening on shared URLs” to select this option for display.
      • When sharing a URL with the social network, one can choose to use the full URL to the forum/topic/post being shared or one can choose to have the Share This service create a shortened URL.
    • If there is not already a green check mark in the check box, click on the check box to the left of “Use minor services in popup widget” to select this option.
      • If using the Share This popup widget has been selected, users will have access to a whole list of additional social networks that they can share with beyond those listed directly in the “Share This Buttons” admin panel section below.
      • The entire list is available via the ‘More’ link in the popup widget.
      • If use of the minor services or More link available to users is not desired, deselect the minor services option.
    • If there is not already a green check mark in the check box, click on the check box to the left of “Show popup widget on hover” to select this option for display.
      • If the Share This popup widget is being used, by default it will come up when a user hovers over the Share This icon.
      • If it is desired to have the popup appear on a click of the Share This icon, then deselect this show on hover option.
    • If there is not already a green check mark in the check box, click on the check box to the left of “Perform sharing without visiting the social network site” to select this option.
      • When a user shares a forum/topic/post using the Share This plugin, there are two options.
        • Select this option to use the default Share This multi-post widget in which all sharing is done locally in the popup without having to go to the social network site. The user may have to log into the site, but does not have to visit it.
        • Do not select this option to have the widget redirect the user to the social network to perform the sharing.
    • If there is not already a green check mark in the check box, click on the check box to the left of “Show text labels for small icons (if using)” to select this option for display.
      • If the small icons for the social network icons/buttons are being used, one has the option of including a text label or not.
        • By default this option is selected and the text label will be shown.
        • Deselect or do not select this option to not show the text along with the small icon.
    • When all options have been set to the appropriate state, click the “Update” button at the bottom of the panel to save the selections.
    • If there are more selections to make, proceed to that sub-panel.
    • “Share This Buttons” Section Set Up

This feature allows choosing which social network icons/buttons from the Simple:Press ‘standard set’ will be displayed for the forum user sharing. The order of the icons/buttons being displayed can be selected.

Note:
Options are selected or deselected as follows in this section:

  • The check box is selected if it contains a green check mark.
  • Clicking a check box containing a green check mark deselects the check box and removes the green check mark.

The Simple:Press ‘standard set’ consists of:

    • Facebook
    • Facebook Like
    • Twitter
    • Email
    • Share This
    • Google Share
    • Google Plus One
    • LinkedIn
    • Stumble Upon
    • Tumblr
      • Selecting from the ‘Standard Set’
        • Go to the “Share This Plugin” panel and the “Share This Buttons” section of the Admin panel to see the Simple:Press ‘standard set’.
          • Please click on the section’s “Help” link for more information on this section’s feature(s).
        • For each button in the ‘standard set’ either select or deselect it for display on the forum pages as follows:
          • If the “Enable Icon” and its check box is not shown for the button, click on the ‘up arrowhead’ or ‘down arrowhead’ on a button in the list to open it for selection or deselection.
          • To select the button for display, select the check box next to “Enable Icon”.
            • The check box is selected if it contains a green check mark.
            • Clicking a check box containing a green check mark deselects the check box and removes the green check mark.
          • Click the “Close” button or the ‘up arrowhead’ or ‘down arrowhead” to hide the selection check box.
          • When all available buttons have been selected or deselected and/or no other options need to be selected, click on the “Update” button at the very bottom of the last “Share This Plugin” sub-panel containing the “Share This Widget Theme” section to save the selections.
        • After the “Update” button has been clicked and the selections saved, the color of the buttons in the section are as follows:
          • Enabled buttons are filled with the color blue.
          • Disabled buttons are filled with the color red.
        • If there are more selections to make, proceed to that sub-panel.

 

      • Selecting the Button Order Within the ‘Standard Set’

The order of the buttons shown on the forum pages can be changed by “dragging and dropping” them into the desired positions within the list.

        • Go to the “Share This Plugin” panel and the “Share This Button” section of the Admin panel to see the Simple:Press ‘standard set’.
        • Hover the cursor over a button to be moved, left click the mouse and hold it down to select the button.
        • Continuing to hold the left mouse button down, drag the selected button to its new position in the list.
        • Release the left mouse button when the selected button is in the desired position.
        • Repeat the process until all the buttons are in the desired position for displaying on the forum pages.
        • When all the buttons are in the desired position, click on the “Update” button at the very bottom of the last “Share This Plugin” sub-panel containing the “Share This Widget Theme” section to save the selections.
        • If there are more selections to make, proceed to that sub-panel.

 

    • “Share This Icon Style” Section Set Up

In this admin section, the style of buttons and/or links that are displayed to forum users to share Forums/Topics/Posts is selected. Share This offers five (5) styles of buttons/icons. Choose one of the styles. Please note, that if the small icon display is selected, a text label can be optionally displayed with them. The text label option is controlled by a selection in the “Share This Options” section mentioned above.

Note:
Options are selected or deselected as follows in this section:

  • The check box is selected if it contains a green check mark.
  • Clicking a check box not containing a green check mark selects that option, puts a green check mark in that check box, deselects the previously selected check box, and removes the green check mark from the previously selected check box.
      • Go to the “Share This Plugin” panel and the “Share This Icon Style” section of the Admin panel.
        • Please click on the section’s “Help” link for more information on this section’s feature(s).
      • If there is not already a green check mark in the check box, click on the check box to the left of “Icons” to select this option to display regular sized icons.
      • If there is not already a green check mark in the check box, click on the check box to the left of “Small Icons” to select this option to display small icons.
        • If “Small Icons has been selected, text labels can be shown with them by selecting “Show text labels for small icons (if using)” as discussed in the ‘”Share This Options” Section Setup’ section above on this Codex page.
      • If there is not already a green check mark in the check box, click on the check box to the left of “Buttons” to select this option to display buttons.
      • If there is not already a green check mark in the check box, click on the check box to the left of “Horizontal Counts” to select this option to display share counts on the same line as the buttons.
      • If there is not already a green check mark in the check box, click on the check box to the left of “Vertical Counts” to select this option to display share counts above the buttons.
      • Click the “Update” button at the bottom of the sub-panel to save the selection.
      • If there are more selections to make, proceed to that sub-panel.

 

    • “Share This Widget Theme” Section Set Up

In this admin section if the Share This popup widget is being displayed, the appearance of the widget can be set up. Share This offers eight (8) styles of buttons/icons. Choose one of the themes.

Note:
Options are selected or deselected as follows in this section:

  • The check box is selected if it contains a green check mark.
  • Clicking a check box not containing a green check mark selects that option, puts a green check mark in that check box, deselects the previously selected check box, and removes the green check mark from the previously selected check box.
    • Go to the “Share This Plugin” panel and the “Share This Widget Theme” section of the Admin panel.
      • Please click on the section’s “Help” link for more information on this section’s feature(s).
    • If there is not already a green check mark in the check box, click on the check box to the left of “Ice” to select this theme for the widget.
    • If there is not already a green check mark in the check box, click on the check box to the left of “Dust” to select this theme for the widget.
    • If there is not already a green check mark in the check box, click on the check box to the left of “Pine” to select this theme for the widget.
    • If there is not already a green check mark in the check box, click on the check box to the left of “Da’Bears” to select this theme for the widget.
    • If there is not already a green check mark in the check box, click on the check box to the left of “Cosmopolitan” to select this theme for the widget.
    • If there is not already a green check mark in the check box, click on the check box to the left of “L’Orange” to select this theme for the widget.
    • If there is not already a green check mark in the check box, click on the check box to the left of “Silent Movie” to select this theme for the widget.
    • If there is not already a green check mark in the check box, click on the check box to the left of “Default” to select this theme for the widget.
    • Click the “Update” button at the bottom of the sub-panel to save the selection.
    • If there are more selections to make, proceed to that sub-panel.

The Share This service has many, many social networks available. This Simple:Press plugin has selected a few of the most common networks for direct insertion of icons/buttons. If the “Share This” button/icon is being used, all of the other networks will be displayed in the popup widget, under the “More” link.

    • Adding Additional Buttons on the Forum Pages

Buttons not in the Simple:Press ‘standard set’ may be added to those on the forum pages through the use of a simple filter.

Note:
It is strongly recommended that changes not be made to the standard supplied Simple:Press themes. If additional buttons are to be added, it is recommended that a Child or Custom theme is created first to accept the changes prior to installing this plugin.

      • This example uses a Child Theme to add a button/icon to the “Allvoices” social network.
      • If not already done, download the Simple:Press theme Child Framework to contain the button modification, and set it up including providing a unique name as discussed in the Creating a Child Theme page.
      • In the ‘spFunctions.php‘ file of the child theme add something similar to the following and save the file:
add_filter('sph_share_this_chicklets', 'my_share', 10, 6);
function my_share($out, $options, $style, $url, $title, $summary) {
$out.= "<span class='st_allvoices$style' $url $title $summary displayText='Allvoices'></span>";
return $out;
}
    • If multiple buttons are to be added, just use the one filter and add a second $out line like the first with the updated information. Share This has a list of the available services.
    • Activate the uniquely named child theme on the site by clicking its “Activate Theme” button on the “Available Themes – Select Simple:Press Theme” forum Admin panel at Forum > Themes > Available Themes.

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 Share This 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 “Share This” 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 “Share This” 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 and Admins can share a Forum, a Topic, or a Post to a social network by clicking on the button for that social on the forum page.

  • Sharing the Groups, a Forum, a Topic, or a Post
    • Navigate to the group, forum, forum topic, or forum topic post of interest.
    • Click on the button for the social network to receive the share at the appropriate level (group, forum, topic, post) to share it.
    • Depending up the selection made by the forum Admin the user may:
      • Perform sharing without visiting the social network site (done locally on the share widget).
      • Be redirected by the widget to the social network site to perform the sharing.
    • Follow the on-screen protocol to share to the selected social network.

Plugin Special Notes

None

 

Template Tags Used in the Plugin

There are four (4) template tags available for this plugin that allow further customization of the plugin’s usage in themes or otherwise customize the website. ‘sp_ShareThisTag()’, ‘sp_ShareThisForumTag()’, ‘sp_ShareThisTopicTag()’, and ‘sp_ShareThisTopicIndexTag()’ are incorporated into standard supplied Simple:Press themes.

  • If the location of the template tags in the themes as well as the argument and parameter values for the template tags are acceptable, nothing need be done.
  • If any item relating to the template tags is to be modified or if 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 tags 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 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 other Actions and Hooks available for this plugin to modify aspects of the plugin.
In file ‘sp-share-this-components.php‘:

  • apply_filters(‘sph_share_this_script’, $script) – Allows modification of the “Share This” script options before they are output/returned.
  • apply_filters(‘sph_share_this_chicklets’, $out, $options, $style, $url, $title, $summary) – Allows modification to add more social network buttons/icons to the forum pages than are available through the “Share This Buttons” section of the “Share This Plugin” forum Admin panel before the buttons are output/returned.

Plugin and Template Tag Changelog

Since Simple:Press version 5.2.3

Codex page template tags sync’d to code version 5.6.4 and plugin version 1.1.11.



Individual Template Tags


 

sp_ShareThisTag()

Description

sp_ShareThisTag() – This template displays “Share This” buttons. It is intended to be used on any WordPress page or post. It must be used within the loop. It should not be used on any forum page except for Group view or it will share the main forum page.

Usage

sp_ShareThisTag($args=”);

Arguments

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

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.

Special Notes

This template tag is intended to be used on any WordPress page or post.
It will use the permalink of the WP page to share. It must be used within the loop.
Do NOT use this template tag on any forum page except for Group View or it will share the main forum page.

In standard supplied Simple:Press themes this template tag is included in the forum Group View page (‘spGroupView.php’) file.
The exceptions are:

  • the Barebones theme where the template tag is not included in the ‘spGroupView.php’ file, but is included in the ‘spHeadDesktop.php’, ‘spHeadMobile.php’ and ‘spGroupViewMobile.php’ files.
  • the Reboot theme where the template tag is not included in the ‘spGroupView.php’ file, but is included in the ‘spHeadDesktop.php’, and ‘spGroupViewMobile.php’ files.
  • the Barebones-CSS-Mobile theme where the template tag is also in the ‘spHead.php’
  • the Barebones-CSS-Desktop theme where the template tag is only in the header ‘spHead.php’ file.

The function is 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 modified or its location on a page changed, it is suggested a Custom or Child theme be made to accept the modified template tag. Please see discussion at Template Tags Used in the Plugin.

The function requires the use of file ‘sp-share-this-tag.php’ located in the plugin’s Template Tag folder.

Examples

Display the “Share This” buttons in the Group View with “tagClass” of “ShareThisTag spRight”. Call the function conditionally.

if (function_exists('sp_ShareThisTag')) sp_ShareThisTag('tagClass=ShareThisTag spRight');

 

Actions and Hooks Used in the sp_ShareThisTag() Template Tag

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


 

sp_ShareThisForumTag()

Description

sp_ShareThisForumTag() – This template displays “Share This” buttons. It is intended to be used on the Forum View page.

Usage

sp_ShareThisForumTag($args=”);

Arguments

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

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.

Special Notes

This template tag is intended to be used on the Forum View page.

In standard supplied Simple:Press themes this template tag is included in the forum Forum View page (‘spForumView.php’) file.
The exceptions are:

  • the Barebones theme where the template tag is not included in the ‘spForumView.php’ file, but is included in the ‘spHeadDesktop.php’, ‘spHeadMobile.php’ and ‘spForumViewMobile.php’ files.
  • the Reboot theme where the template tag is not included in the ‘spForumView.php’ file, but is included in the ‘spHeadDesktop.php’, and ‘spForumViewMobile.php’ files.
  • the Barebones-CSS-Mobile theme where the template tag is also in the ‘spHead.php’
  • the Barebones-CSS-Desktop theme where the template tag is only in the header ‘spHead.php’ file.

The function is 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 modified or its location on a page changed, it is suggested a Custom or Child theme be made to accept the modified template tag. Please see discussion at Template Tags Used in the Plugin.

The function requires the use of file ‘sp-share-this-forum-tag.php’ located in the plugin’s Template Tag folder.

Examples

Display the “Share This” buttons in the forum with “tagClass” of “spRight ShareThisForum”. Call the function conditionally.

if (function_exists('sp_ShareThisForumTag')) sp_ShareThisForumTag('tagClass=spRight ShareThisForum');

 

Actions and Hooks Used in the sp_ShareThisForumTag() Template Tag

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


 

sp_ShareThisTopicTag()

Description

sp_ShareThisTopicTag() – This template displays “Share This” buttons. It is intended to be used on the Topic View page. Do NOT use this template tag within the topic loop on a post basis.

Usage

sp_ShareThisTopicTag($args=”);

Arguments

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

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.

Special Notes

This template tag is intended to be used on the Topic View page. If the “Share This” buttons are to be used within the topic loop on a per post basis, use the ‘sp_ShareThisTopicIndexTag()’ template NOT this one.

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

  • the Barebones theme where the template tag is not included in the ‘spTopicView.php’ file, but is included in the ‘spHeadDesktop.php’, ‘spHeadMobile.php’ and ‘spTopicViewMobile.php’ files.
  • the Reboot theme where the template tag is not included in the ‘spTopicView.php’ file, but is included in the ‘spHeadDesktop.php’, and ‘spTopicViewMobile.php’ files.
  • the Barebones-CSS-Mobile theme where the template tag is also in the ‘spHead.php’
  • the Barebones-CSS-Desktop theme where the template tag is only in the header ‘spHead.php’ file.

The function is 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 modified or its location on a page changed, it is suggested a Custom or Child theme be made to accept the modified template tag. Please see discussion at Template Tags Used in the Plugin.

The function requires the use of file ‘sp-share-this-topic-tag.php’ located in the plugin’s Template Tag folder.

Examples

Display the “Share This” buttons in topics with “tagClass” of “ShareThisTopic spRight”. Call the function conditionally.

if (function_exists('sp_ShareThisTopicTag')) sp_ShareThisTopicTag('tagClass=ShareThisTopic spRight');

 

Actions and Hooks Used in the sp_ShareThisTopicTag() Template Tag

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


 

sp_ShareThisTopicIndexTag()

Description

sp_ShareThisTopicIndexTag() – This template displays “Share This” buttons. It is intended to be used on the Topic View page within the topic loop on a post basis where $spThisTopic and $spThisPost are set up.

Usage

sp_ShareThisTopicIndexTag($args=”);

Arguments

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

tagId‘: CSS ID for the Div. The %ID% is replaced by the post ID.
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.

Special Notes

This template tag is intended to be used on the Topic View page page within the topic loop on a post basis where $spThisTopic and $spThisPost are set up.

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

  • the Barebones theme where the template tag is not included in the ‘spTopicView.php’ file, but is included in the ‘spTopicViewDesktop.php’, and ‘spTopicViewMobile.php’ files.
  • the Reboot theme where the template tag is not included in the ‘spTopicView.php’ file, but is included in the ‘spTopicViewDesktop.php’, and ‘spTopicViewMobile.php’ files.

The function is 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 modified or its location on a page changed, it is suggested a Custom or Child theme be made to accept the modified template tag. Please see discussion at Template Tags Used in the Plugin.

The function requires the use of file ‘sp-share-this-topic-index-tag.php’ located in the plugin’s Template Tag folder.

Examples

Display the “Share This” buttons in topic posts with “tagClass” of “ShareThisTopicIndex spLeft”. Call the function conditionally.

if (function_exists('sp_ShareThisTopicIndexTag')) sp_ShareThisTopicIndexTag('tagClass=ShareThisTopicIndex spLeft');

 

Actions and Hooks Used in the sp_ShareThisTopicIndexTag() Template Tag

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