Simple:Press Documentation

Template Tag: Hot Topics

The Template Tag Hot Topics displays hottest topics on the forum.

This template tag is included in the Template Tags and Widgets plugin available on the Simple:Press Our Plugin Library page.

The function used is sp_HotTopicsTag() and the file that makes the magic happen is sp-HotTopics-tag.php which is located in the plugin’s template-tags/library folder.

You can pass optional arguments to the function for formatting and display of special text or to show/not show specific items.

Options

  • tagId –  A unique id to use for div or list. This would be text. The default is spRecentPostsTag.
  • tagClass – The class to be applied for styling. This would be text. The default is spListTag.
  • listClass – class to be applied to list item style. This would be text. The default is spListItemTag.
  • textClass – class to be applied to text labels. This would be text. The default is spTextTag.
  • listTags – Wrap in <ul> and <li> tags. This would be true or false. The default is true. If false a div will be used.
  • forumIds – A comma delimited list of forum id numbers. This is optional. The default is all forums.
  • limit – How many topics to show in the list. This would be a number. The default is 5.
  • days – How many days to include in the hotness calculations. The default is 30.
  • showForum – Show the forum name.  This would be true or false. The default is true.
  • textForum – Text preceding forum name. This would be text. The default is “‘posted in”.
  • showCount – See note below for usage.  This would be true or false. The default is true.
  • textCount – -Text to use for $ of posts . This would be text. The default is  “recent posts”.
  • showHotness – See note below for usage.  This would be true or false. The default is true.
  • textHotness – Text to use for hotness score. This would be text. The default is “hotness”.
  • echo is a true/false expression using 1 as true and 0 as false. The default is true.

NOTE: True must be expressed as a 1 and False as a zero

Usage

An example of using this tag with only default settings.

<?php sp_HotTopicsTag() ; ?>

An example of using this tag with  a little HTML and the count not shown, the forum name not shown, using the word “Ratings” instead of “Hotness”  and only showing the 2 hottest topics.

<center><b>Hot Topics in the Forum</b>
<?php sp_HotTopicsTag('showCount=0&showForum=0&textHotness=Rating&limit=2');?>
</center>

The output displayed would look like:

You can also call this function by using a shortcode on pages, posts or widgets.

[sp_hot_topics]

Actions and Hooks Used in Template Tag

  • apply_filters(‘sph_HotTopicsTag’, $out); – allows modification of the arguments to the template tag. $out contains the parsed arguments.

The Using Plugins page describes how you obtain and install the Template Tags plugin. Once installed you would activate it from the Simple:Press administration page Available “Plugins – Install Simple:Press Plugins”

More Topics In SimplePress: Plugins


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