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: 25275
    Brajesh Singh on in reply to: [Resolved] Limit the searching range of members #8214

    Hi Dandy,
    It is doable but i will need the following info:-

    1. How do you determine if a logged in user is a student?
    2. Can a student be part of multiple groups or just one group?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: The stealth mode is only active for one Admin #8213
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: [Resolved] Mailchimp list #8212

    Hi Nana,
    Thank you for reporting.
    I will test and get back to you a little late today.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: Mediapress Gallery and Medias Pagination #8211

    Hi Carl,
    Thank you for posting.

    You can easily create a load more or infinite scroll behaviour using the MPP_Media_Query
    https://buddydev.com/mediapress/topics/api-reference/core/mpp_media_query/

    Also, we do plan to add this as a standard feature sometime in future.

    PS: Thank you for letting me know about the demo. The issue was cropping up dues to the way WordPress behaves with mysql strict mode. we have it fixed now.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: Light Gallery… #8210

    Hi Chris,
    I did test the plugins today with WordPress 4.7.3 and it is not giving any error. I am sorry but I am not in a position to help you troubleshoot.
    Also, i will appreciate if next time you will warn that the site is NSFW.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: [Resolved] Conditional Profile Fields #8209

    Hi Dennis,
    Here is the example

    
    
    function buddydev_validate_field_dennis() {
    
    	$field_1 = 12;//the first field which has two options
    	//since field one is required, we don't validate if it is not present, Bp will take care of it
    	if ( ! isset( $_POST[ $field_1 ] ) ) {
    		return;
    	}
    
    	$value = $_POST[ $field_1 ];////make sure to escape it , I don't know expected type, so have left it.
    
    	//if we are here, one of the option has been selected, so
    
    	$bp = buddypress();
    
    	if ( $value == 'a' ) {
    		//check if question 2( assume field id 13) is present
    		if ( empty( $_POST['field_13'] ) ) {
    			$bp->signup->errors['field_13'] = 'This is a required field, you should not askip it';
    		}
    
    	} elseif ( $value == 'b' ) {
    
    		//in this case, field_14, field_15, field_16 is required
    		$required_fields = array( 14, 15, 16 );
    		foreach ( $required_fields as $field_id ) {
    			if ( empty( $_POST[ 'field_' . $field_id ] ) ) {
    				$bp->signup->errors[ 'field_' . $field_id ] = 'Required field.';
    			}
    
    		}
    
    	} else {
    		//not of the allowed value
    		$bp->signup->errors[ $field_1 ] = 'Please make sure to use a valid value.';
    	}
    }
    
    add_action('bp_signup_validate', 'buddydev_validate_field_dennis' );
    
    

    You will need to update the field ids and the value of the first field( ‘a’, ‘b’ with actual values)

    I hope you can take it from there.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Hi Chris,
    I am sorry but that is not feasible.

    Will it work for you if we released a Media Moderation addon that currently allows admins to let other users report a media and a media with a given threshold of reporting gets hidden till admin moderates it? It’s a premium addon btw.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Hi Scott,
    Thank you for posting.
    I am not sure how to get the information on what page the user was before registration but I will help you with some example snippet that you may extend to work.

    
    /**
     * Filter where to redirect the user after account activation
     *
     * @param string $redirect_url user's profile url
     * @param int $user_id numeric user id
     *
     * @return string
     */
    function buddydev_filter_auto_redirect_url( $redirect_url, $user_id ) {
    
    	// You can filter the redirection based on user
    	// or you can change the $redirect_url to the appropriate value.
    // I suggest using the user_id for filtering approach
    
    	//$redirect_url = wp_get_referer(); //it will not work
    
    	return $redirect_url;
    
    }
    add_filter( 'bpdev_autoactivate_redirect_url', 'buddydev_filter_auto_redirect_url', 10, 2 );
    
    

    You can put this code in your bp-custom.php and modify it to work as per your requirements.

    Hope that helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Hi LuXman,
    thank you for asking. It is a simple process consisting of two steps.
    Step 1: – Enable loading of js on the form page
    Please see this line
    https://github.com/sbrajesh/bpdev-username-availability-checker/blob/master/username-availability-checker.php#L169

    You can filter on ‘buddydev_username_availability_checker_load_assets’ and return tru for the page where you want it to be loaded.

    Step 2:- Tell the availability checker about your username field selector.
    Please see this
    https://github.com/sbrajesh/bpdev-username-availability-checker/blob/master/username-availability-checker.php#L130

    That’s all needed.
    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Thank you George. Glad it did 🙂