XOOPS / XoopsCore25

XOOPS Core 2.5.x (current release is 2.5.11: https://github.com/XOOPS/XoopsCore25/releases)
GNU General Public License v2.0
71 stars 59 forks source link

Bug : block "on line" : only webmasters are displayed #989

Closed alain01 closed 3 years ago

alain01 commented 3 years ago

Hi, I noticed a strange thing !

I use the online block , but only displayed for the webmasters. ok. So, the block is visible for admin and not for members and anonymous test-user cant see this block, ok

But the block show olny the webmasters who are logged, not members.

admin is logged, test-user is logged too

As admin, I just can see that admin is logged, not test-user

File /themes/xswatch4/modules/system/blocks/system_block_online.tpl

GregMage commented 3 years ago

It is when the block is displayed that the users are saved in the database. So if the block is not available for a group, the members of that group will not be counted.

It is true that the behavior is not very logical, but it is important not to make the requests in the database if we do not want the block.

This behavior should be explained when editing the block or in the help.

GregMage commented 3 years ago

https://github.com/XOOPS/XoopsCore25/issues/492

geekwright commented 3 years ago

All the data is collected by the block being part of page. The best result is when it is part of all the pages, so it can track who is using which module. The only data collected outside of the block is on logout, where the user is removed from the online table.

But, there is a big difference between having a block be part of the page, and the block being seen. If you eliminate the block title, and in your theme template surround everything in a <{if $xoops_isadmin}> ... <{/if}> then only the admin could see the data collected.

alain01 commented 3 years ago

Ok I understant your answer and i will close this issue BUT IMO, It's illogical. Why ? Just read this example to understand.

I want to display the online users information only for the members "premium" and "webmasters". So if I used as usually the permission block system, I give right for "premium" and "webmasters" to show this bloc. But they will see only webmasters group and premium group. They could not see that "toto" "tata" and "tutu" as "members" are online. So strange.

Alain

geekwright commented 3 years ago

I understand what you are saying, but it isn't a bug. It is a community building feature that works exactly as designed. What you say you want is a very different system, other than the name "online."

GregMage commented 3 years ago

A simple solution for your need is to clone the block. This cloned block is available to everyone but you remove the html inside the template. This block collects data but displays nothing. You activate the basic block for the category you want and at the desired location and everything works as you want.

alain01 commented 3 years ago

Hey, good brain storming @GregMage Thank you !