andrea

Forum Replies Created

Viewing 14 posts - 421 through 434 (of 482 total)
  • Author
    Posts
  • in reply to: caching search results and "saved search" #3385
    andrea
    Keymaster

    Yes, I’d like to add caching for the search results, but I should also add the logic to invalidate the cache when a member is added/deleted, and when a member’s profile is changed. It’s easier said than done! Otherwise I could invalidate the cache after some elapsed time, but that means giving potentially inaccurate results to your users.

    I think I’ll simply add hooks to allow developers to add caching, and let the cache invalidation decisions to them. Of course if you have better suggestions, they are always welcome.

    By the way, you can let users bookmark their search results if you set the Form Method to GET. That does not mean caching, but could be convenient in some cases.

    And if you prefer to never have the search form cleared, you could remove the else part in bps_set_cookie().

    in reply to: Number Range Slider #3384
    andrea
    Keymaster

    That’s great! My goal is to make customizations simple, so if you have suggestions for improvements, I’m all ears!

    About your last question, BP Profile Search uses the bp_ajax_querystring filter to modify the include query arg, and as you may know that arg effectively trumps the internal members search, replacing its results with the include supplied values.

    If you wish to add filtering args to bp_has_members() you could use the technique I’m using in bps_filter_members().

    in reply to: custom profile fields #3383
    andrea
    Keymaster

    Hi Netsurfaces,

    I share your concerns about the search performance and scalability, and my plan is to allow developers to easily tweak the search procedure to address those concerns.

    For instance you could use the bps_request filter to reorder the request array, or to combine two or more fields to generate a single SQL query (delete those fields from the request array, and add a fictitious field type to generate the combined SQL query with the following bps_field_query filter).

    I think that the above procedure allows you to implement all your three points.

    For more radical optimization, you could replace the whole bps_search() function. In the next BP Profile Search 4.3 version I’ll try to simplify the search manipulation for developers, so if you have more suggestions they are very welcome.

    in reply to: custom profile fields #3368
    andrea
    Keymaster

    Hi Benjamin,

    Unfortunately that page has not yet been updated for BP Profile Search 4.2, please see the note I’ve now added to the top of the page.

    For your zip code field, probably you don’t need to create a new custom field type. You could use the bps_field_query_type filter to fictitiously change the field type on the fly, and then use the bps_field_query filter to return your search results.

    in reply to: Number Range Slider #3361
    andrea
    Keymaster

    Hi Netsurfaces,

    As you noted, it’s better to add any new or modified templates to your theme. You have to create a directory buddypress/members in your theme directory, and put your templates there.

    Of course you can also modify the query for a field. Besides the bps_field_sql filter you mentioned, you can also have a look at the bps_field_query filter. If you have questions or suggestions on the query filtering, please let me know!

    in reply to: Number Range Slider #3357
    andrea
    Keymaster

    Hello Netsurfaces,

    That beta has been released already, and it is BP Profile Search version 4.2. Please give it a try and let me know if you have questions or suggestions.

    in reply to: add function to select id #3299
    andrea
    Keymaster

    That’s great, thanks for your testing! I’m going to release that new version soon.

    in reply to: add function to select id #3292
    andrea
    Keymaster

    I’ve just sent it, and I’m waiting for your feedback!

    in reply to: add function to select id #3288
    andrea
    Keymaster

    Hi Joey,

    The next plugin version will allow users to easily customize the form template, and that will be perfect if you wish to add onchange to a select, or otherwise customize your search form in many ways.

    If you wish I can send you a beta version, so you can start playing with it.

    in reply to: Customising the members loop and using this plugin #3287
    andrea
    Keymaster

    Yes, exactly.

    in reply to: Number Range Slider #3280
    andrea
    Keymaster

    Hi Daniel,

    Unfortunately you have to edit the plugin files in the current version. The next version will allow users to easily modify the form template, and that will offer a perfect solution to your need.

    If you feel adventurous, I can send you a beta of the next version so you can start developing your own form template.

    in reply to: Customising the members loop and using this plugin #3279
    andrea
    Keymaster

    I’m glad to hear you made it work!

    The general idea of my code snippet was the same, but your implementation is simpler and better yet, it works! I only suggest you add this as the first line in your function:

    if ($object != 'members')  return $query_string;
    
    in reply to: Customising the members loop and using this plugin #3275
    andrea
    Keymaster

    You can add this code in your theme functions.php or in bp-custom.php:

    add_action ('bp_ajax_querystring', 'expert_inclusion', 10, 2);
    function expert_inclusion ($qs=false, $object=false)
    {
    	if ($object != 'members')  return $qs;
    
    	$args = wp_parse_args ($qs);
    	$users = explode (',', include_experts ());
    
    	if (isset ($args['include']))
    	{
    		$included = explode (',', $args['include']);
    		$users = array_intersect ($users, $included);
    		if (count ($users) == 0)  $users = array (0);
    	}
    
    	$args['include'] = implode (',', $users);
    	$qs = build_query ($args);
    
    	return $qs;
    }
    
    in reply to: Customizations #3273
    andrea
    Keymaster

    Hi Maria,

    I’ve answered your email now, sorry for the delay!

Viewing 14 posts - 421 through 434 (of 482 total)