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: 25480
    Brajesh Singh on in reply to: [Resolved] Moderation tools support for posts? #18226

    Thank you. I am looking forward to it.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: [Resolved] Make one page public on site #18225

    Hi Chris,
    Are you using any other code for redirect.

    The above code does not apply to logged in user.

    There is a code block that I have put at the top

    
    if ( is_user_logged_in() ) {
     return ;
    }
    

    It simply checks if a user is logged in and if they are, It won’t proceed. You may disable the code and check the same.

    I am not sure what is causing it but it is not the above code.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: How to sort Sitewide Gallery #18223
  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: [Resolved] How to sort Sitewide Gallery #18221

    Hi Fah Q,
    Please use ‘mpp_main_gallery_query_args’ filter for gallery. Also, by default, ‘order’ is set to ‘DESC’, you might want to set that to ‘ASC’

  • Keymaster
    (BuddyDev Team)
    Posts: 25480

    Hi Daria,

    Thank you for clarifying. Good to know that.

    You can use the following code in bp-custom.php or in your theme’s functions.php

    
    
    /**
     * Restrict members list by member type.
     *
     * @param array $args args.
     *
     * @return array
     */
    function buddydev_filter_by_opposite_member_type( $args ) {
    
    	//  No need to change members listing if the user is not logged in.
    	if ( ! is_user_logged_in() ) {
    		return $args;
    	}
    
    	// Map of visible member types based on the member type.
    	// 'male', 'female' are member type names.
    	$visible_types_map = array(
    		'male'   => 'female',
    		'female' => 'male',
    	);
    
    	$member_type = bp_get_member_type( get_current_user_id(), true );
    
    	// If the user does not have a member type
    	// or if the user does not need the restriction.
    	if ( empty( $member_type ) || empty( $visible_types_map[ $member_type ] ) ) {
    		return $args;
    	}
    
    	$args['member_type'] = $visible_types_map[ $member_type ];
    
    	return $args;
    
    }
    
    add_filter( 'bp_after_has_members_parse_args', 'buddydev_filter_by_opposite_member_type' );
    

    You may want to change the visible map based on the name of your member types.

    It maps member type of the current user to the member type whose users will be visible to them.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480

    Hi Kino,
    Thank you for posting.

    If you want to hide fields on registration page based on member type, my suggestion will be to use conditional profile field as the normal BuddyPress workflow does not allow it.

    You can set condition based on member type field(try using select dropdown member type field if you plan to go with this strategy).

    A better way is to move fields which are required but should be available based on member type out of the registration form. That is supported by BuddyPress out of the box.

    The problem with this approach is users may skip fields after registration. In past, we have shared code for it and I am planning to release a plugin that you can use to ask users to complete the required profile fields before being able to use the site.

    If you want to go with 2nd strategy, I can prioritise the release of this addon.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480

    Hi Daria,
    Thank you for purchasing the plugin. I am glad the multisite route is working.

    At the moment, exclusion can be enabled by code. If you want, I can post the code. I am also going to add the feature in the member types pro plugin in next 2-3 days(at most by the end of the day 26th October).
    If you need it today, please let me know and I will share the code.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: [Resolved] Moderation tools support for posts? #18208

    HI Richard,
    Thank you for the patience.

    Please upgrade to 1.0.7 and enable posts in General settings and then configure it under the posts panel.

    Please let me know how it goes?
    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480

    Hi Rudolf,
    I am sorry for the inconvenience. Here are the answers and some suggestions.

    Is it right that I have to change the member type of existing members manually and this would add them to the assigned group automatically?

    Yes.

    I wanted to test all the steps just to find out that the first step doesn’t work.

    I am sorry, can you please tell me the issue? Is it that you are unable to associate group with member types? If that is the case, can you please type a few letters and see it is suggesting?

    If it is not suggesting, There are two possible reasons. Does your site restricts access? It might be blocking the ajax call. Or do you have any kind of group filtering using code/plugin enabled?

    I tried to assign users to a member type on the all users page.
    It looked as if it was working but did not.

    What happened? After refresh, did you see the member type column having the member type or not? Are you on multisite or normal WordPress?

    Please remove the xprofile field if you don’t need it. It is only needed if you want to let users choose their member type.

    Yes, There are other ways to list users. I have a question though. Are you filtering your member list using any code or plugin?

    If you want, I can setup the plugin on the site for you and you can take it from there. In that case, I will need temporary access to the admin.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25480
    Brajesh Singh on in reply to: Code Snippet 'Add Xprofile fields to the member code' #18202

    Please share the contents of your theme’s members-loop.php on pastebin.

    Thank you