andrea

Forum Replies Created

Viewing 14 posts - 1 through 14 (of 498 total)
  • Author
    Posts
  • in reply to: bps and qtranslate-xt #10838
    andrea
    Keymaster

    Hi Georgio,

    Thank you for your report and your suggestion!

    I’m going to release a BP Profile Search update, hopefully before the end of July, to add support for qTranslate-XT.

    in reply to: Search by Gender #10834
    andrea
    Keymaster

    Hi Ray,

    If you wish I can take a look at your test site, but I’ll need a WP admin access.

    If that’s OK with you, you can share it privately using my Contact page.

    andrea
    Keymaster

    Yes, you can use my Contact page to share information privately.

    andrea
    Keymaster

    Hi Michael,

    You can go to Customize -> Additional CSS and enter these lines:

    #buddypress span.activity {
    	display: block;
    }

    Please let me know if it works for you!

    in reply to: Filter bp_has_members with bp_ajax_querystring #10825
    andrea
    Keymaster

    Yes, you can share your info privately using my Contact page.

    in reply to: Filter bp_has_members with bp_ajax_querystring #10823
    andrea
    Keymaster

    Great! I’m glad we were able to find a working solution.

    in reply to: Filter bp_has_members with bp_ajax_querystring #10821
    andrea
    Keymaster

    The complete code is as follows:

    add_filter ('bps_field_sql', 'change_query', 10, 2);
    function change_query ($sql, $f)
    {
    // code for the company name fields
    	if ($f->code == 'field_89')  $sql['where']['field_id'] = 'field_id IN (89, 163, 164)';
    
    // add similar code for the other fields
    	if ($f->code == 'field_103')  $sql['where']['field_id'] = 'field_id IN (103, 180, 192)';
    	if ($f->code == 'field_94')  $sql['where']['field_id'] = 'field_id IN (94, 165, 184)';
    	return $sql;
    }

    Please let me know if it works as expected!

    in reply to: Filter bp_has_members with bp_ajax_querystring #10819
    andrea
    Keymaster

    Ok, I need all your field IDs so I can write the correct code for you.

    Field IDs of Company Name 1, 2 and 3: 89, 163, 164 (we already know them)
    Field IDs of City 1, 2 and 3: please provide them in the correct order
    Field IDs of Activity 1, 2 and 3: please provide them in the correct order

    in reply to: Filter bp_has_members with bp_ajax_querystring #10817
    andrea
    Keymaster

    Hi cobe,

    Just to make sure I understand your needs: You have the search form shown in your screenshot1, and when users search for City, Activity or Company Name you wish to search the three City, Activity or Company Name fields in your three field groups.

    Is that correct? If so, that should work fine at the moment, but only for the Company Name field. Can you confirm?

    in reply to: Filter bp_has_members with bp_ajax_querystring #10783
    andrea
    Keymaster

    Sorry, I forgot the last line:

    ...
    ...
    // add similar code for the other fields
    	return $sql;
    }
    in reply to: Filter bp_has_members with bp_ajax_querystring #10780
    andrea
    Keymaster

    Hi cobe,

    I suggest you copy my code above, and carefully replace each of my sample field IDs with your actual field ID.

    The logic in the code is:

    // 89 = Field id of company name 1
    // 163 = Field id of company name 2
    // 164 = Field id of company name 3
    
    // if searching for company name 1, search for all the company name fields at the same time
    
    add_filter ('bps_field_sql', 'change_query', 10, 2);
    function change_query ($sql, $f)
    {
    // code for the company name fields
    	if ($f->code == 'field_89')  $sql['where']['field_id'] = 'field_id IN (89, 163, 164)';
    
    // add similar code for the other fields
    }
    in reply to: Exclude site admin #10775
    andrea
    Keymaster

    Great, I’m glad if I’ve been of help!

    in reply to: Filter bp_has_members with bp_ajax_querystring #10774
    andrea
    Keymaster

    Start building your search form using only the first set of fields, i.e. company1, name company1, phone company1.

    Then note the field IDs of your fields, for instance:

    IDs of company1, name company1, phone company1: 12, 14, 16
    IDs of company2, name company2, phone company2: 22, 24, 26
    IDs of company3, name company3, phone company3: 32, 34, 36

    and add this code to your bp-custom.php file:

    add_filter ('bps_field_sql', 'change_query', 10, 2);
    function change_query ($sql, $f)
    {
    	if ($f->code == 'field_12')  $sql['where']['field_id'] = 'field_id IN (12, 22, 32)';
    	if ($f->code == 'field_14')  $sql['where']['field_id'] = 'field_id IN (14, 24, 34)';
    	if ($f->code == 'field_16')  $sql['where']['field_id'] = 'field_id IN (16, 26, 36)';
    	return $sql;
    }

    Please let me know if it works for you!

    in reply to: Exclude site admin #10772
    andrea
    Keymaster

    You can add this code to your bp-custom.php file:

    add_filter ('bp_ajax_querystring', 'exclude_user1', 20, 2);
    function exclude_user1 ($qs, $object)
    {
    	if ($object != 'members')  return $qs;
    
    	$args = wp_parse_args ($qs);
    
    	if (empty ($args['exclude']))
    		$args['exclude'] = '1';
    	else
    		$args['exclude'] .= ',1';
    
    	$qs = build_query ($args);
    	return $qs;
    }

    Please let me know if it works for you!

Viewing 14 posts - 1 through 14 (of 498 total)