Simple:Press Documentation

Plugin: Post Thanks

Plugin Description –

This Simple:Press plugin provides the thanking of posts and a point system that can display users rank based on number of ‘Thanks’ and other setting configured by forum Administrators. The WordPress myCRED point system can be interfaced with this plugin through the Simple:Press myCred Integration plugin.

Special thanks to Chris Smith of http://www.flexsim.com for submitting the preliminary plugin code.

Note:
If this plugin is to interface with the WordPress myCRED point system, both the myCRED for WordPress and the Simple:Press myCred Integration plugins must be installed, activated, and set up.

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

Plugin Overview

Note:
Although several of this plugin’s Template Tags have the word “reputation” in their name, they are solely a part of this plugin and do not interact or relate in any way with the Simple:Press Plugin: Reputation System.
    • Provides a button that is displayed on posts for forum members to thank other forum members for creating the post.
    • Provides a message on the “Thanked” post indicating who thanked the post.
    • Provides a forum Admin panel where message content, point values for activities, and parameters for the “thanked” levels can be assigned.
    • Provides interface to the WordPress myCRED plugin point systems through the Simple:Press MyCred Integration plugin to reward the author of a post that is “thanked”.
    • With modification of a Simple:Press Child or Custom theme’s template files to incorporate “Post Thanks” template tags can display the items listed below on various forum pages:
Note:
The template tags are configurable and can be changed to display special text (Likes, Kudos, etc.) on the buttons and output displays instead of ‘thanks’.
    • a member’s “Post Thanks” statistics (# of thanks given, # of times thanked, # of posts)
    • a member’s total ‘thanked’ point total and/or the “Post Thanks” badge for the ‘thanked’ level they have attained
    • a list of top ‘thanked’ receivers

Plugin Features

Installing this Simple:Press plugin adds:

  • A new “Post Thanks” 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 “post-thanks” containing the plugin’s files.

Activating this plugin provides:

  • A change to the new “Post Thanks” 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 “Thanks/Points Plugin” forum Admin panel where the plugin’s options can be set.
    • The “Getting Started” link associated with the “Deactivate/Uninstall/Options” selections should be selected to view the pertinent information regarding the plugin.
  • A new “Post Thanks” sub-menu entry in the forum Admin menu under “Components” linked to the new “Thanks/Points Plugin” forum Admin panel where the plugin’s options can be set.
    • The new sub-menu item is accessed from the Admin panel at Forum > Components.
  • A new “Thanks/Points Plugin” forum Admin panel where this plugins options are set by the forum Admin.
    • The “Thanks/Points Plugin” forum Admin panel can be accessed from the Forum Admin menu at:
      • Forum > Components > Post Thanks
      • Forum > Plugins > Available Plugins > Post Thanks > Options
  • A new ‘Thanked‘ message indicating the forum user(s) who have “thanked” a post appearing in the bottom of the “thanked” post.

For the users with the permission “Can thank a user for a post

  • A new “Thanks / Thanked” button displayed right above the post’s text in each post other than those of the logged-in user in the Topic View where the logged-in user can thank the post author for the content of the post.
    • A given post can only be thanked once by the logged-in user.
    • Members cannot thank their own posts.
    • The “Thanks” button changes to “Thanked” on a post that has been thanked by the logged-in user.

If the WordPress myCRED and Simple:Press myCred Integration plugins are installed, activated, and set up:

  • If this plugin is the first Simple:Press plugin installed that is support by the myCRED point system, a new “Simple:Press Extension” entry in the “myCRED Hooks” WordPress Admin panel where parameters for the supported Simple:Press plugins can be set up.
    • The “myCRED Hooks” WP Admin panel is access from the WordPress Dashboard Admin menu at myCRED > Hooks.
  • A new entry “MyCred Points for Receiving Post Thanks” in the WordPress myCRED “Simple:Press Extensions” WP Admin page where the forum Admin can set up the myCRED points awarded for a user being thanked as well as the words shown in the myCRED log when the thanks is received.

If “Post Thanks” template tags are added to Simple:Press Child or Custom Theme template files:

  • A list of top ‘Thanks’ receivers with the number of thanks received can be displayed if template tag ‘sp_thanks_stats_top_thanked()’ is added.
  • A member’s “Post Thanks” point level badge and total “Post Thanks” points can be displayed in their posts if template tag ‘sp_thanks_post_user_reputation()’ is added.
  • A member’s statistics (# of thanks given, # of times thanked, # of posts) can be displayed in their posts if template tag ‘sp_thanks_user_stats()’ is added.
  • A member’s “Post Thanks” point total can be displayed in their portion of the member page if template tag ‘sp_thanks_members_list_reputation()’ is added.
  • A member’s “Post Thanks” point total can be displayed in their profile that other members can view if template tag ‘sp_thanks_profile_reputation()’ is added.

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

  • Can thank a user for a post

Plugin Requirements

Simple:Press version 5.6.2 and above is required.

If this plugin is to interface with the myCRED for WordPress and the Simple:Press Plugin: myCred Integration, both of those plugins must be installed, activated, and set up.

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

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

As part of the installation, a “Post Thanks” 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 new “Thanks/Points Plugin” forum Admin panel where the post thanks options are set by the forum Admin.

There is one (1) new permission, “Can thank a user for a post”, added to the permission sets due to this plugin that must be enabled in the permission sets for the usergroups being allowed thank a user for a post.

The plugin has seven (7) template tags with two (2) of them incorporated into standard supplied Simple:Press themes.

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

Plugin Installation and Activation

If this plugin is to interface with the myCRED for WordPress and the Simple:Press Plugin: myCred Integration, both of those plugins must be installed, activated, and set up.

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

Please see Using Plugins 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 “post-thanks“.
  • 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 “post-thanks.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 “Post Thanks” plugin and click on “Activate”. The “Activate/Delete” label changes to “Deactivate/Uninstall/Options” with a “Get Started” Link.

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

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

 

Plugin Administrative Options

After activation, a) on the aforementioned “Available Plugins – Install Simple:Press Plugins” panel, click “Options” on the Post Thanks plugin section or b) under the Components entry on the forum menu on the left side forum admin page click the Post Thanks sub-menu item to get the “Thanks/Points Plugin” Admin panel with its “Thanks Options”, “Points System”, and “Levels for Points System” sections.

    • Thanks Options Section Set Up

