Simple:Press Documentation

FAQ: How To Remove Forum Statistics

In the standard supplied Simple:Press themes, the Forum Statistics are displayed in the footer of the forum page except for the iForum theme which does not display statistics. Except for the Reboot Theme as viewed by a “Desktop” device, the process described herein to remove the forum statistics involves making a Custom or Child Theme, then commenting out the ‘Stats‘ section in the theme’s footer template file.

It is strongly recommended the information provided in the following paragraphs and the Codex pages referenced in them be understood before making footer file modifications as shown in this page’s “Examples” section to remove the Forum Statistics.

  • If it is only desired to stop display of the Forum Statistics in the Reboot Theme as viewed by a “Desktop” device, Example 1 shows how to close or open the ‘Stats’ section of the footer by clicking on an existing footer icon. No file modification is necessary in the ‘spFootDesktop.php’ file.
  • Example 2 applies to commenting out the ‘Stats’ section in the ‘spFoot.php’ file of a child theme of ‘CSS-only’, ‘Default’, ‘Stacked’, and ‘Unified’ themes as well as in the ‘spFootMobile.php’ file of a child theme of the “Reboot” theme.

Location of Forum Statistics in Theme Template Files

In the CSS-Only, Default, Stacked, and Unified themes the theme’s ‘spFoot.php’ template file displays the Forum Statistics. In the Reboot theme, the theme’s ‘spFootDesktop.php’ or ‘spFootMobile.php’ template files display the Forum Statistics for ‘Desktop’ or ‘Mobile’ viewing devices, respectively.

Don’t Change Standard Supplied Simple:Press Themes

Changes should not be made to standard supplied Simple:Press themes and their associated files. The main reason for this recommendation is that any edits/customizations made to an existing Simple:Press provided theme can be lost because any new update in the theme will bring new files that overwrite the existing theme files including the ones customized. All the hard work customizing the files and checking out the changes will be lost.

Develop A Child Theme Using A Child Theme Framework or a Custom Theme

Rather than changing a standard supplied theme (a “parent” theme) it is recommend that a Child Theme or a Custom Theme be developed to contain the desire change, in this case, removing display of the Forum Statistics from the footer.

Information on Child Themes is located on our Creating a Child Theme page.

Information on creating Custom themes and installing them is located on our Creating a Custom Theme page.

Understand Theme Folder, Template Files, and Theme/Template Page Structure

Before starting any changes, it is suggested information at Theme Structure Codex page be understood.

That page references the About Template Files Codex page where information about the various template files can be found including the various theme footer files containing the Forum Statistics.

Both the previous mentioned Codex pages also reference the Theme Page Structure Codex page where a description is provided of the standard supplied Simple:Press theme page structure as defined by a theme’s template files. In particular it discusses the footer of pages as well as the ‘Statistics’ (Stats) section of the footer where the Forum Statistics are displayed.

Examples

Action needed to stop display of the Forum Statistics vary depending upon the Theme being used. The following two (2) examples address the different methods.

Example 1: Reboot Theme viewed on a Desktop Device – Stop Display of Forum Statistics
The Reboot Theme for viewing on a ‘desktop’ device contains a special function, ‘sp_OpenCloseControl()’ in the top of the footer file(‘spFootDesktop.php) which allows closing or opening the Forum Statistics section without any code modification.

  • Hover over the top of the footer to find the icon containing ‘graph axes with a red “X”‘ and to see the message “Close Statistics”. (‘sp_ControlClose.png’ is the reboot theme’s image file containing this icon).
  • Click on the icon with the red “X” to close the statistics section so it is not displayed.
    • The icon symbol changes from ‘graph axes with red “X”‘ to ‘graph axes with colored vertical graph-like bars’. (‘sp_ControlOpen.png’ is the reboot theme’s image file containing this icon).
    • Hovering over the ‘graph axes with colored vertical graph-like bars’ icon displays the messages “View Statistics”.
  • Click on the icon containing the ‘graph axes with colored vertical graph-like bars’ to cause the Forum Statistics section to be displayed again.
    • The icon symbol changes from ‘graph axes with colored vertical graph-like bars’ to ‘graph axes with red “X”‘.
    • Hovering over the ‘graph axes with red “X”‘ icon displays the messages “Close Statistics”.

Example 2: Stopping Display of Forum Statistics by modifying a Child or Custom Theme’s ‘spFoot.php’ or ‘spFootMobile.php’ file
As discussed above, standard supplied Simple:Press Themes (also known as Parent Themes or Core Themes) should not have their files modified.

If along with this change extensive modifications are planned, a Custom Theme could be developed. Information on creating Custom themes and installing them is located on our Creating a Custom Theme Codex page. Were a Custom theme to be made, commenting out the ‘Stats” section in the theme’s footer file as shown in this example will stop display of the Forum Statistics.

This example makes use of a Simple:Press Child Theme Framework to contain the change that stops the display of Forum Statistics.

  • After deciding on a “Parent” theme, follow the steps outlined in our Creating a Child Theme Codex page to make a Child Theme.
    • This example assumes the “Default” theme as the parent and use of the “Default Child Framework” renamed “mySiteDefChi”.
  • Copy the “spFoot.php” file from the parent’s template folder to the child’s template folder. Change the file’s text header to indicate it is associated with the new theme (i.e. mySiteDefChi). Additional descriptive text including the date should be added to the file header text describing its origin and the changes being made to the code. Because a template file is to be a complete, standalone file, initially all the code in the file is the same as the parent. At this point modifications can be made to remove, add, or alter the code to make the unique child theme file before the file is saved.
    Note: Using the Reboot Child Framework, ‘spFootMobile.php’ would be copied to the child theme’s ‘mobile’ folder within the ‘template’ folder and then modified.
  • In the example on this page, the change wanted is to no longer display the forum statistics at the bottom of the forum page. A very easy way to accomplish this is to just comment out the entire forum statistics (‘Stats’) section rather than removing code. By inserting /* in front of the first instruction for the section and placing */ on a blank line after the last instruction for the section, the entire group of instructions become only comments and are not executed. The original beginning and end of the statistics section are shown in A) below. The beginning and end of the section in the file saved are shown in B) below.
  •  
    A). The unmodified forum statistics section is:

    # Start the 'stats' section
    # ----------------------------------------------------------------------
    sp_SectionStart('tagClass=spStatsSection', 'stats');
      sp_ForumTimeZone('tagClass=spForumTimeZone', __sp('Forum Timezone: '));
      .
      .
      .
      sp_AdminsList('tagClass=spLeft spAdministrators', __sp('Administrators: '));
    sp_SectionEnd('tagClass=spClear', 'stats');

    B). The saved file’s modified forum statistics section is:

    # Start the 'stats' section
    # ----------------------------------------------------------------------
    /*sp_SectionStart('tagClass=spStatsSection', 'stats');
      sp_ForumTimeZone('tagClass=spForumTimeZone', __sp('Forum Timezone: '));
      .
      .
      .
      sp_AdminsList('tagClass=spLeft spAdministrators', __sp('Administrators: '));
    sp_SectionEnd('tagClass=spClear', 'stats');
    */

Changelog

Since Simple:Press initial versions.

Codex page sync’d to code version 5.5.8.

More Topics In FAQ


Copyright © 2006-2019 Simple:Press. All Rights Reserved.