New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Tiziano,

    Thank you for posting. You can use ‘action=new_blog_post’ in your shortcode to list only new blog post activity in your activity listing. Please let me know it works or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: How to change sub slugs in groups ? #28461

    Hello Bharat,

    Thank you for posting. But BuddyPress does not allow to change sub-groups like group-create, group-settings etc. BuddyPress takes them as an action and process request accordingly.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Restrict Activity Commenting by Member-type #27698

    Hello Keith,

    Thank you for the acknowledgement.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Restrict Activity Commenting by Member-type #27687

    Hello Keith,

    Thank you for posting. Try the following code it prevents student type user from comment and replying on other user’s activity.

    
    /**
     * Check weather user is restricted from commenting.
     *
     * @param int $user_id User id.
     *
     * @return bool
     */
    function buddydev_is_restricted_commenter( $user_id ) {
    	// Never restrict super admin from commenting.
    	if ( is_super_admin( $user_id ) ) {
    		return false;
    	}
    
    	return bp_has_member_type( get_current_user_id(), 'student' );
    }
    
    /**
     * Check user can comment or not.
     *
     * @param bool $can Bool.
     *
     * @return bool
     */
    function buddydev_user_can_comment( $can ) {
    	$activity = new BP_Activity_Activity( bp_get_activity_id() );
    
    	$user_id = get_current_user_id();
    
    	// Do not restrict for its own activity.
    	if ( $activity->user_id == $user_id ) {
    		return $can;
    	}
    
    	if ( buddydev_is_restricted_commenter( $user_id ) ) {
    		$can = false;
    	}
    
    	return $can;
    }
    add_filter( 'bp_activity_can_comment', 'buddydev_user_can_comment' );
    add_filter( 'bp_activity_can_comment_reply', 'buddydev_user_can_comment' );
    
    

    Please do let me know if it works or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: BP Private MSG for non logged in users #27472

    Hello Daniel,

    It seems you have a customize message url. Please replace the following code,

    
    $url =  bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . $user->user_login ;
    

    with

    
    $url =  trailingslashit( bp_loggedin_user_domain() ) . 'bp-messages/?new-message&fast=1&to=' . $user->user_login;
    

    Please let me know if it works or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: BP Private MSG for non logged in users #27465

    Hello Daniel,

    Thank you for posting. Please make sure the message component is enabled. If enabled and you still facing the issue. Please share a screenshot of the page.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Thank You for the acknowledgement. I am glad that I could help.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] BuddyPress Profile Completion for BuddyBoss #27353

    Hello,

    Sorry for the inconvenience. Please do let me know what issue you are facing in this plugin. Is it about the profile fields, avatar or covers or redirects?.

    Regards
    Ravi

    • This reply was modified 6 years, 10 months ago by Ravi.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello,

    Thank you for posting. It seems you are using Noveau template pack. Please try the following code.

    
    /**
     * Modify private message button args.
     *
     * @param array $buttons Array.
     *
     * @return array
     */
    function buddydev_nouveau_filter_private_message_button( $buttons ) {
    
    	if ( ! isset( $buttons['private_message'] ) || is_user_logged_in() ) {
    		return $buttons;
    	}
    
    	$buttons['private_message']['must_be_logged_in']   = false;
    	$buttons['private_message']['button_attr']['href'] = wp_login_url( site_url( '?message-redirect=' . bp_displayed_user_id() ) );
    
    	return $buttons;
    }
    
    add_filter( 'bp_nouveau_get_members_buttons', 'buddydev_nouveau_filter_private_message_button' );
    
    /**
     * Redirect to the send message when the user logs in
     *
     */
    function buddydev_redirect_to_send_message_on_login() {
    
    	//make sure it is our url set in previous step
    	if ( ! is_user_logged_in() || empty( $_GET['message-redirect'] ) ) {
    		return;
    	}
    
    	//redirect to PM
    	$user_id = absint( $_GET['message-redirect'] );
    	//let us make sure that user exists
    	$user = get_user_by('id', $user_id );
    	//can not PM to invalid user
    	//also you should not send message to yourself
    	if ( ! $user || $user->ID == bp_loggedin_user_id() ) {
    		return ;
    	}
    
    	$url =  bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . $user->user_login ;
    
    	bp_core_redirect( $url );
    }
    add_action( 'bp_template_redirect', 'buddydev_redirect_to_send_message_on_login' );
    
    

    Let me know if it works or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Finding BP mail notification language files #27348

    Hello Carsten,

    Thank you for the acknowledgement. I have tried to find ‘You have unread messages’ string into BuddyPress and It shows empty result. There might be chances that this is coming from other plugin.
    Please share a screenshot and let me know if there is other message regarding plugins you are using.

    Regards
    Ravi