Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25285
    Brajesh Singh on in reply to: Moving Buddypress activity sub nav #10889

    Hi Taiwo,
    My apologies for the delayed reply.

    It seems you want to add those links to WordPress custom menu? If it is not, you should link to the user’s profile pages(user/activity/mention etc) instead of the directory links. Directory links behave differently and need js triggers to work(or cookies etc).

    Please let me know if it is a WpordPress custom menu and I may be able to provide some code.

  • Keymaster
    (BuddyDev Team)
    Posts: 25285

    Hi Margrita,
    Please put this in your bp-custom.php

    
    
    /**
     * Filter on the gallery creation permission.
     *
     * @param bool   $can can create.
     * @param string $component component name.
     * @param string $component_id component id.
     *
     * @return bool
     */
    function mpp_custom_limit_gallery_creation( $can, $component, $component_id ) {
    	// non logged in user's don't have permissions and admin's don't have restrictions.
    	if ( ! is_user_logged_in() || is_super_admin() ) {
    		return $can;
    	}
    
    	$user_id = get_current_user_id();
    
    	// How many galleries?
    	$allowed_gallery_count = 1; // 0 = no restriction.
    
    	if ( ! $allowed_gallery_count ) {
    		// No restrictions when someone sets it to zero zero.
    		return $can;
    	}
    	// only limit if crossed the limit.
    	if ( mpp_get_user_gallery_count( $user_id ) >= $allowed_gallery_count ) {
    		$can = false;
    	}
    
    	return $can;
    }
    add_filter( 'mpp_user_can_create_gallery', 'mpp_custom_limit_gallery_creation', 10, 3 );
    
    /**
     * Filter on the media upload permission.
     *
     * @param bool        $can can create.
     * @param string      $component component name.
     * @param string      $component_id component id.
     * @param MPP_Gallery $gallery gallery object.
     *
     * @return bool
     */
    function mpp_custom_limit_media_upload( $can, $component, $component_id, $gallery ) {
    
    	// non logged in user's don't have permissions and admin's don't have restrictions.
    	if ( ! is_user_logged_in() || is_super_admin() ) {
    		return $can;
    	}
    
    	$user_id = get_current_user_id();
    	// How Many media is allowed?
    	$allowed_media_count = 2; // 0 = no limit.
    
    	if ( ! $allowed_media_count ) {
    		// No restrictions when zero.
    		return $can;
    	}
    	// only limit if crossed the limit.
    	if ( mpp_get_user_media_count( $user_id ) >= $allowed_media_count ) {
    		$can = false;
    	}
    
    	return $can;
    }
    add_filter( 'mpp_user_can_upload', 'mpp_custom_limit_media_upload', 10, 4 );
    
    

    That will do it. It will only work for MediaPress 1.2.0 or above.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25285
    Brajesh Singh on in reply to: Error when activating Buddyblog #10887

    Hi Aldo,
    Please allow me a day to check this plugin. I haven’t personally tested it recently. Will give it a try and then get back to you.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25285

    Hi Alexandre,
    Please try hooking to ‘init’ section and it should work.

    Here is your code with init action

    
    
    add_action( 'init', 'remove_admin_bar_user', 10001 );
    function remove_admin_bar_user() {
    
    	if ( current_user_can( 'administrator' ) || is_admin() ) {
    
    		show_admin_bar( true );
    	} else {
    		show_admin_bar( false );
    	}
    }
    
    

    Does it work?

    • This reply was modified 8 years, 4 months ago by Brajesh Singh. Reason: Updated privacy to normal
    • This reply was modified 8 years, 4 months ago by Brajesh Singh. Reason: Updated priority to normal
  • Keymaster
    (BuddyDev Team)
    Posts: 25285
    Brajesh Singh on in reply to: "BuddyPress Deactivate Account" email notification #10883

    Marking it as resolved since it is fixed from our end. Also 1.10 of the plugin is available which ads a ton of extra features.

  • Keymaster
    (BuddyDev Team)
    Posts: 25285
    Brajesh Singh on in reply to: Community builder costumizer #10882

    Hi Branislav,
    Thank yyou.

    I will make sure to let you know.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25285

    Thank you Shashi.
    We are looking at it and will keep you informed.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25285
    Brajesh Singh on in reply to: [Resolved] Privacy issue in comments #10880

    Hi Tiziano,
    My apologies.

    It’s the way WordPress handles comment. There are two ways.

    1. Completely disable email to post authors

    
    add_filter( 'notify_post_author', '__return_false' );
    
    

    That is a bad way.

    2. Filtering on ‘comment_notification_text’ like this

    
    
    function buddydev_strip_commenter_email( $message, $comment_id ) {
    
    	$comment = get_comment( $comment_id );
    
    	$email_info = sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
    
    	$message = str_replace( $email_info, '', $message );
    
    	return $message;
    }
    
    add_filter( 'comment_notification_text', 'buddydev_strip_commenter_email', 10, 2 );
    
    

    The second option may work or may not work. It depends on the kind of setup you have.

    Please give that a try and let me know.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25285

    Hi Kuni,
    Thank you.

    If you pass type=”newest” it will list the list ordered by user id in the reverse order.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25285

    Hi Kuni,
    The member type shortcode supports only the order by filter supported by BuddyPress.

    BuddyPress does not support ordering by xprofile yet. So, It is almost not feasible for now to do it.