Group Test by Ange Tuteur

Go down

Solved Group Test by Ange Tuteur

Post by TamDonCo on August 19th 2016, 8:51 pm

Hi Ange Tuteur

I saw this code from topic "How to test for group membership"
https://help.forumotion.com/t140646-how-to-test-for-group-membership?highlight=check+group

but it only works in first case and last, the middle case "MOD" does not work, can you help me what is wrong here ?

Code:
(function($) {
  $.get('/groups', function(d) {
    if ($('a[href*="/g1-"]', d)[0]) alert('ADMIN');
    else if ($('a[href*="/g2-"]', d)[0]) alert('MOD');
    else alert('MEMBER');
  });
})(jQuery);


Last edited by TamDonCo on August 20th 2016, 3:03 am; edited 2 times in total
avatar
TamDonCo
Forumember

Posts : 338
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Group Test by Ange Tuteur

Post by SLGray on August 19th 2016, 8:57 pm

When you are posting codes, please use the code tags.
Code:
[code][/code]


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 43504
Reputation : 3094
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Solved Re: Group Test by Ange Tuteur

Post by TamDonCo on August 20th 2016, 3:03 am

I found the problem , I have to enable usergroups to work

Thanks anyway
avatar
TamDonCo
Forumember

Posts : 338
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Group Test by Ange Tuteur

Post by SLGray on August 20th 2016, 3:23 am

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 43504
Reputation : 3094
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum