Simple:Press Documentation

Plugin: Reputation System

Plugin Description

Plugin: Reputation – This Simple:Press plugin allows a forum user to rate other users in the forum using a portion of the “reputation” rating the user has earned in the forum.

Plugin Features

Installing this Simple:Press plugin adds:

  • A new “Reputations System” section in the “Available Plugins – Install Simple:Press Plugins” panel under the forum Admin menu path Forum > Plugins > Available Plugins. From this panel the Simple:Press plugin can be activated or deleted by the admin.
  • When properly installed, a new folder in the forum plugin folder named “reputation” containing this plugin’s files.

Activating this plugin provides:

  • A change to the new “Reputation System” section in the “Available Plugins – Install Simple:Press Plugins” panel under the Admin menu path Forum > Plugins > Available Plugins so the plugin can be deactivated, uninstalled, or have its Options set up.
    • The Options link goes to the new “Reputation System – Options” forum Admin panel where the plugin’s administrative options are set up.
    • The “Getting Started” link associated with the “Deactivate/Uninstall/Options” selections should be selected to view the pertinent information regarding the plugin.
  • A new entry in the main Forum Admin Accordion Menu path Forum > “Reputation System” with sub-menu entries “Options”, “Levels”, and “Reset”.
    • The “Options” entry links to the new “Reputation System – Options” forum Admin panel where its options are set up.
    • The “Levels” entry links to the new “Reputation – Levels” forum Admin panel where the parameters for each level are assigned.
    • The “Reset” entry links to the new “Reputation System – Reset” forum Admin panel where the forum Admin can reset/initialize all the users (except the Admin) in the reputation system to the same reputation point value or initialize an individual forum user to a specific point value. The reputation system can have some of its parameter reset to their default values on this panel.
  • A new “Reputation System – Options” forum Admin panel with sections where its options are set up.
    • The “Reputation Options” section where the amount of “reputation” a user can gain for various forum activities are specified.
    • The “Highlight Options” section where the color for highlighting the background of the text in posts of high reputation forum users as well as the level of reputation the user must have to have their posts so highlighted are specified.
    • The “Lowlight Options” section where the color for highlighting the background of the text in posts of low reputation forum users as well as the level of reputation the user must have to have their posts so highlighted are specified.
    • The “Reputation Strings” section where a number of “Reputation System” text strings can be edited or changed. This allows localizing (translating into another language) right on this panel rather than doing so in a translation file.
    • The “Help” links should be used for assistance in setting up the options.
  • A new “Reputation System – Levels” forum Admin panel where its levels are defined.
    • The “Reputation Levels” section where the forum Admin assigns a name to each level, the maximum reputation points for each level, the maximum reputation points that can be given or taken away from another forum user at one time, the maximum daily reputation points a user can give or can take away, and the “badge” icon assigned to the level.
    • Note: The limits do not apply to the admin for giving and taking reputation.
    • The “Help” link should be used for assistance in setting up the levels.
  • A new “Reputation System – Reset” forum Admin panel with sections where the reset/initialization values for users are set.
    • The “Reputation Reset” section where the forum Admin can reset ALL forum users reputation to the value specified.
    • The “Options Reset” section where the forum Admin can reset all options/levels to the default values.
    • The “User Reputation Reset” section where the forum Admin can reset the reputation of a specific forum user to a specific value.
    • The “Help” links should be used for assistance in setting up the levels.
  • A new “Forum-Reputation” folder containing the default reputation badges.
    • Any new reputation badges uploaded from the “Reputation – Levels” panel are stored in this folder.
    • The default location for the folder is “…/wp-content/sp-resources/forum-reputation”.

