Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: Angelotus - maaliskuu 05, 2009, 06:25:19 AP

Otsikko: User and Membergroups / Subscriptions
Kirjoitti: Angelotus - maaliskuu 05, 2009, 06:25:19 AP
Hi,

I want to add a message that if a user is part of a membergroup it say: hello member of usergroup x
And if not: sign up for this membergroup

How can I do that?
Otsikko: Re: User and Membergroups / Subscriptions
Kirjoitti: Angelotus - maaliskuu 05, 2009, 08:11:40 AP
I should say I tried it with this code, where 9 is the group ID:


if( in_array(9, $context['user_info']['groups'] ) )
{
     echo '<div class="smalltext">[premium member]</div>';
}
else
{
     echo '<div class="smalltext"><a href="http://premium.weeklyfun.nl/forum/index.php?action=profile;area=subscriptions;u=">[become premium]</a></div>';
}


But that doesn't work!
Otsikko: Re: User and Membergroups / Subscriptions
Kirjoitti: Angelotus - maaliskuu 07, 2009, 06:02:57 AP
Anyone who can help me out with this please?
Otsikko: Re: User and Membergroups / Subscriptions
Kirjoitti: Angelotus - maaliskuu 09, 2009, 04:52:56 AP
No comments so far thus bumping this thread :)
Otsikko: Re: User and Membergroups / Subscriptions
Kirjoitti: onepiece - maaliskuu 16, 2009, 09:56:56 AP
Have a look at this (http://www.simplemachines.org/community/index.php?topic=298187.msg1969429#msg1969429) post.
Otsikko: Re: User and Membergroups / Subscriptions
Kirjoitti: Angelotus - maaliskuu 16, 2009, 10:10:23 AP
Thanks Tenma! It works fine now!