Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: edi67 - tammikuu 16, 2009, 05:08:49 AP

Otsikko: Show button by permissions?
Kirjoitti: edi67 - tammikuu 16, 2009, 05:08:49 AP
How i coud let show one button (who online) only to the groups that are enabled to view it ?

i try to modifiy this code in Subs.php but with not solution:

'who' => array(
'title' => $txt['whosonline'],
'href' => $scripturl . '?action=who',
'show' => true,
'sub_buttons' => array(
),


I want that button will be visible ONLY to the groups that are enabled to view Who's online function.

somebody can help me ?
Otsikko: Re: Show button by permissions?
Kirjoitti: greyknight17 - tammikuu 25, 2009, 07:21:33 IP
Not sure if this is exactly what you want, but if you go to Admin > Permissions, select the membergroup and click Modify. Then uncheck View Who's Online.
Otsikko: Re: Show button by permissions?
Kirjoitti: noex - tammikuu 26, 2009, 12:09:03 IP
Try this...
        'who' => array(
            'title' => $txt['whosonline'],
            'href' => $scripturl . '?action=who',
            'show' => allowedTo('who_view'),
            'sub_buttons' => array(),
            ),
Otsikko: Re: Show button by permissions?
Kirjoitti: edi67 - tammikuu 27, 2009, 03:30:30 AP
Lainaus käyttäjältä: noex - tammikuu 26, 2009, 12:09:03 IP
Try this...
         'who' => array(
            'title' => $txt['whosonline'],
            'href' => $scripturl . '?action=who',
            'show' => allowedTo('who_view'),
            'sub_buttons' => array(),
            ),


this is perfectly tha i need thx, but code is correct in this way
'who' => array(
'title' => $txt['whosonline'],
'href' => $scripturl . '?action=who',
'show' => allowedTo('who_view'),
'sub_buttons' => array(
),


thx noex