Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Gargoyle - marraskuu 30, 2013, 07:21:02 IP

Otsikko: Making one upper link bar link member group specific?
Kirjoitti: Gargoyle - marraskuu 30, 2013, 07:21:02 IP
I want to add a link to the upper link bar but make it for a specific membergroup. The membergroup will not be a primary group. Im gonna dig around the code for a bit...

Thanks for any help!
Otsikko: Re: Making one upper link bar link member group specific?
Kirjoitti: Arantor - marraskuu 30, 2013, 07:26:02 IP
in_array($group_id, $user_info['groups']) will work... $user_info['groups'] contains all the groups the current user is in at the present time.
Otsikko: Re: Making one upper link bar link member group specific?
Kirjoitti: Gargoyle - marraskuu 30, 2013, 07:35:19 IP
So if I go like this

if in_array($group_id, $user_info['groups']) == 21

I could make it a specific group?

;D
Otsikko: Re: Making one upper link bar link member group specific?
Kirjoitti: Arantor - marraskuu 30, 2013, 07:39:01 IP
Not like that, no

But if you did if(in_array(21, $user_info['groups'])) it might work ;)
Otsikko: Re: Making one upper link bar link member group specific?
Kirjoitti: Gargoyle - marraskuu 30, 2013, 07:41:06 IP
Ah... Better... Thanks a ton!!! Saved me about 2 days work!! LOL!!!

Thanks a ton! I will give it a shot, but I am sure it'll work.