Skip to:
Content
Pages
Categories
Search
Top
Bottom

Modifying Members AJAX Directory Search

  • Avatar of hatiro
    HaTiRo
    Participant

    @hatiro

    Hi,
    I’m upgrading to 1.6 and have been hit by AJAX… :( (not pleasant so far…).
    Whilst I can understand the flow of PHP, Mysql etc, this has me stumped.

    I need to restrict search terms to certain profile fields on the directory search.
    I managed this before by including a NOT IN statement in the search_users function in bp_core_classes.php
    Now that ajax_querystring seems to supercede this function where ajax is enabled, I’m at a loss to see how I can fulfil this objective.

    Does anyone know how to restrict searching in certain profile fields for member search terms in ajax?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of hatiro
    HaTiRo
    Participant

    @hatiro

    Coming at this from a different tack then.
    Does anyone know which function the Directory Search uses in order to accomplish the ajax querystring?

    Any pointers would be gratefully received.

    Avatar of hatiro
    HaTiRo
    Participant

    @hatiro

    OK found it! The Member Directory Search now passes values straight into the loop using ajax querystring, this gets its data from the main get_users function and doesn’t use the search_users function.

    Obviously I needed to modify the core to omit searching in certain profile fields by inserting ‘AND spd.field_id NOT IN (’2′,’3′)’ into the sql before the search terms, but I understand that as of BP1.7 this will be reworked into BP_USER_QUERY and so will need changing anyway…

    As an aside will the exclusion of searches for profile fields be doable in this new user_query? The reason is that if you are using any form of security/visibility on profile fields then you don’t want to be able to search on them. Currently, even if the profile fields are not visible it will return the user with that data in their field if the invisible data is used.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.