After downloading the latest versions of Simple:Press themes which contain the “Reputation System” template tags from Our Theme Library page:

  • In Members View where forum user information is displayed by clicking the “Members” button:
    • For each user in the logged in user’s usergroup, that user’s current “Reputation” level (0 – 10 if the default names are used) is shown. The number of “red” bars indicates the user’s level. For example, 5 red bars out of the 10 indicates the user has a level 5 reputation.
      • Similarly the reputation for the members of the forum Admin usergroup (always set to maximum) and the Moderator usergroup can be viewed.
    • Hovering the cursor over the reputation level bars for a user provides a tooltip popup giving that user’s reputation level (0 – 10 if the default names are used) and the exact value of that user’s reputation.
      • For example, if the maximum values for level 3 and level 4 has been set by the admin at 750 and 1000, respectively, hovering the cursor over the “reputation bars” of a user with a reputation value of 755 points will display “Level 4 (755).
      • Hovering over an Admin’s “reputation bars” will only show the maximum level name not a point value.
    • One can look at the reputation value of a user before one gives or takes reputation to/from that user, then after giving/taking reputation to/from that user, one can look at the user’s reputation value to verify the correct reputation changes occurred.
  • In the Profile Views (both popup and full profile view) where other user’s can view the profile information about a user after selecting that user’s profile in the Members View:
    • The reputation badge of the selected user is shown in the user’s profile popup window.
      • Hovering the cursor over the reputation level bars for a user provides a tooltip popup giving that user’s reputation level (0 – 10 if the default names are used) and the exact value of that user’s reputation.
    • The reputation badge of the selected user is also shown in the user’s full profile displayed by clicking the “View Full Profile for ‘member name'” at the bottom of the profile popup window.
      • Hovering the cursor over the reputation level bars for a user provides a tooltip popup giving that user’s reputation level (0 – 10 if the default names are used) and the exact value of that user’s reputation.
    • In Topic View which displays the posts within a topic:
      • Somewhere near the top of the first column of a post, the post’s author’s reputation level bars can be seen.
        • Hovering the cursor over the reputation level bars for a user provides a tooltip popup giving that user’s reputation level (0 – 10 if the default names are used) and the exact value of that user’s reputation.
          • For example, if the maximum values for level 3 and level 4 has been set by the admin at 750 and 1000, respectively, hovering the cursor over the “reputation bars” of a user with a reputation value of 755 points will display “Level 4 (755).
      • Logged-in users with the permission “Can use reputation to rate other users” viewing a post whose author has the permission “Can get reputation from other users”, will see the “reputation icon” (looks like a laurel wreath) somewhere near the bottom of the first column of the post.
Note:
If either the post viewer (logged-in user) or the post author do NOT have the proper permissions, the “reputation icon” will not be displayed.
      • Hovering the cursor over the “reputation icon” in a post provides a tooltip popup with the text “Give/Take Reputation”.
      • Clicking on the “reputation icon” displays the “Give/Take Reputation” popup where “reputation points” are given or taken.
        • The actual amount of reputation to be given or taken from the author of the post is input by the logged-in user.
        • The maximum reputation points the logged-in user can give or take away from the post author is displayed for the logged-in user’s convenience.
      • Once a user has given/taken reputation to/from another user via the reputation icon on a given post of the other user, the user cannot give/take further reputation via that post. In fact, the “reputation” icon is no longer displayed to the user on that other user’s post.

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

  • “Can use reputation to rate other users”
  • “Can get reputation from other users”

Plugin Requirements

Simple:Press version 5.5.11 or above is required.

The Simple:Press plugin must be installed, activated, and its options set before it is operational.

  • As part of the installation, a “Reputation System” section is added to the “Available Plugins – Install Simple:Press Plugins” 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 “Reputation System – Options” forum Admin panel where its options must be set up.

There are two (2) new permissions added to the permission sets due to this plugin that must be set up.

  • “Can use reputation to rate other users”
  • “Can get reputation from other users”

The plugin has five (5) template tags with four (4) of them, ‘sp_PostIndexUserReputationLevel()’, ‘sp_PostIndexRepUser()’, ‘sp_MembersListReputationLevel()’, and ‘sp_UserReputationLevel()’, incorporated into standard supplied Simple:Press themes. Template tag ‘sp_MostReputable()’ is not incorporated.

  • 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 tag is 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.

The Simple:Press theme(s) to be used must be a version(s) that support the “Reputation System” plugin with reputation template tags incorporated.

Plugin Installation and Activation

Please see Using Plugins for 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 “reputation“.
  • 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 “reputation.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 “Reputation System” 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”.

Plugin Administrative Options

