Simple:Press Documentation

Template Tag: Admin and Moderator Online

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.

[sp_admins_online]

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.