This topic has 9 replies, 3 voices, and was last updated 11 years by Abe.

  • Author
  • #11782
     thendsproject
    Participant

    Hi! Thanks so much for the help with the ArrowChat levels the other day, it appears to be working!!! I have a bug I need some help with, though.

    When I restrict access to Private Messages to only “Not logged in”, “Not Members” and “FREE” memberships, it disables it for every member level. Can you help me see what is wrong there? The “Private Message” button disappears for everyone, if I restrict it at all.

    Thanks!
    Brad

    #12044
     Abe
    Keymaster

    Private message button is disappearing from other cause. Those settings are doing redirects of the page

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #12187
     FD
    Participant

    Hi,

    We also have some trouble with the private message restrictions for one of our levels.

    We have three level:

    Freelevel : Turisten (Just, read, not send without upgrading)
    Paid level: Spideren (Can send and read messages)
    Paid level: Eventyreren (Can send and read messages)

    We have restricted the level “Turisten” to not be able to send messages, just read (Not restricted for “Restrict Messages page” and restricted for “Restrict users from sending private messages”).
    This does not work anymore.

    When a paid level member sends a message to a free level member, he is able to answer without upgrading. We need the free level member to be redirected to PMPRO memberships level page so he can upgrade before he can answer.

    How do we fix this?
    Thanks for helping us. 🙂

    site:
    fjelldate.no

    login:
    l:seventhqueen
    p:7theQueen!

    #12445
     Abe
    Keymaster

    There is no option like “Restrict Messages page” by default. Please see your added code since the problem it is obviously from your settings/code/etc

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #12525
     FD
    Participant

    Maybe not by default, but according to this topic it´s possible to add: https://archived.seventhqueen.com/forums/topic/extra-membership-restrictions-how-to

    I have used the code from the forum post and the other restrictions is working.

    This is my code:

    COPY CODE
    
    /* Medlemskapsrestriksjoner - These restrictions will appear to be configured in Sweetdate - Memberships */
    add_filter('kleo_pmpro_level_restrictions', 'kleo_my_levels_checkmarks');
    function kleo_my_levels_checkmarks($settings) {
     
        $settings = array (
            //NEW RESTRICTION MESSAGES page with name: message
            array(
                'title' => __('Restrict Messages page','kleo_framework'),
                'front' => __('Lese private meldinger','kleo_framework'),
                'name' => 'message'
            ),
            //NEW RESTRICTION SHOP page with name: shop
            array(
                'title' => __('Restrict Shop page','kleo_framework'),
                'front' => __('Tilgang til butikken','kleo_framework'),
                'name' => 'shop'
            ),
            array(
                'title' => __('Restrict members directory','kleo_framework'),
                'front' => __('Se medlemskatalog','kleo_framework'),
                'name' => 'members_dir'
            ),
            array(
                'title' => __('Restrict viewing other profiles','kleo_framework'),
                'front' => __('Se medlemsprofiler','kleo_framework'),
                'name' => 'view_profiles'
            ),
            array(
                'title' => __('Restrict access to groups directory','kleo_framework'),
                'front' => __('Tilgang til gruppekatalog','kleo_framework'),
                'name' => 'groups_dir'
            ),
            array(
                'title' => __('Restrict access to single group page','kleo_framework'),
                'front' => __('Tilgang til grupper','kleo_framework'),
                'name' => 'view_groups'
            ),
            array(
                'title' => __('Restrict users from viewing site activity','kleo_framework'),
                'front' => __('Fjellveggen for hele siden','kleo_framework'),
                'name' => 'show_activity'
            ),
            array(
                'title' => __('Restrict users from sending private messages','kleo_framework'),
                'front' => __('Sende private meldinger','kleo_framework'),
                'name' => 'pm'
            ),
            array(
                'title' => __('Restrict users from adding media to their profile using rtMedia or bpAlbum','kleo_framework'),
                'front' => __('Laste opp bilder','kleo_framework'),
                'name' => 'add_media'
            )
            
        );
        return $settings;
    }
    
    // Setter restriksjoner for sending av meldinger (Restrict profile area - Messages page)
    add_action('kleo_pmro_extra_restriction_before_my_profile','kleo_my_custom_restrict');
     
    function kleo_my_custom_restrict1()
    {
        //full current url
        $actual_link = kleo_full_url();
        //our request uri
        $uri = str_replace(untrailingslashit(home_url()),"",$actual_link);
     
        //restrict messaging page url
        if(preg_match("/^\/".bp_get_members_root_slug()."\/". bp_get_loggedin_user_username()."\/messages\/?/", $uri))
        {
            
            $my_restrictions =  array('message' => array(
                    //2 - restrict certain levels. 0 -restrict none; 1 - restrict all
                    'type' => 2,
                    //levels that you apply the restrictions to
                    'levels' => 1, //Restricts "Turisten" 
                    //'not_member' => 1, //restrict users without a membership level
                    //'guest' => 1 // restrict not logged in users
                )
            );
            //We use the name "message" from the new restriction added above
            kleo_check_access('message',$my_restrictions);
        }
    }
     
    //Restrict Shop page
    add_filter('kleo_pmpro_match_rules', 'kleo_my_custom_restrict2');
     
    function kleo_my_custom_restrict2($restrictions) {
        //regular expression for shop page
        $restrictions["/^\/shop\/?$/"] = array('name' => 'shop');
        return $restrictions;
    }
    

    Any ideas what´s wrong?

    #12622
     Abe
    Keymaster

    You have the function named kleo_my_custom_restrict1 but your action
    add_action(‘kleo_pmro_extra_restriction_before_my_profile’,’kleo_my_custom_restrict’); adds kleo_my_custom_restrict function which does not exist probably

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #12630
     FD
    Participant

    Ok, I did not see that. Thanks 🙂

    Then you also have to update the code in this post: https://archived.seventhqueen.com/forums/topic/extra-membership-restrictions-how-to

    After updating the add_action with kleo_my_custom_restrict1 instead of kleo_my_custom_restrict I´ve tried it again. I did not work after the code update either. 🙁 I also tried the these restrictions:

    Restrict users from sending private messages
    Restrict users from adding media to their profile using rtMedia or bpAlbum

    Neither of them work as they should.

    Something is very wrong. 🙁

    #12772
     Abe
    Keymaster

    Default restrictions should definitely work. Make sure you are not admin and checked which levels to restrict

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #12822
     FD
    Participant

    Hi,

    I have checked that I´m not admin and that the right levels are restricted.

    What to do?

    #12971
     Abe
    Keymaster

    What is your website? give me a test account that should be restricted and an admin one to see the settings done

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 10 posts - 1 through 10 (of 10 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?