Jump to content

Getting the who's online widget to display counts?


Go to solution Solved by opentype,

Recommended Posts

Posted

How can I get the who's online widget to display the counts for guests and members/anonymous etc.

I am struggling to find out how though I'm sure there's an option somewhere. I use the page builder and add the widget but it only shows the member online which right now is only me. Does not show the counts for the members or guests. How do I display the count?

Do I need to know some template knowledge or is it an option I'm not seeing? If so, can you provide the template code real fast. Thank you for helping if you can.

Posted
17 minutes ago, Bradley Padgett said:

How can I get the who's online widget to display the counts for guests and members/anonymous etc.

I am struggling to find out how though I'm sure there's an option somewhere. I use the page builder and add the widget but it only shows the member online which right now is only me. Does not show the counts for the members or guests. How do I display the count?

Do I need to know some template knowledge or is it an option I'm not seeing? If so, can you provide the template code real fast. Thank you for helping if you can.

There is no built in option for that a.f.a.i.k. That will require custom coding.

A template edit only is not enough. The whosOnline.php file located at applications/core/widgets will have to be modified too.

  • Solution
Posted

The variables are accessible from the widget as $memberCount, $guests, $anonymous, but the idea of the widget is to list the names of the members itself. It’s not about full stats. 

For an alternative view and a turn-key solution, you can also check out this plugin:

 

Posted
27 minutes ago, Miss_B said:

There is no built in option for that a.f.a.i.k. That will require custom coding.

A template edit only is not enough. The whosOnline.php file located at applications/core/widgets will have to be modified too.

If you go some route like this, it would be advised to do a plugin rather than modifying the core files (of course, self-hosted as the access is not there on Cloud). Modifying the core files will make things hard to upgrade and if any issue come from modifying core files, we will need the core files restored before providing support.

Posted
1 minute ago, Jim M said:

If you go some route like this, it would be advised to do a plugin rather than modifying the core files (of course, self-hosted as the access is not there on Cloud). Modifying the core files will make things hard to upgrade and if any issue come from modifying core files, we will need the core files restored before providing support.

Of course. Modifying of files is not advisable.  What I meant to say above is that a template edit only was not enough, as the OP asked, but other stuff was required too. 

Posted

It shouldn't be too hard to make an add-on. I'll take a look at your documentation thank you for all the replies. I made 2 or 3 add-ons before on another software. Will be something to learn from and will be exiting to go ahead with it since it should be easier then it sounds. I appreciate the help.

Posted

You can also easily create a custom version of almost any widget using Pages custom blocks. Custom templates are part of that and it wouldn’t require plugins or theme changes. You just need to be aware that those blocks are being cached, which can be problematic when live data such as online users are meant to be shown. 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...