In this section the labels to be used before and after the display name of the user being thanked in the message displayed in the thanked users post are set up. This text will be used to display the ‘thanked message’ on posts by the ‘sp_thanks_thanks_for_post()’ template tag included in the standard supplied Simple:Press themes.

    • Go to the “Thanks Options” section of the Admin panel.
      • Please click on the section’s “Help” link for more information on this section’s feature(s).
    • In the text input box to the right of “Thank you message before username:” input the text to be displayed before the thanked user’s display name in the message in the thanked user’s post.
      • The default is, “The following users say thanks to you”.
    • In the text input box to the right of “Thank you message after username:” input the text to be displayed after the thanked user’s display name in the message in the thanked user’s post.
      • The default is, “for this useful post”.
    • If there are no other options in the section or other sections to select, click on the “Update ” button at the bottom of the panel to save the selection.
    • Otherwise, continue making selections.
    • Points System Section Set Up

In this section the points to be awarded for various actions are set up.

    • Go to the “Points System” section of the Admin panel.
      • Please click on the section’s “Help” link for more information on this section’s feature(s).
    • In the input box to the right of “Days/Point:” input the integer for the number of days users must be members of the forum to receive a one (1) point increase in their “Post Thanks” point total.
      • This is used in calculating the “$daypoints” portion of the point total.
      • The default is seven (7).
    • In the input box to the right of “Points for thanking:” input the integer for the number of points users will receive for thanking the post of another user.
      • Users cannot thank their own posts.
      • This is used in calculating the “$thankspoints” portion of the point total.
      • The default is two (2).
    • In the input box to the right of “Points for being thanked:” input the integer for the number of points users will receive for having one of their posts thanked by other users.
      • This is used in calculating the “$thankedpoints” portion of the point total.
      • The default is ten (10).
    • In the input box to the right of “Points/Post:” input the integer for the number of points users will receive for making a post (either new topic post or reply post).
      • This is used in calculating the “$postpoints” portion of the point total.
      • The default is two (2).
    • If there are no other options in the section or other sections to select, click on the “Update ” button at the bottom of the panel to save the selection.
    • Otherwise, continue making selections.
    • Levels for Points System Section Set Up

In this section the characteristics of name and point level associated with the seven (7) “Post Thanks” levels can be set up.

The rank names that can be displayed are separate from any other ranks or levels you may have setup in the Forums. These rank or level names are strictly for this plugin and do not affect any other ranks or membership levels configured or displayed elsewhere by Simple:Press or any other plugins.

