The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Group Test by Ange Tuteur

View previous topic View next topic 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"
http://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

TamDonCo
Forumember

Posts : 180
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.


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.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

TamDonCo
Forumember

Posts : 180
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.


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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