1
Runeher
Who's online block for webmasters only
  • 2009/3/5 23:43

  • Runeher

  • Module Developer

  • Posts: 825

  • Since: 2008/1/24


There used to be a hack for the system_blocks.php that would include all groups but make the block visible to webmasters only:

if(is_object($xoopsUser)) { if(!in_array('1',$xoopsUser->getGroups())) 

return 
''; } 
} else { 
return 
''; }


It's not working anymore... anyone with the solution?

2
trabis
Re: Who's online block for webmasters only
  • 2009/3/6 0:23

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


global $xoopsUser;
    if(!
is_object($xoopsUser) || !in_array(1$xoopsUser->getGroups())) {
        return 
false;
    }


This have to work for any block.

3
HFC-arab
Re: Who's online block for webmasters only
  • 2009/3/6 0:25

  • HFC-arab

  • Just popping in

  • Posts: 30

  • Since: 2009/1/19


means i have to only put it in any block so it will be hidden except for webmaster ?

4
trabis
Re: Who's online block for webmasters only
  • 2009/3/6 0:33

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


yes, but you can do that in XOOPS block permissions, lol.

I understand what you want runeher,
You must use that code just after this lines:
if (is_object($xoopsModule)) {
        
$online_handler->write($uid$unametime(), $xoopsModule->getVar('mid'), $_SERVER['REMOTE_ADDR']);
    } else {
        
$online_handler->write($uid$unametime(), 0$_SERVER['REMOTE_ADDR']);
    }


This will guarantee that the online info will be saved.

5
Runeher
Re: Who's online block for webmasters only
  • 2009/3/6 12:51

  • Runeher

  • Module Developer

  • Posts: 825

  • Since: 2008/1/24


Thank you trabis! works very well!

Login

Who's Online

172 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 172


more...

Donat-O-Meter

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

Latest GitHub Commits