Each level has a badge icon that can be displayed by the ‘sp_thanks_post_user_reputation()’ template tag that can be added to a Simple:Press Child or Custom theme. This is a “Post Thank” plugin template tag and is not at all associated with the Simple:Press “Reputation System” plugin.

    • Go to the “Levels for Points System” section of the Admin panel.
      • Please click on the section’s “Help” link for more information on this section’s feature(s).
    • In the input box to the right of “Level 1 name:” input the text for the name of the 1st level of the “Post Thanks” ranking.
      • The default is “Novice”.
    • In the input box to the right of “Level 1 if <? points:” input the integer for the number of points required to reach level 2.
      • A user will be in level 1 until their point total equals or exceeds this number.
      • The default is 400.
    • In the input box to the right of “Level 2 name:” input the text for the name of the 2nd level of the “Post Thanks” ranking.
      • The default is “Beginner”.
    • In the input box to the right of “Level 2 if <? points:” input the integer for the number of points required to reach level 3.
      • A user will be in level 2 until their point total equals or exceeds this number.
      • The default is 1000.
    • In the input box to the right of “Level 3 name:” input the text for the name of the 3rd level of the “Post Thanks” ranking.
      • The default is “Intermediate”.
    • In the input box to the right of “Level 3 if <? points:” input the integer for the number of points required to reach level 4.
      • A user will be in level 3 until their point total equals or exceeds this number.
      • The default is 2000.
    • In the input box to the right of “Level 4 name:” input the text for the name of the 4th level of the “Post Thanks” ranking.
      • The default is “Advanced”.
    • In the input box to the right of “Level 4 if <? points:” input the integer for the number of points required to reach level 5.
      • A user will be in level 4 until their point total equals or exceeds this number.
      • The default is 4000.
    • In the input box to the right of “Level 5 name:” input the text for the name of the 5th level of the “Post Thanks” ranking.
      • The default is “Expert”.
    • In the input box to the right of “Level 5 if <? points:” input the integer for the number of points required to reach level 6.
      • A user will be in level 5 until their point total equals or exceeds this number.
      • The default is 7000.
    • In the input box to the right of “Level 6 name:” input the text for the name of the 6th level of the “Post Thanks” ranking.
      • The default is “Advanced Expert”.
    • In the input box to the right of “Level 6 if <? points:” input the integer for the number of points required to reach level 7.
      • A user will be in level 6 until their point total equals or exceeds this number.
      • The default is 10000.
    • In the input box to the right of “Level 7 name:” input the text for the name of the 7th level of the “Post Thanks” ranking.
      • The default is “The Best”.
    • In the input box to the right of “Level 7 if >? points (must be the same as level 6 value):” input the integer for the number of points required to reach level 7.
      • A user will be in level 7 once their point total equals or exceeds this number.
      • The value must be the same as the level 6 value.
      • The default is 10000.
    • If there are no other options in the section or other sections to select, click on the “Update ” button at the bottom of the panel to save the selection.
    • Otherwise, continue making selections.

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 thank the author of a new topic post or a reply post.

  • Assigning New Permissions
    • “Can thank a user for a post” permission
      • Allowing users to thank posts 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 “General” click the check box next to “Can thank a user for a post” 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.

If the WordPress myCRED plugin and the Simple:Press myCred Integration plugin are installed, activated, and set up and the “Post Thanks” plugin is to interface with the myCRED system, from the WP Dashboard Admin menu on the left of admin pages, select myCRED > Hooks to see the “myCRED Hooks” page from which to select “Simple:Press Extensions” to open that item to enable “Simple:Press Extensions” and set the “Post Thanks” parameters.

  • Enabling “Simple:Press Extensions” and MyCred Points for Receiving Post Thanks Set Up
    • From the WP Dashboard Admin menu, select MyCred > Hooks to see the “myCRED Hooks” page.
    • On the “myCRED Hooks” page click on “Simple:Press Extensions” to expand the section.
      • Enabling “Simple:Press Extension” Plugins’ Contributions

In order for the Simple:Press plugins supported by the WordPress myCRED plugin and the Simple:Press myCred Integration plugin to have their actions counted in the myCRED point system, the installed supported Simple:Press plugin actions must be “enabled”.

      • If not already containing a green check mark, click on the check box to the right of “Enable” to enable the installed SP supported plugins’ actions to be counted in the myCRED system.
        • The check box is enabled if it contains a green check mark.
        • At a later date, clicking on the check box containing a green check mark removes the check mark and disables the installed SP plugins’ contribution.
      • If there are no other selections to be made on the page, click the “Update Changes” button at the bottom of the page.
      • Otherwise, proceed to the next selection.
    • Post Thanks Plugin Contribution Set Up
      • In the input box to the right of “MyCred Points for Receiving Post Thanks:” input the integer number of points forum users are to receive for having one of their posts “Thanked” by another forum user.
        • The default is three (3).
      • In the input box below “Log Template”, input the text to be shown in the WP “myCRED log” when a forum user is thanked.
        • The default is “%plural% for receiving post thanks.
      • If there are no other selections to be made on the page, click the “Update Changes” button at the bottom of the page.
      • Otherwise, proceed to the next selection.

If Post Thanks plugin template tags NOT currently in standard supplied Simple:Press themes are to be incorporated into themes, they should be added to Simple:Press Child or Custom 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 Post Thanks 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 “Post Thanks” 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 “Post Thanks” 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 user’s with the “Can thank a user for a post” permission can “thank” other forum users for their posts.

Note:
Forum users do not have to have the “Can thank a user for a post” to have their posts “thanked’.
  • Thanking a Forum User’s Post
    • Navigate to the forum, topic, and post to be thanked.
    • Click the “Thank” button containing a gold star above the post text area to thank the post.
      • The “Thank” button changes to a red star for the user who “thanked” the post.
        • Not until the “thanking” user leaves the topic and returns to the topic to view the “thanked” post will the button read “Thanked” along with the red star.
      • The “Thanked” message appears in the lower part of the “thanked” post identifying the “thanked” user and the “thanking” user(s).

Forum Admins can view the list of “post thanks” that forum users have received in the “MyCRED point system” on the “MyCred Points Log” WP Admin panel if the WordPress myCRED plugin, the Simple:Press myCred Integration plugin, and this plugin have been set up for those action to be counted.

  • Viewing, Editing, or Deleting the MyCred Points Log Entries for ‘post thank’ Credits
    • From the WordPress Dashboard Admin menu, click on the “myCRED” option.
    • In the “myCRED” sub-menu, click on the “Log” sub-menu entry to view the “MyCred Points Log” Admin panel with the list of the users who have been credited points for various actions.
      • In the list under the “Entry” column, “post thanks” related actions show up as “MyCred Points for receiving post thanks” if the default text is being used.
        • The entry can be edited by clicking on “Edit” in that entry’s row under the “Actions” column.
        • The entry can be deleted by clicking on “Delete” in that entry’s row under the “Actions” column.

Plugin Special Notes

If this plugin is to interface with the myCRED for WordPress and the Simple:Press Plugin: myCred Integration, both of those plugins must be installed, activated, and set up.

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

 

Template Tags Used in the Plugin

There are seven (7) template tags available for this plugin that allow further customization of the plugin’s usage or otherwise customize the website. Two (2) template tags, ‘sp_thanks_thank_the_post()‘ and ‘sp_thanks_thanks_for_post()‘ 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 are to be modified or if the other template tags are to be added to a theme, it is recommended that a Child or Custom theme is created first to accept the changes prior to installing this plugin.
  • In all cases the template 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 Tags can be viewed by selecting their link below.

Action and Hooks Used in the Plugin

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

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

  • do_action(‘sph_post_thanks_actions’, $post_user, $topic_id) – Hook fired after the message listing the forum users that have thanked the current logged-in user have been set up.

Plugin and Template Tag Changelog

Since Simple:Press version 5.1.4

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



Individual Template Tags


 

sp_thanks_thank_the_post()

Description

sp_thanks_thank_the_post() – This template displays the “Thank / Thanked” button.

Usage

sp_thanks_thank_the_post($args=”, $label=”, $thankedLabel=”, $toolTip=”, $thankedToolTip=”);

Arguments

$args – List of arguments for controlling display.
Type:
(string) (optional)
Default:
‘tagId’ => ‘spThanks%ID%’
‘tagClass’ => ‘spButton’
‘formClass’ => ‘spThanks’
‘thankedClass’ => ‘spThanked’
‘iconClass’ => ‘spIcon’
‘iconThanks’ => ‘sp_ThanksIcon.png’
‘iconThanked’ => ‘sp_ThankedIcon.png’

tagId‘: CSS ID for the Div. %ID% is replaced with the post’s ID.
tagClass‘: CSS Class for the Div.
formClass‘: CSS Class for the form.
thankedClass‘: CSS Class for the thanked post.
iconClass‘: CSS Class for the icon.
iconThanks‘: Filename of file containing the icon to display on posts NOT yet thanked by the logged-in user.
iconThanked‘: Filename of file containing the icon to display on posts thanked by the logged-in user.

$label – Text shown as the label of the button of a post that has NOT been thanked by the logged-in user.
Type:
(string) (optional)
Default:
None

$thankedLabel – Text shown as the label of the button of a post that has been thanked by the logged-in user.
Type:
(string) (optional)
Default:
None

$toolTip – Text displayed when the cursor hovers over the button of a post that has NOT been thanked by the logged-in user.
Type:
(string) (optional)
Default:
None

$thankedToolTip – Text displayed when the cursor hovers over the button of a post that has been thanked by the logged-in user.
Type:
(string) (optional)
Default:
None

Special Notes

The button will not be displayed on posts by the logged-in user or on any posts if the logged-in user does NOT have the “Can thank a user for a post” permission.

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

    • the reboot and barebones themes 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-thanks-thanks-the-post.php’ located in the plugin’s “templates” folder.

Examples

In the post header display the “Thank / Thanked” button with “tagClass=spButton spRight”. On posts the logged-in user has NOT thanked, display “Thank” on the button and the message “Add thanks to this post” when the cursor is hovered over the button. On posts the logged-in user has thanked, display “Thanked” on the button and the message “You have already thanked this post” when the cursor is hovered over the button. Call the function conditionally.

if (function_exists('sp_thanks_thank_the_post')) sp_thanks_thank_the_post('tagClass=spButton spRight', __sp('Thank'), __sp('Thanked'), __sp('Add thanks to this post'), __sp('You have already thanked this post'));

 

Actions and Hooks Used in the sp_thanks_thank_the_post() Template Tag

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


 

sp_thanks_thanks_for_post()

