Important Note: The contents of this document applies ONLY to version 5.x.x of Simple:Press. It likely does NOT apply to version 6.x.x (our latest version).
The Template Tag Admin/Moderator Online displays the online status of admins and moderators.
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_AdminModeratorOnlineTag() and the file that makes the magic happen is sp-AdminModeratorOnline-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.
Options
- tagId – unique id to use for div or list. The format is text and the default is spAdminModeratorOnlineTag
- tagClass – class to be applied for styling. The format is text and the default is spListTag
- moderator – Display moderator status. True/false and the default is true. True must be expressed as a 1 and False as a zero
- custom – Display custom status text if set. True/false and the default is true. True must be expressed as a 1 and False as a zero
- customClass – class to be applied to message. The format is text and the default is AdminMessageTag
- listTags – Wrap in <ul> and <li> tags. True/false and the default is true. If false a div will be used. True must be expressed as a 1 and False as a zero
- listClass – class to be applied to list item style. The format is text and the default is spListItemTag
- onToolTip – Tooltip to display if online. The format is text and the default is ‘Online’
- onIcon – Icon to display if online. This is a filename. The default is sp_UserOnlineSmall.png
- offToolTip – Tooltip to display if offline. The format is text and the default is ‘Offline’
- offIcon – Icon to display if offline. This is a filename. The default is sp_UserOfflineSmall.png
- echo – echo content or return content. True/false and the default is true. True must be expressed as a 1 and False as a zero
Usage
An example of using this tag with the default settings
<?php sp_AdminModeratorOnlineTag(); ?>
Example of changing the Online Tool Tip text
<?php sp_AdminModeratorOnlineTag('onToolTip=is Currently Online&offToolTip=is Offline');?>
You can also call this function by using a shortcode on pages, posts or widgets.
- Blues Dancer is Offline
- Simple Press is Offline
- SP Community Support is Offline
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”