After activation, a) on the aforementioned “Available Plugins – Install Simple:Press Plugins” panel, click “Options” on the “Reputation System” plugin section or b) from the main Dashboard Admin menu, click Forum > Reputation System to see the “Reputation Systems – Options” panel.

    • “Reputation Options” Section
        In this section configure the basic options of the reputation system.

      • Click on the section’s Help link and follow the Help instructions.
      • If there are no other options to select on the panel, click on the “Update ” button at the bottom of the page to save the settings. Otherwise, proceed to the next option(s) to select.
    • “Highlight Options” Section
        In this section specifics regarding adding reputation highlight colors to the text background in posts of high reputation users are set up, if desired. The RGB (Red, Green, Blue) color hue mixing system is used to define the background color. The default value F8F3EE is a light brownish gray background.

      • Click on the section’s Help link and follow the Help instructions.
      • If there are no other options to select on the panel, click on the “Update ” button at the bottom of the page to save the settings. Otherwise, proceed to the next option(s) to select.
    • “Lowlight Options” Section
        In this section specifics regarding adding reputation lowlight colors to the text background in posts of low reputation users are set up, if desired. The RGB (Red, Green, Blue) color hue mixing system is used to define the background color. The default value CCCCCC is a medium gray background.

      • Click on the section’s Help link and follow the Help instructions.
      • If there are no other options to select on the panel, click on the “Update ” button at the bottom of the page to save the settings. Otherwise, proceed to the next option(s) to select.
    • “Reputation Strings” Section
        In this section the content of some text strings used in the Reputation System plugin can be edited or changed, if desired.
Note:
If it is desired to localize these text strings (translate into another language not American – English), the localization should be done here rather than in a translation file.
    • Click on the section’s Help link and follow the Help instructions.
    • If there are no other options to select on the panel, click on the “Update ” button at the bottom of the page to save the settings. Otherwise, proceed to the next option(s) to select.

From the main Dashboard Admin menu, click Forum > Reputation System > Levels sub-menu entry to see the “Reputation – Levels“, and “Reputation – Badges” panels.

Note:
The reputation plugin results in a new “Forum-Reputation” folder containing the default reputation badges.

  • Any new reputation badges uploaded from the “Reputation – Badges” panel are stored in this folder.
  • The default location for the folder is “…/wp-content/sp-resources/forum-reputation”.
    • “Reputation Levels” Panel
        In the section of this panel configure the specifics of the Reputation Levels users may obtain, including level name, Max points for the level, Max Give/Take a user of that level may give/take from another user, the Max Daily reputation points a user of that level may give/take from other users, and the filename of a badge for that level.

      • Click on the section’s Help link and follow the Help instructions.
      • New levels can added/defined using the fields at the bottom of the panel.
        • To select the badge for the new level, click on the down arrowhead to the right of “Select Badge” to display the drop down menu of available badges in the “Forum-Reputation” folder discussed in the above “Note”.
      • When all the desired elements have been changed in the section, click on the “Update Reputation Levels” button at the bottom of the page to save the settings.
    • “Reputation – Badges” Panel
      • “Reputation badges upload” Section

In this section images to be used as badges for the reputation levels can be uploaded. Any uploaded badge will be placed in the “Forum-Reputation” folder discussed in the above “Note”.

        • Click on the section’s Help link and follow the Help instructions.
        • Click on the section’s Browse button to find the desired image file for putting into the “Forum-Reputation” folder.
      • “Reputation Badges” Section

In this section the current badge images and their filenames available in the “Forum-Reputation” folder for assigning to reputation levels.

      • Click on the section’s Help link and follow the Help instructions.

From the main Dashboard Admin menu, click Forum > Reputation System > Reset sub-menu entry to see the “Reputation System – Reset” panels.

    • “Reputation Reset” Section
        In the section of this panel All user reputation levels and user ratings can be reset to a starting value.
WARNING: This action resets the reputation system and cannot be undone!
This action can give reputation to users even if they do not have the “Can get reputation from other users” permission.
      • Click on the section’s Help link and follow the Help instructions.
      • When all the desired elements have been changed in the section, click on the “Reset Reputation System” button at the bottom of the page to save the settings. Otherwise continue configuring the resets.
      • “Options Reset” Section

In this section all the options and levels can be reset to the default values.

WARNING: This action affects the reputation system and cannot be undone!
        • Click on the section’s Help link and follow the Help instructions.
        • When all the desired elements have been changed in the section, click on the “Reset Reputation System” button at the bottom of the page to save the settings. Otherwise continue configuring the resets.
      • “User Reputation Reset” Section