Description

sp_thanks_thanks_for_post() – This template displays the message listing the users who have thanked a post.

Usage

sp_thanks_thanks_for_post($args=”);

Arguments

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

tagId‘: CSS ID for the Div. %ID% is replaced by the post ID.
tagClass‘: CSS Class for the Div.

Special Notes

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

    • the reboot and barebones themes 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.

In standard supplied Simple:Press themes the message is displayed at the bottom of the post content in posts that have been thanked.

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_thanks_thanks_for_post.php’ located in the plugin’s “templates” folder.

Examples

Using the defaults in posts that have been thanked, display the thanked message. Call the function conditionally.

if (function_exists('sp_thanks_thanks_for_post();')) sp_thanks_thanks_for_post();

 

Actions and Hooks Used in the sp_thanks_thanks_for_post() Template Tag

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


 

sp_thanks_user_stats()

Description

sp_thanks_user_stats() – This template can display the number of thanks given and received, the number of posts a post author has made, along with surrounding text.

Usage

sp_thanks_user_stats($args, $userid=”, $label=”);

Arguments

$args – List of arguments for controlling display.
Type:
(string) (optional)
Default:
‘tagClass’ => ‘spThanksUserStats’
‘usespan’ => 0

tagClass‘: CSS Class for the Div.
usespan‘: Flag to indicate whether to show the post thank information in a ‘span’ or in a ‘div’. A one (1) is true and the information is enclosed in a span. A zero (0) is false and a div is used.

$userid – The ID of the user whose “post thanks” information is to be displayed.
Type:
(string) (optional)
Default:
None

$label – Complete text shown on the display.
Type:
(string) (optional)
The string can show how many times a user’s posts has been thanked, how many thanks he has given, and in how many posts. There are three variable labels available for use in any combination:

%THANKS% – Will display the number of thanks a user has given out.
%THANKED% – Will display the number of thanks a user has received.
%POSTS% – Will display their total number of posts made.

These variables are passed to the function along with any surrounding text. Please see the examples.

Default:
None

Special Notes

This template tag is NOT included in the standard supplied Simple:Press themes.

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

If it is to be used, it is intended to be used in the Topic View (‘spTopicView.php’) file.
The exceptions are:

    • the reboot and barebones child themes where the template tag should not be added in the ‘spTopicView.php’ file, but should be added in the ‘spTopicViewDesktop.php’ and ‘spTopicViewMobile.php’ files.

 

The call can be placed to display anywhere within each topic’s user or poster’s information. If using a Child Theme based on the Simple:Press “Default” theme, a good place to put is is under a member’s information such as ‘Member Since” display (in ‘column 1 of the post row’ in the ‘post section’ in the ‘post loop’).

The function 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 function requires the use of file ‘sp-thanks-user-stats.php’ located in the plugin’s “templates” folder.

Examples

1. Using a Child Theme based on the standard supplied “Default” theme, display in the Topic View the post author’s statistics in the form of “Thanked ‘x’ times in ‘y’ posts” where ‘x’ is the number of times the post author has been “thanked” and ‘y’ is the number of posts the post author has made. Call the function conditionally.

a. If not already done, download the Simple:Press Default Child Theme Framework to contain the template tag modification, and set it up including providing a unique name as discussed in the Creating a Child Theme page.
b. If not already in existence, add a “templates” folder in the child theme folder to contain the file to be modified.
c. If not already done, copy the ‘spTopicView.php’ file from the Simple:Press Default Theme and place it in the Child Theme’s ‘template’ folder.
d. Modify the ‘spTopicView.php’ file header to identify it as part of the Child Theme, add the change listed below in the ‘post loop’ in the ‘post section’ in ‘column 1 of the post row’ under the ‘sp_PostIndexUserRegistered() call, and save the file.

