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.
The forum of the forums
2 posters

    Group Test by Ange Tuteur

    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    Solved Group Test by Ange Tuteur

    Post by TamDonCo August 19th 2016, 2: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 19th 2016, 9:03 pm; edited 2 times in total
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Group Test by Ange Tuteur

    Post by SLGray August 19th 2016, 2:57 pm

    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.
    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    Solved Re: Group Test by Ange Tuteur

    Post by TamDonCo August 19th 2016, 9:03 pm

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

    Thanks anyway
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Group Test by Ange Tuteur

    Post by SLGray August 19th 2016, 9:23 pm

    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.

      Current date/time is November 11th 2024, 2:20 pm