In this section a user’s reputation can be reset to a given value.

WARNING: This action affects the reputation of a specific user and cannot be undone!
This action can give reputation to users even if they do not have the “Can get reputation from other users” permission.
      • Click on the section’s Help link and follow the Help instructions.
      • When user’s name and the reputation point value have been specified in the section, click on the “Set User Reputation” button at the bottom of the page to save the settings.

From the Forum Admin menu on the left of admin pages, select Forum > Permissions > Manage Permission Sets to see the permission sets available.

  • Assigning New Permissions
    • “Can use reputation to rate other users” permission
    • Allowing users to rate other users (give or take reputation) is controlled by their group permissions.
    • Each usergroup that is to have the ability rate other users 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 “Viewing” click the check box next to “Can use reputation to rate other users” to set/enable the permission. When enabled, the check box contains a green check mark.
    • Click “Update Permission” 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.
    • “Can get reputation from other users” permission
    • Allowing users to be rated (get/lose reputation) by other users is controlled by their group permissions.
    • Each usergroup that is to have the ability rate other users 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 “Viewing” click the check box next to “Can get reputation from other users” to set/enable the permission. When enabled, the check box contains a green check mark.
    • Click “Update Permission” 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.

To be complete for multilingual forums, the language translation files for this plugin, “Private Post” 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 Reputation 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 “Reputation” 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 “Reputation” 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 use the plugin to set up its options, levels, and resets, as needed.

Forum Admins and users with proper permission can rate (give or take reputation) other users who have proper permission to receive the rating (get or lose reputation).

    • Giving or Taking Reputation Points
Note:
If either the post viewer (logged-in user) or the post author do NOT have the proper permissions, the “reputation icon” will not be displayed.
  • In Topic View where posts in a topic are shown in detail, look for the “reputation icon” (looks like a laurel wreath) in the first column of a post for the user whose reputation is to be increased or decreased.
    • When hovering the cursor over the “reputation icon” the popup text “Give/Take Reputation” is displayed.
  • Click on the “reputation icon” to display the “Give/Take Reputation” popup.
  • Under “Adjust Reputation of this User:”
    • Select the check box to the left of “Give Reputation” to increase the post author’s reputation points.
      • The check box is selected if it contains a green check mark.
    • Select the check box to the left of “Take Reputation” to decrease the post author’s reputation points.
      • The check box is selected if it contains a green check mark.
    • In the data input box to the right of “Amount:”, input the number of reputation points to be given/taken from the post’s author.
      • To the right of the data input box is the “Maximum” number of reputation points the logged-in user can give/take from the post’s author.
    • Click the “ADD TO REPUTATION” button at the bottom of the popup window to initiate the adjustment to post’s author’s reputation points.

Plugin Special Notes

The Simple:Press theme(s) to be used must be a version(s) that support the “Reputation System” plugin with reputation template tags incorporated.

 

Template Tags Used in the Plugin

There are five (5) template tags available for this plugin that allows further customization of the plugin’s usage or otherwise customize the website. Four (4) ‘sp_PostIndexUserReputationLevel()’, ‘sp_PostIndexRepUser()’, ‘sp_MembersListReputationLevel()’, and ‘sp_UserReputationLevel()’ incorporated into standard supplied Simple:Press themes. Template tag ‘sp_MostReputable()’ is not incorporated.

  • 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 tag is 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 no other Actions and Hooks available for this plugin.

Plugin and Template Tag Changelog

Since Simple:Press version 5.5.11.

Codex page sync’d to code version 5.5.11 and plugin version 1.0.



Individual Template Tags


 

sp_PostIndexUserReputationsLevel

Description

sp_PostIndexUserReputationsLevel() – This template displays the reputation level of the author of a post.

Usage

sp_PostIndexUserReputationsLevel($args =”);

Arguments

$args – List of arguments for controlling display.
Type:
(string) (optional)
Default:
‘tagId’ => ‘spPostIndexReputationLevel%ID%
‘tagClass’ => ‘spPostReputationLevel’
‘imgClass’ => ‘spReputationBadge’
‘showBadge’ => 1
‘showTitle’ => 0
‘showRep’ => 0
‘stack’ => 1
‘echo’ => 1
‘get’ => 0

