#66

Product support

Get help in the plugin support forum.

Categories

  • Utility

UserOnline plugin

Required: Rainlab.User, Rainlab.Forum (temporary)

This plugin enables you to display how many users and guests are online on your OctoberCMS site.

Like this plugin?

If you like this plugin or if you use some of my plugins, you can help me to make new plugins and provide plugins support and further development. Give this plugin a review. :)

Usage

  1. Go to CMS -> Layout
  2. Add this code in the Code section.

This code will add new guests in the database or update the users last page and last activity.

Alt text

use ShahiemSeymor\Online\Models\Online;

function onInit()
{
    Online::updateCurrent();
}
Check if the user is online with a member ID

You can check if the user is online with the code below:

{{ isOnline(member.id) ? 'online' : 'offline'  }} 
Display online users and guests
  • Add the onlineList component to your page/layout.
  • Add the following to your page/partial/layout

Component

{% component "onlineList" %}

You can use the properties below to show your online guests, users and online users on the currentpage. As example:

{{ usersOnlineCurrentPage|length }} / Integer count of the online users on the current page
Property Returns
guestsOnline Integer count of the online guests
usersOnline Integer count of the online users
usersOnlineCurrentPage Integer count of the online users on the current page
1.0.1

First version

Mar 23, 2015