BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 19

    Hello Brajesh,

    Thank you very much!

    Initially, that worked for the most part. The BP Profile Search developer then made a change:

    * I changed 'set' to 'text' in "BuddyPress Xprofile Custom Field Types", file class-bp-profile-search-helper.php, line 77;

    Not that you need the following but she also wrote a snippet to convert that field’s list of checkboxes rendered in the search form to a multiselect dropdown:

    
    add_action ('bps_field_before_search_form', 'change_display');
    add_action ('bp_ps_field_before_search_form', 'change_display');
    function change_display ($f)
    {
    	if ($f->code == 'field_16' && $f->display == 'checkbox')	// field_16 is your Country field
    	{
    		$f->display = 'multiselectbox';
    	}
    }
    

    Thanks again,
    Quint

  • Participant
    Level: Initiated
    Posts: 19

    Hello Brajesh,

    Whatever you provide would be great. The validation step in BuddyBoss when editing the Profile, is after clicking the Save Changes button. If it fails, the error is noted at the top of the page and the field value is discarded.

    So, in this case since you recommended a text input field to capture the Lat/Long, the validation would check that it is not alphanumeric but numeric (containing only numbers and a decimal point) instead. I’m using Lat/Long as an example.

    Another example would be “performance rating” which would capture a floating point value to 4 decimal places which would then be used in a faceted search using a range facet, searching for members with a rating between x and y.

  • Participant
    Level: Initiated
    Posts: 19

    Hello Brajesh,

    That’s a valuable plugin. However, setting the field as numeric is not an option in the dropdown. Alphanumeric is and that won’t work when it will eventually be used in a faceted range search for members with a rating between x and y.

    Unless I’m missing something….

    Quint

  • Participant
    Level: Initiated
    Posts: 19

    Hello Brajesh,

    Thanks for the recommendation. At the moment, GEO my WP is producing a fatal error when I attempt to activate the plugin. Hopefully, it’s compatible with BuddyBoss and the Geo my WP support staff can resolve. It’s in their court.

    Anyway, I tried that decimal field with a step of .0001 since I need it for capturing performance ratings. It produces the same error. My preference is “number” since the validation rules would natively apply. However, if you know how I can add a filter to that/any Xprofile input field when a member attempts to submit the data, then that would work too since I could perform my own validation/etc.

    Quint

  • Participant
    Level: Initiated
    Posts: 19

    Hello Brajesh,

    Thanks for the info!

    Quint

  • Participant
    Level: Initiated
    Posts: 19

    Hello Brajesh,

    1. Sorry, I had meant to state in the earlier comment that I had deactivated the Youzify search plugin in favor of the one you support.

    2. Sounds great!

    Quint

  • Participant
    Level: Initiated
    Posts: 19

    This is what I’ve done thus far:

    1. Installed BP Profile Search plugin
    2. Added the following snippet in WPCodeBox (active everywhere):

    
    <?php 
    
    add_action ('bps_before_search_form', 'bps_enable_select2');
    add_action ('bp_ps_before_search_form', 'bps_enable_select2');
    function bps_enable_select2 ($F)
    {
    	wp_enqueue_script ('select2-js', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js', array ('jquery'));
    	wp_enqueue_style ('select2-css', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css');
    ?>
    	<script>
    		jQuery(function ($) {
    		//	$('.bps-selectbox select').select2({width: '10em', dropdownAutoWidth: true});
    			$('.bps-multiselectbox select').select2({width: '10em', dropdownAutoWidth: true});
    		});
    	</script>
    	
    <?php
    }
    

    3. Added a “search” form via the BP Profile Search plugin
    4. On that form, attempted to add my Country Select field (created in Profiles) but could not find it in the list. In the BuddyPress Xprofile Custom Field Types description, it specified that all the field types were compatible. Maybe not this one?
    5. If it were available on the list, then could it be used with Select2?

    Objective is to search for members in the Members Directory from multiple countries, at the very least.

  • Participant
    Level: Initiated
    Posts: 19

    Or would this be simpler using the BP Profile Search plugin which you referenced in the BuddyPress Xprofile Custom Field Types description? You probably have experience with both search plugin implementations.

  • Participant
    Level: Initiated
    Posts: 19

    Glad to be back!

    Item 1. Added the snippet. It works! Thanks!

    Item 2. Yes, I would like the metric conversion appended to the feet/inches value. I live in the States, so I really don’t know how you and ROW expresses their height in metric. Whatever makes sense to you or any user of the metric system is the format that should be used. Your call.

    Item3. Cool. I think that would be very helpful to every BuddyPress/BuddyBoss user.

    Probably in the next two or three days, I will submit a small project to you. I hope you can help.

    Cheers,

    Quint