tagId‘: CSS ID for the Div. %ID% is replaced by the post’s ID.
tagClass‘: CSS Class for the Div.
imgClass‘: CSS Class for the badge being displayed.
showBadge‘: Flag to indicate whether or not to display the poster’s reputation badge. A one (1) will display the poster’s reputation badge. A zero (0) will not display the badge. The default badge for level 3 is the reputation bars with 3 red bars from filename ‘reputation_level_3.png’.
showTitle‘: Flag to indicate whether or not to display the poster’s reputation title. A one (1) will display the poster’s reputation title. A zero (0) will not display the title. The default title for a poster of level 3 is ‘Level 3’.
showRep‘: Flag to indicate whether or not to show the poster’s reputation point value. A one (1) will display the poster’s reputation point value. A zero (0) will not display the poster’s reputation point value. Using the default limits a poster of level 3 could have a point value from 501 to 750. The point value is never shown for Admins even if ‘showRep’ = 1.
stack‘: Flag to indicate whether or not to stack the elements being shown (badge, and/or title, and/or reputation 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.
echo‘: Flag to indicate whether to write out the generated html display code or just return the html display code. One (1) is true and causes the html display code to be written to the display. Zero (0) is false and causes the html display code to be returned instead of written out.
get‘: Flag to indicate whether to short circuit the template tag display process and simply return data or to proceed with normal HTML display code generation. One (1) is true and the template tag display process is not done and data is returned. Zero (0) is false and normal html display code generation happens.

Special Notes

In standard supplied Simple:Press themes this function is included in the Topic View ‘spTopicView.php’ file.

The exception is

  • 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, 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-reputation-post-index-level.php’.

Examples

Using the defaults but with ‘tagClass’ of “spPostReputationLevel spCenter” display the post’s author’s badge only. Have the function called conditionally.

if (function_exists('sp_PostIndexUserReputationLevel')) sp_PostIndexUserReputationLevel('tagClass=spPostReputationLevel spCenter');

 

Actions and Hooks Used in the sp_PostIndexUserReputationsLevel Template Tag

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

Description

sp_UserReputationLevel() – This template displays the forum user’s reputation level.

Usage

sp_UserReputationLevel($args=”, $user);

Arguments

$args – List of arguments for controlling display.
Type:
(string) (optional)
Default:
‘tagClass’ => ‘spReputationLevel’
‘titleClass’ => ‘spReputationLevel’
‘badgeClass’ => ‘spReputationLevel’
‘repClass’ => ‘spUserRep’
‘showTitle’ => 0
‘showBadge’ => 1
‘showRep’ => 0
‘stack’ => 1
‘echo’ => 1

tagClass‘: CSS Class for the Div.
titleClass‘: CSS Class for the reputation Title.
badgeClass‘: CSS Class for the reputation Badge.
repClass‘: CSS Class for the reputation point value.
showTitle‘: Flag to indicate whether or not to display the poster’s reputation title. A one (1) will display the poster’s reputation title. A zero (0) will not display the title. The default title for a poster of level 3 is ‘Level 3’.
showBadge‘: Flag to indicate whether or not to display the poster’s reputation badge. A one (1) will display the poster’s reputation badge. A zero (0) will not display the badge. The default badge for level 3 is the reputation bars with 3 red bars from filename ‘reputation_level_3.png’.
showRep‘: Flag to indicate whether or not to show the poster’s reputation point value. A one (1) will display the poster’s reputation point value. A zero (0) will not display the poster’s reputation point value. Using the default limits a poster of level 3 could have a point value from 501 to 750. The point value is never shown for Admins even if ‘showRep’ = 1.
stack‘: Flag to indicate whether or not to stack the elements being shown (badge, and/or title, and/or reputation 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.
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.

$user – The forum usergroup to which the individual whose reputation is being displayed belongs.
Type:
(string) (optional)
Default:
None

Special Notes

In the standard supplied Simple:Press themes, this template tag is included in the Profile Views available for viewing by other users in the ‘spProfileShow.php’ and ‘spProfilePopupShow.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, 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-reputation-user-level.php’.

Examples

Using the defaults display the profile owner’s reputation badge. Have the function called conditionally.

if (function_exists('sp_UserReputationLevel')) sp_UserReputationLevel('', $spProfileUser);

 

Actions and Hooks Used in the sp_UserReputationLevel Template Tag

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

Description

sp_MembersListReputationLevel() – This template displays the member’s reputation level.

Usage

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

Arguments

$args – List of arguments for controlling display.
Type:
(string) (optional)
Default:
‘tagId’ => ‘spMembersListReputation%ID%’
‘tagClass’ => ‘spInRowCount’
‘labelClass’ => ‘spInRowLabel’
‘level’ => 0
‘levelClass’ => ‘spInRowRank’
‘badge’ => 1
‘badgeClass’ => ‘spImg’
‘showRep’ ‘> 0
‘repClass’ => ‘spUserRep’
‘stack’ => 1
‘echo’ => 1
‘get’ => 0

tagId‘: CSS Class for the ID. %ID% is replaced with the ID of the post author.
tagClass‘: CSS Class for the Div.
labelClass‘: CSS Class for the Label.
level‘: Flag to indicate whether or not to display the poster’s reputation level. A one (1) will display the poster’s reputation level. A zero (0) will not display the level.
levelClass‘: CSS Class for the reputation level.
badge‘: Flag to indicate whether or not to display the poster’s reputation badge. A one (1) will display the poster’s reputation badge. A zero (0) will not display the badge.
badgeClass‘: CSS Class for the Badge.
showRep‘: Flag to indicate whether or not to show the poster’s reputation point value. A one (1) will display the poster’s reputation point value. A zero (0) will not display the poster’s reputation point value. Using the default limits a poster of level 3 could have a point value from 501 to 750. The point value is never shown for Admins even if ‘showRep’ = 1.
repClass‘: CSS Class of the reputation point value.
stack‘: Flag to indicate whether or not to stack the elements being shown (badge and/or reputation 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 with a colon (:) separating the elements to the extent the width of the display area allows before wrapping to the next line.
echo‘: Flag to indicate whether to write out the generated html display code or just return the html display code. One (1) is true and causes the html display code to be written to the display. Zero (0) is false and causes the html display code to be returned instead of written out.
get‘: Flag to indicate whether to short circuit the template tag display process and simply return data or to proceed with normal HTML display code generation. One (1) is true and the template tag display process is not done and data is returned. Zero (0) is false and normal html display code generation happens.

$label – Text displayed along with member’s reputation items being displayed (badge, and/or reputation point value).
Type:
(string) (optional)
Default:
None

Special Notes

In the standard supplied Simple:Press themes, this template tag is included in the members view ‘spMembersView.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, 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-reputation-members-list-level.php’.

Examples

On the Members View page seen when clicking the “Members” button in the forum page header use the default arguments to show the member’s reputation badge with a blank label.

if (function_exists('sp_MembersListReputationLevel')) sp_MembersListReputationLevel('', '');

 

Actions and Hooks Used in the sp_MembersListReputationLevel Template Tag

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

Description

sp_PostIndexRepUser() – This template displays the ‘reputation icon’ that is the link to the popup where reputation is given or taken.

Usage

sp_PostIndexRepUser($args=”, $label=”, $toolTip=”);

Arguments

$args – List of arguments for controlling display.
Type:
(string) (optional)
Default:
‘tagId’ => ‘spRepUserButton%ID%’
‘tagClass’ => ‘spRepUserButton’
‘labelClass’ => ‘spInRowLabel’
‘iconClass’ => ‘spIcon’
‘icon’ => ‘sp_RepUserButton.png’
‘useDiv’ => 1

tagId‘: CSS Class for the ID. %ID% is replaced with the ID of the post.
tagClass‘: CSS Class for the Div.
labelClass‘: CSS Class for the Label.
iconClass‘: CSS Class for the reputation icon.
icon‘: Filename of the file containing the reputation icon to be displayed.
useDiv‘: Flag to indicate whether or not to use a separate Div for displaying the icon and label. A one (1) will put the elements in their own Div. A zero (0) will not.

$label – Text displayed along with the icon.
Type:
(string) (optional)
Default:
None

$toolTip – Text displayed when hovering the cursor over the icon.
Type:
(string) (optional)
Default:
None

Special Notes

In the standard supplied Simple:Press themes, this template tag is included in the Topic View ‘spTopicView.php’ file.

The exception is

  • 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, 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-reputation-rep-user.php’.

The ‘reputation icon’ is not displayed on posts of members that cannot get reputation. Similarly, it is not displayed on any post if the logged in user cannot give reputation. For post authors and the logged in users having the proper permissions, once the logged in user gives/takes reputation to/from the author of the post, the ‘reputation icon’ is no longer displayed to that logged in user on that post.

Examples

Using the defaults but with ‘tagClass’ of “spCenter” display the ‘reputation icon’ without a label in their own Div and with the text “Give/Take Reputation” displayed when hovering the cursor over the ‘reputation icon’. Have the function called conditionally.

if (function_exists('sp_PostIndexRepUser')) sp_PostIndexRepUser('tagClass=spCenter', '', __sp('Give/Take Reputation'));

 

Actions and Hooks Used in the sp_PostIndexRepUser Template Tag

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

Description

sp_MostReputable() – This template displays the most reputable users in the forum

Usage

sp_MostReputable($args=”);

Arguments

$args – List of arguments for controlling display.
Type:
(string) (optional)
Default:
‘tagId’ => ‘spMostReputable’
‘tagClass’ => ‘spMostReputable’
‘listId’ => ‘spMostReputableList%ID%’
‘listClass’ => ‘spListItemTag’
‘textClass’ => ‘spMostReputableText’
‘userClass’ => ‘spMostReputableName’
‘avatarClass’ => ‘spMostReputableAvatar’
‘badgeClass’ => ‘spMostReputableBadge’
‘levelClass’ => ‘spMostReputableLevel’
‘repClass’ => ‘spMostReputableAmount’
‘listTags’ => 1
‘limit’ => 10
‘includeMods’ => 0
‘minRep’ => 0
‘itemOrder’ => ‘AURB’
‘avatarSize’ => 30
‘echo’ => 1

tagId‘: CSS Class for the Div or list.
tagClass‘: CSS Class to be applied for styling.
listClass‘: CSS Class to be applied to list item style.
textClass‘: CSS Class to be applied to text labels.
userClass‘: CSS Class to be applied to the user.
avatarClass‘: CSS Class to be applied to the avatar.
badgeClass‘: CSS Class to be applied to the badge.
levelClass‘: CSS Class to be applied to the reputation level.
listTags‘: Flag to indicate whether to wrap the list items in “ul” and “li” tags. A one (1) will wrap the list in the tags. A zero (0) will cause a div to be used.
limit‘: The number of users to show on the most reputable users list.
includeMods‘: Flag to indicate whether or not to include Moderators in the most reputable users list. A one (1) will include the Moderators in the list. A zero (0) will not include Moderators in the list.
minRep‘: The minimum reputation point value a user must have to be included in the list.
itemOrder‘: This parameter controls both which components are displayed and also the order in which they are displayed. Use the following codes to construct this parameter. No spaces or other characters can be used:
A – Displays the users’ Avatar
U – Displays the users’ display name
B – Displays the users’ reputation level badge
L – Displays the users’ reputation level name
R – Displays the users’ reputation point value
avatarSize‘: Parameter defining how large to display the reputable user’s avatar.
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 NOT included in standard supplied Simple:Press theme files.

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

If it is used, 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-reputation-most-reputable.php’.

Examples

Using the child theme based on the “Default” theme conditionally call this function in the footer of forum pages using default values if not otherwise specified to display the 10 most reputable forum users. Separate this function from the previous function by place a ‘sp_InsertBreak()’ function before them.

A. If not already done, download the Default Child Framework and set it up as discussed in the Creating a Child Theme page. If not already done, copy the Default theme’s ‘spFoot.php’ file over to the child theme and at the bottom of the ‘stats’ section add the ‘sp_InsertBreak()’ call and the conditionally called ‘sp_UnreadPostsLink()’ as shown below and save.

sp_InsertBreak();
if (function_exists('sp_MostReputable')) sp_MostReputable('');

 

Actions and Hooks Used in the sp_MostReputable Template Tag

  • apply_filters(‘sph_MostReputable_args’, $a) – Allows modification of the arguments to the template tag. $a contains the parsed arguments.
  • apply_filters(‘sph_MostReputableQuery’, $spdb) – Allows modification of the database query results and the most reputable users to select.
  • apply_filters(‘sph_MostReputable’, $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.