BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 886
    Tosin on in reply to: Restrict page access by member types #31726

    If a user who does not have member type access should try to access a member type restricted page, that user should either be shown a custom error message or be redirected to another page added in the member type setting.

    I think the redirection approach would be better.

    What are your thoughts

    thanks

  • Participant
    Level: Guru
    Posts: 886
    Tosin on in reply to: Restrict page access by member types #31725

    I think adding this feature to the member types pro plugin would be a much cleaner approach. This will make the member types pro much more extensive.

  • Participant
    Level: Guru
    Posts: 886

    Yes testing for letter avatar would be much appreciated

  • Participant
    Level: Guru
    Posts: 886

    Sorry for the confusion, I could not get the code to work and I actually would prefer using your plugin but I want all normal redirects to go to the sitewide activity page instead of the redirecting to profile so that’s the main reason I could not use your plugin https://buddydev.com/plugins/bp-redirect-to-profile/

    Is there a way to make your plugin redirect elsewhere instead of profile so maybe then you could help with applying your suggestion here https://buddydev.com/buddypress-tutorial-redirect-user-first-login/

    SO by using your plugin
    1. All FIRST LOGINS REDIRECT TO A WELCOME PAGE
    2. ALL SUBSEQUENT LOGINS REDIRECT TO SITE WIDE ACTIVITY PAGE

    In fact, this might be a better opportunity for you to create a more comprehensive and dynamic login redirect plugin which can also work in harmony with this plugin below without any login or redirect conflict.
    1. Buddypress member types pro
    2. BP Auto Login on Activation
    3. BuddyPress Auto Activate Autologin Redirect To Profile On Signup

    Thanks for your help

  • Participant
    Level: Guru
    Posts: 886

    OK thanks

    But can this be achieved using a simple code like this for login redirect

    
    function custom_login_redirect_to($user_login, $user) {
    	bp_core_redirect( get_option('siteurl') . "/profile/" );
    }
    add_action('wp_login', 'custom_login_redirect_to', 10, 2);
    

    I found this link https://buddydev.com/buddypress-tutorial-redirect-user-first-login/

    Thanks

  • Participant
    Level: Guru
    Posts: 886

    AWESOME!! Thanks Brajesh, More suggestions would be

    1. Adding a widget for who to follow like twitter
    2. option to set different criteria like author post count, author comment count(this would identify authors who are driving deep engagement through comment conversations), etc

    I really think this feature would drive engagement in any community as members would compete to get featured in the who to follow suggestion, which will encorage members to create more content since being listed would be based on post count.

    Thanks

  • Participant
    Level: Guru
    Posts: 886
    Tosin on in reply to: BuddyPress Auto Activate Auto Login Problem #30810

    I did not get a solution to this but I think the problem is related to Easy WP hosting because this problem started just after I migrated my site from siteground to Namecheap’s Easy WP

  • Participant
    Level: Guru
    Posts: 886
    Tosin on in reply to: BuddyPress public message shortcode. #30545

    I found a solution

     /**
     * BuddyPress public message shortcode.
     */
    function bp_public_message_shortcode() {	
    $username = bp_core_get_username( $user_id );
    $empty = '';
    
    if( is_user_logged_in() && bp_loggedin_user_id() != get_the_author_meta( 'ID' ) ) {
    	return '<a class="inner-msg" href=" '.wp_nonce_url( site_url() . '/news-feed/?r=' . $username ) .'  ">Shoutout To Author</a>';
     } 
    if( bp_loggedin_user_id() ) {
        return $empty;
     }
     else if( !is_user_logged_in() ) {
        return '<a class="outer-msg" href=" '.esc_url( wp_login_url()) .' ">Login to follow or message this author !</a>';
     }
    } 
    add_shortcode( 'bp_public_message_link', 'bp_public_message_shortcode' ); 
  • Participant
    Level: Guru
    Posts: 886
    Tosin on in reply to: BuddyPress public message shortcode. #30523

    Can you also add a css class to the link

  • Participant
    Level: Guru
    Posts: 886
    Tosin on in reply to: [Resolved] How to limit buddypress registrations #30309

    It worked perfectly now thanks a lot Ravi, im really gratefull