This topic has 9 replies, 3 voices, and was last updated 10 years by studiblog.

  • Author
  • #9997
     studiblog
    Participant

    My membership restrictions are not working anymore. I have a free membership level and in sweetdate–> membership i set everything to “restrict to 1)not logged in, 2) not members”
    so far so right? a week ago everything worked perfectly. guests were redirected to /registration
    But you can see profile pages even if you’re not logged in now 🙁
    Here is the code from sweetdate-child, functions.php, maybe i changed sth. accidently.

    COPY CODE
    <?php
    /**
     * @package WordPress
     * @subpackage Sweetdate
     * @author SeventhQueen <themesupport@seventhqueen.com>
     * @since Sweetdate 1.0
     */
    
    /**
     * Sweetdate Child Theme Functions
     * Add extra code or replace existing functions
    */ 
    
    /* Filter the redirect url for login*/
    add_filter("login_redirect","kleo_redirect_to_profile",100,3);
     
    function kleo_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user){
    /*if no redirect was specified,let us think ,user wants to be in wp-dashboard*/
        if(!is_super_admin($user->ID))
            return bp_core_get_user_domain($user->ID );
        else
            return $redirect_to_calculated; /*if site admin*/
    }
        // Filter wp_nav_menu() to add profile link
        add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
        function my_nav_menu_profile_link($menu) {      
                if (!is_user_logged_in())
                        return $menu;
                else {
                        $profilelink = '<li><a href="' . bp_loggedin_user_domain( '/' ) . '" rel="nofollow">' . __('Profile') . '</a></li>';
                        $menu = $menu . $profilelink;
                        return $menu;
                 }
        }
    add_action('user_register', 'kleo_pmpro_default_level');
    function kleo_pmpro_default_level($user_id) {
        pmpro_changeMembershipLevel(1,$user_id);
    }
    // redirect to registration page instead of membership levels page
    add_filter('kleo_pmpro_url_redirect', 'my_custom_redirect');
    
    function my_custom_redirect() {
    	if (is_user_logged_in()) {
    		return pmpro_url("levels");
    	} else {
    		return bp_get_signup_page();
    	}
    }
    ?>
    #9998
     studiblog
    Participant

    ok i figured sth. out:
    i changed the .htaccess so that the site is redirected to https://
    now i changed the htaccess to default and tried with http:// unfortunately the membership restriction works only with http://
    how can i change this?
    i changed the .htaccess like this:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    # Redirect auf https://&#8230;, falls Port != 443
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
    # Redirect auf index.php, falls Path = /
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    # Redirect auf index.php, wenn Datei oder Verzeichnis nicht existiert
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    #10079
     Pat2013
    Participant

    I have the same problem with restrictions unfortunately. It would be great to know how to fix this.

    #10156
     Abe
    Keymaster

    Hi @studiblog,
    Please give us access to your ftp server to do some tests.
    Mark the reply as private

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

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #10157
     Abe
    Keymaster

    Hi @Pat2013, Your problem is related to HTTPS also?

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

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #10181
     studiblog
    Participant
    This reply has been set as private.
    #10205
     Pat2013
    Participant

    I have problems with memberships restrictions since i have https installed but i couldn’t find how to solve it. I don’t know if it’s related to https 100%, but it seems that it stopped working after installing ssl. It was the only change i did to the site.

    #10320
     Abe
    Keymaster

    Hello guys, please replace this file contents
    wp-content\themes\sweetdate\framework\helpers.php
    with this
    https://archived.seventhqueen.com/files/helpers.txt

    This was related to the port when using ssl being different that the wordpress configured link. All good now

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

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #10322
     Pat2013
    Participant

    Thanks a lot Abe. It’s working great!

    #10339
     studiblog
    Participant

    thank you so much

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?