if (function_exists('sp_thanks_user_stats')) sp_thanks_user_stats('tagclass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'Thanked %THANKED% times in %POSTS% posts');

When complete, the file’s modified section might look something like:

sp_PostIndexUserRegistered('tagClass=spPostUserRegistered spCenter', __sp('Member Since:
 %DATE%'));
if (function_exists('sp_thanks_user_stats')) sp_thanks_user_stats('tagclass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'Thanked %THANKED% times in %POSTS% posts');
sp_PostIndexUserStatus('tagClass=spCenter spPostUserStatus', __sp('Online'), __sp('Offline'));

e. 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 accessed from the forum Admin menu at Forum > Themes > Available Themes.

2. Using the above steps display, “Has given ‘x’ thanks and has received ‘y’ thanks”.

sp_thanks_user_stats('tagClass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'Has given %THANKS% thanks <br />and has received %THANKED% thanks');

3. Using the above steps display, “Has given ‘x’ thanks and has received ‘y’ thanks and has posted ‘z’ times”.

sp_thanks_user_stats('tagClass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'Has given %THANKS% thanks <br />and has received %THANKED% thanks and has posted %POSTS% times');

4. Using the above steps display,  “In ‘x’ Posts I have been thanked ‘y’ times”.

sp_thanks_user_stats('tagClass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'In %POSTS% I have been thanked %THANKED% times');

 

Actions and Hooks Used in the sp_thanks_user_stats() Template Tag

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


 

sp_thanks_post_user_reputation()

Description

sp_thanks_post_user_reputation() – This template can display a post author’s “Post Thanks” badge and their “Post Thanks” total points.

The total points are based on the number of “thanks” a user has received, the number of posts the user has “thanked”, the number of posts the user has made, and the length of time the user has been registered in the forum. The point values for each of these contributors is set up by the forum Admin on the “Points System” section of the “Thanks/Points Plugin” forum Admin panel.

The badge displayed will have from one (1) to seven (7) gold stars depending on the forum user’s level determined by the user’s total points.

Usage

sp_thanks_post_user_reputation($args=”, $label=”);

Arguments

Type:
(string) (optional)
Default:
‘tagClass’ => ‘spPostUserThanksReputation’
‘badge’ => 1
‘title’ => 1

tagClass‘: CSS Class for the Div.
badge‘: Flag to indicate whether or not to display the post author’s “Post Thanks” badge. A one (1) is true and the badge is displayed. A zero (0) is false and the badge is not displayed.
title‘: Flag to indicate whether or not to display the post author’s “Post Thanks” level’s title. A one (1) is true and the title is displayed. A zero (0) is false and the title is not displayed.

$label – Text shown before the user’s “Post Thanks” point value is displayed.
Type:
(string) (optional)
Default:
None

Special Notes

This template tag is NOT included in the standard supplied Simple:Press themes.

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

If it is to be used, it is intended to be used in the Topic View (‘spTopicView.php’) file.
The exceptions are:

    • the reboot and barebones child themes where the template tag should not be added in the ‘spTopicView.php’ file, but should be added in the ‘spTopicViewDesktop.php’ and ‘spTopicViewMobile.php’ files.

 

The call can be placed to display anywhere within each post’s user or poster’s information. If using a Child Theme based on the Simple:Press “Default” theme a good place to put is is under a member’s information such as ‘Member Since” display (in ‘column 1 of the post row’ in the ‘post section’ in the ‘post loop’).

The function 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 function requires the use of file ‘sp-thanks-post-user-reputation.php’ located in the plugin’s “templates” folder.

Examples

Using a Child Theme based on the standard supplied “Default” theme, display in the Topic View the post author’s “Post Thanks” point total and “Post Thanks” badge with “label” of “Thanks Points”. Call the function conditionally.

a. If not already done, download the Simple:Press Default Child Theme Framework to contain the template tag modification, and set it up including providing a unique name as discussed in the Creating a Child Theme page.
b. If not already in existence, add a “templates” folder in the child theme folder to contain the file to be modified.
c. If not already done, copy the ‘spTopicView.php’ file from the Simple:Press Default Theme and place it in the Child Theme’s ‘template’ folder.
d. Modify the ‘spTopicView.php’ file header to identify it as part of the Child Theme, add the change listed below in the ‘post loop’ in the ‘post section’ in ‘column 1 of the post row’ under the ‘sp_PostIndexUserRegistered() call, and save the file.

If (function_exists('sp_thanks_post_user_reputation')) sp_thanks_post_user_reputation('tagClass=spCenter spPostUserThanksReputation', 'Thanks Points:');

When complete, the file’s modified section might look something like:

sp_PostIndexUserRegistered('tagClass=spPostUserRegistered spCenter', __sp('Member Since:
 %DATE%'));
...
If (function_exists('sp_thanks_post_user_reputation')) sp_thanks_post_user_reputation('tagClass=spCenter spPostUserThanksReputation', 'Thanks Points:');
sp_PostIndexUserStatus('tagClass=spCenter spPostUserStatus', __sp('Online'), __sp('Offline'));

e. 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 accessed from the forum Admin menu at Forum > Themes > Available Themes.

 

Actions and Hooks Used in the sp_thanks_post_user_reputation() Template Tag

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


 

sp_thanks_profile_reputation()

Description

sp_thanks_profile_reputation() – This template displays a member’s “Post Thanks” point total along with an optional text label. It is intended to be used on the forum user’s profile pages that can be viewed by other forum users.

Usage

sp_thanks_profile_reputation($args=”, $label=”);

Arguments

Type:
(string) (optional)
Default:
‘tagClass’ => ‘spProfileShowDisplayName’
‘leftClass’ => ‘spColumnSection spProfileLeftCol’
‘middleClass’ => ‘spColumnSection spProfileSpacerCol’
‘rightClass’ => ‘spColumnSection spProfileRightCol’

tagClass‘: CSS Class for the Div.
leftClass‘: CSS Class for the left column.
middleClass‘: CSS Class for the middle column.
rightClass‘: CSS Class for the left column.

$label – Text shown before the user’s “Post Thanks” total point value is displayed.
Type:
(string) (optional)
Default:
None

Special Notes

This template tag is NOT included in the standard supplied Simple:Press themes.

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

If it is to be used, it is intended to be used on the forum user’s profile pages that can be viewed by other forum users (‘spProfilePopupShow.php’) and/ or (‘spProfileShow.php’) file. If using a Child Theme based on the Simple:Press “Default” theme, a good place to put is is under a member’s profile information such as “Search User Posts:” display in the “user stat” section.

The function 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 function requires the use of file ‘sp-thanks-profile-reputation.php’ located in the plugin’s “templates” folder.

Examples

Using a Child Theme based on the standard supplied “Default” theme, display in the user’s profile pages that can be viewed by other forum users the user’s “Post Thanks” point total with “tagClass” of “spProfileShowDisplayName” and “label” of “Post Thanks Points:”. Call the function conditionally.

a. If not already done, download the Simple:Press Default Child Theme Framework to contain the template tag modification, and set it up including providing a unique name as discussed in the Creating a Child Theme page.
b. If not already in existence, add a “templates” folder in the child theme folder to contain the file to be modified.
c. If not already done, copy the ‘spProfilePopupShow.php’ file from the Simple:Press Default Theme and place it in the Child Theme’s ‘template’ folder.
d. Modify the ‘spProfilePopupShow.php’ file header to identify it as part of the Child Theme, add the change listed below in the ‘user stats’ area under the ‘sp_ProfileShowSearchPosts() call, and save the file.

If (function_exists('sp_thanks_profile_reputation')) sp_thanks_profile_reputation('tagClass=spProfileShowDisplayName', 'Post Thanks Points');

When complete, the file’s modified section might look something like:

sp_ProfileShowSearchPosts('', __sp('Search User Posts'), __sp('Topics Started'), __sp('Topics Posted In'));
If (function_exists('sp_thanks_profile_reputation')) sp_thanks_profile_reputation('tagClass=spProfileShowDisplayName', 'Post Thanks Points');

e. If not already done, copy the ‘spProfileShow.php’ file from the Simple:Press Default Theme and place it in the Child Theme’s ‘template’ folder.
f. Modify the ‘spProfileShow.php’ file header to identify it as part of the Child Theme, add the change listed below in the ‘user stats’ area under the ‘sp_ProfileShowSearchPosts() call, and save the file.

If (function_exists('sp_thanks_profile_reputation')) sp_thanks_profile_reputation('tagClass=spProfileShowDisplayName', 'Post Thanks Points');

When complete, the file’s modified section might look something like:

sp_ProfileShowSearchPosts('', __sp('Search User Posts'), __sp('Topics Started'), __sp('Topics Posted In'));
If (function_exists('sp_thanks_profile_reputation')) sp_thanks_profile_reputation('tagClass=spProfileShowDisplayName', 'Post Thanks Points');

g. 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 accessed from the forum Admin menu at Forum > Themes > Available Themes.

 

Actions and Hooks Used in the sp_thanks_profile_reputation() Template Tag

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


 

sp_thanks_members_list_reputation()

Description

sp_thanks_members_list_reputation() – This template displays the forum user’s “Post Thanks” point total along with an optional text label. It is intended for use on the forum “Member List” page.

Usage

sp_thanks_members_list_reputation($args=”, $label=”);

Arguments

Type:
(string) (optional)
Default:
‘tagID’ => ‘spMembersListThanksRank%ID%’
‘tagClass’ => ‘spInRowCount’
‘labelClass’ => ‘spInRowLabel’
‘numberClass’ => ‘spInRowNumber’
‘stack’ => 1

tagID‘: CSS ID for the Div. %ID% is replaced by the member’s user ID.
tagClass‘: CSS Class for the Div.
labelClass‘: CSS Class for the label.
numberClass‘: CSS Class for the number.
stack‘: Flag to indicate whether or not to stack the elements being shown (label, and/or “Post Thanks” point value) under each other. A one (1) will display the elements to be shown under one another. A zero (0) will display the elements to be shown next to one another to the extent the width of the display area allows before wrapping to the next line.

$label – Text shown before the user’s “Post Thanks” point value is displayed.
Type:
(string) (optional)
Default:
None

Special Notes

This template tag is NOT included in the standard supplied Simple:Press themes.

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

If it is to be used, it is intended to be used in the Members View (‘spMembersView.php’) file.

The call can be placed to display anywhere within the forum user’s information. If using a Child Theme based on the Simple:Press “Default” theme, a good place to put is is under a member’s information such as ‘Member Name” display (in ‘column 1 of the member row’ in the ‘Member’ section in the ‘Member Loop’ of the ‘MemberGroup’ section).

The function 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 function requires the use of file ‘sp-thanks-members-list-reputation.php’ located in the plugin’s “templates” folder.

Examples

Using a Child Theme based on the standard supplied “Default” theme, display on the “Members List” page the forum user’s “Post Thanks” point total with “label” of “Thanks Points”. Call the function conditionally.

a. If not already done, download the Simple:Press Default Child Theme Framework to contain the template tag modification, and set it up including providing a unique name as discussed in the Creating a Child Theme page.
b. If not already in existence, add a “templates” folder in the child theme folder to contain the file to be modified.
c. If not already done, copy the ‘spMembersView.php’ file from the Simple:Press Default Theme and place it in the Child Theme’s ‘template’ folder.
d. Modify the ‘spMembersView.php’ file header to identify it as part of the Child Theme, add the change listed below in the ‘member loop’ in the ‘member section’ in ‘column 1 of the member row’ under the ‘sp_MembersListName() call, and save the file.

if (function_exists('sp_thanks_members_list_reputation')) sp_thanks_members_list_reputation('tagClass=spInRowCount', __sp('Thanks Points:'));

When complete, the file’s modified section might look something like:

sp_MembersListName('tagClass=spRowName');
...
if (function_exists('sp_thanks_members_list_reputation')) sp_thanks_members_list_reputation('tagClass=spInRowCount', __sp('Thanks Points:'));

e. 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 accessed from the forum Admin menu at Forum > Themes > Available Themes.

 

Actions and Hooks Used in the sp_thanks_members_list_reputation() Template Tag

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


 

sp_thanks_stats_top_thanked()

Description

sp_thanks_stats_top_thanked() – This template displays the list of top “thanked” forum members based on their “Post Thanks” point totals along with an optional link to their profile.

Usage

sp_thanks_stats_top_thanked($args=”, $label=”);

Arguments

Type:
(string) (optional)
Default:
‘pTitleClass’ => ‘spTopPosterStatsTitle’
‘pPosterClass’ => ‘spPosterStats’
‘limit’ => 5
‘link_names’ => 1

pTitleClass‘: CSS Class for the title.
pPosterClass‘: CSS Class for the posters.
limit‘: The maximum number of “Top Thanked” forum members to display.
link_names‘: Flag to indicate whether or not to provide a link from the “Top Thanked’ user’s names to their profile. A one (1) is true and a link from the “Top Thanked’ user’s names to their profiles is provided. A zero (0) is false and no links are provided.

$label – Text shown before the “Top Thanked” forum member list is displayed.
Type:
(string) (optional)
Default:
None

Special Notes

This template tag is NOT included in the standard supplied Simple:Press themes.

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

If it is to be used, it might be used in the footer (‘spFoot.php’) file.
The exceptions are:

    • the reboot and barebones child themes where the template tag should not be added in the ‘spFoot.php’ file, but should be added in the ‘spFootDesktop.php’ and ‘spFootMobile.php’ files.

 

The function 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 function requires the use of file ‘sp-thanks-stats-top-thanked.php’ located in the plugin’s “templates” folder.

Examples

1). Using a Child Theme based on the standard supplied “Default” theme, display in the footer’s ‘stats’ section in the ‘sp_NewMembers()’ call the list of “Top Thanked” forum users using the defaults to show five (5) top thanked forum members with “label” of “Top Thanked Members”. Call the function conditionally. Separate the call from the previous call with a ‘sp_InsertBreak() call.

a. If not already done, download the Simple:Press Default Child Theme Framework to contain the template tag modification, and set it up including providing a unique name as discussed in the Creating a Child Theme page.
b. If not already in existence, add a “templates” folder in the child theme folder to contain the file to be modified.
c. If not already done, copy the ‘spFoot.php’ file from the Simple:Press Default Theme and place it in the Child Theme’s ‘template’ folder.
d. Modify the ‘spFoot.php’ file header to identify it as part of the Child Theme, add the change listed below in the ‘stats section’ under the ‘sp_NewMembers() call, and save the file.

sp_InsertBreak();	
if (function_exists('sp_thanks_stats_top_thanked')) sp_thanks_stats_top_thanked('', 'Top Thanked Members:');

When complete, the file’s modified section might look something like:

sp_NewMembers('tagClass=spLeft spNewMembers', __sp('Newest Members: '));
sp_InsertBreak();	
if (function_exists('sp_thanks_stats_top_thanked')) sp_thanks_stats_top_thanked('', 'Top Thanked Members:');

e. 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 accessed from the forum Admin menu at Forum > Themes > Available Themes.

2). Using the above steps change the number of top members listed from the default 5 to 10.

sp_thanks_stats_top_thanked('limit=10', 'Top Thanked Members:');

3). Using the above steps change the number of top members listed from the default 5 to 10, do not include a link on the member’s name to the member’s profile, and display “label” of “Top Thanked”.

sp_thanks_stats_top_thanked('limit=10&link_names=0', 'Top Thanked:');

 

Actions and Hooks Used in the sp_thanks_stats_top_thanked() Template Tag

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