Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: William Wolfe on January 26, 2013, 04:15:23 PM

Title: Display tabs to users in specific groups
Post by: William Wolfe on January 26, 2013, 04:15:23 PM
I've been customizing the page tabs on my forum. I want to display one only if a user is in the "Has Email" group. How would I do that? I already know how to add regular tabs/sub tags by editing Subs.php.

I'm guessing the code would be similar to 'show' => $user_info['is_guest']?
Title: Re: Display tabs to users in specific groups
Post by: Arantor on January 26, 2013, 04:31:18 PM
Similar, but not quite the same.

Is that group based on having a permission or something else? What is 'has email' group?
Title: Re: Display tabs to users in specific groups
Post by: William Wolfe on January 26, 2013, 05:32:10 PM
Quote from: Arantor on January 26, 2013, 04:31:18 PM
Similar, but not quite the same.

Is that group based on having a permission or something else? What is 'has email' group?

It's a hidden membership group assigned by admins. It doesn't add or remove any permissions.
Title: Re: Display tabs to users in specific groups
Post by: Arantor on January 26, 2013, 05:38:21 PM
OK, so what id number does it have? You can find it out from the admin panel by going to the edit membergroups list, and if you hover over the edit button, you'll see the group id number as the last part of the URL
Title: Re: Display tabs to users in specific groups
Post by: William Wolfe on January 26, 2013, 06:58:00 PM
The group's ID is 23.
Title: Re: Display tabs to users in specific groups
Post by: Arantor on January 26, 2013, 07:24:14 PM
In which case, use:
'show' => in_array(23, $user_info['groups']), for that line of the menu definition.
Title: Re: Display tabs to users in specific groups
Post by: William Wolfe on January 26, 2013, 09:33:38 PM
Thanks.