Advertisement:

Author Topic: Display tabs to users in specific groups  (Read 1858 times)

Offline William Wolfe

  • Jr. Member
  • **
  • Posts: 128
  • Gender: Male
  • A newbie of SMF :3
    • @@WilliamHWolfe on Twitter
    • TerraNova
Display tabs to users in specific groups
« 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']?
William Wolfe

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,980
    • StoryBB/StoryBB on GitHub
Re: Display tabs to users in specific groups
« Reply #1 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?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline William Wolfe

  • Jr. Member
  • **
  • Posts: 128
  • Gender: Male
  • A newbie of SMF :3
    • @@WilliamHWolfe on Twitter
    • TerraNova
Re: Display tabs to users in specific groups
« Reply #2 on: January 26, 2013, 05:32:10 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.
William Wolfe

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,980
    • StoryBB/StoryBB on GitHub
Re: Display tabs to users in specific groups
« Reply #3 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
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline William Wolfe

  • Jr. Member
  • **
  • Posts: 128
  • Gender: Male
  • A newbie of SMF :3
    • @@WilliamHWolfe on Twitter
    • TerraNova
Re: Display tabs to users in specific groups
« Reply #4 on: January 26, 2013, 06:58:00 PM »
The group's ID is 23.
William Wolfe

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,980
    • StoryBB/StoryBB on GitHub
Re: Display tabs to users in specific groups
« Reply #5 on: January 26, 2013, 07:24:14 PM »
In which case, use:
Code: [Select]
'show' => in_array(23, $user_info['groups']), for that line of the menu definition.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline William Wolfe

  • Jr. Member
  • **
  • Posts: 128
  • Gender: Male
  • A newbie of SMF :3
    • @@WilliamHWolfe on Twitter
    • TerraNova
Re: Display tabs to users in specific groups
« Reply #6 on: January 26, 2013, 09:33:38 PM »
Thanks.
William Wolfe