The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Group Test by Ange Tuteur

2 posters

Go down

Solved Group Test by Ange Tuteur

Post by TamDonCo Fri 19 Aug - 18:51

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 Sat 20 Aug - 1:03; edited 2 times in total
TamDonCo
TamDonCo
Forumember

Posts : 427
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Group Test by Ange Tuteur

Post by SLGray Fri 19 Aug - 18:57

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


Group Test by Ange Tuteur Slgray10

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

Male Posts : 51539
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Group Test by Ange Tuteur

Post by TamDonCo Sat 20 Aug - 1:03

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

Thanks anyway
TamDonCo
TamDonCo
Forumember

Posts : 427
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Group Test by Ange Tuteur

Post by SLGray Sat 20 Aug - 1:23

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


Group Test by Ange Tuteur Slgray10

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

Male Posts : 51539
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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