1
xoobaru
Is there a hack to add a users group to his whos online status list?
  • 2013/3/16 12:21

  • xoobaru

  • Just can't stay away

  • Posts: 494

  • Since: 2010/12/2


Is there a hack available to add a users group status to each user listed under the page opened with the more link in the who's online block?

irmtfan, I know you had a successful no admin hack along these lines, but is anything possible for displaying the group the user belongs to here?

2
redheadedrod
Re: Is there a hack to add a users group to his whos online status list?

Quote:

xoobaru wrote:
Is there a hack available to add a users group status to each user listed under the page opened with the more link in the who's online block?


This should be a simple hack to include the group names to the users but be aware that some users may belong to more than one group. You may want to have a mechanism to only display one group.

3
xoobaru
Re: Is there a hack to add a users group to his whos online status list?
  • 2013/3/16 14:21

  • xoobaru

  • Just can't stay away

  • Posts: 494

  • Since: 2010/12/2


There are a few ways that multiples could be done.
Display first one detected, random selection, choose to blend in with the majority, etc.

But before it can be displayed it first has to be detected. What variable does this involved, how does it get used, and what results does it return?

4
demian
Re: Is there a hack to add a users group to his whos online status list?
  • 2013/3/16 15:16

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29



5
xoobaru
Re: Is there a hack to add a users group to his whos online status list?
  • 2013/3/16 23:37

  • xoobaru

  • Just can't stay away

  • Posts: 494

  • Since: 2010/12/2


Hey, thanks much demian/redheadedrod. That looks good. I'll try working forward from that.


6
irmtfan
Re: Is there a hack to add a users group to his whos online status list?
  • 2013/3/17 2:11

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


huum.
That FAQ is too old and somebody should change it with the excellent comment by coopersita. ( The last comment )

you need to hack b_system_online_show in xoops255\modules\system\blocks\system_blocks.php

// START irmtfan - hack to get user group names
        
$member_handler =& xoops_gethandler('member');
        
$groups $member_handler->getGroupsByUser($onlines[$i]['online_uid'] , true);
        
$userGroupNames = array();
        foreach( 
$groups as $group ) {
            
$userGroupNames[] = $group->getVar('name');
        }
                
$members .= XOOPS_URL '/userinfo.php?uid=' $onlines[$i]['online_uid'] . '" title="' $onlines[$i]['online_uname'] . '">' $onlines[$i]['online_uname'] . ',';
                
$members .=    '[' implode('|'$userGroupNames) . ']';
        
// END irmtfan - hack to get user group names


I think you asked about invisible admins in another thread. so if you already have the handler ( $member_handler =& xoops_gethandler('member');) you dont need to call it again.

As you can see this online block is too old and have not any feature or ability for customization and is full of hard-codes.
I sent a feature for a online block some months ago.
I will introduce a new online block for xoops in the near future.

7
xoobaru
Re: Is there a hack to add a users group to his whos online status list?
  • 2013/3/17 21:29

  • xoobaru

  • Just can't stay away

  • Posts: 494

  • Since: 2010/12/2


Thanks, as I have not had an opportunity to sit down with it yet. This new information may mesh with a number of previous threads nicely.

Login

Who's Online

337 user(s) are online (200 user(s) are browsing Support Forums)


Members: 0


Guests: 337


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits