Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • holdenandmason1
    Participant

    @holdenandmason1

    How do I make the sidebar show up?


    holdenandmason1
    Participant

    @holdenandmason1

    @dre1080, my post was about creating an advanced search page to search members based on the profile fields. Like the original poster said, “For example you could search for members, by age, location, hobby in one search (taking these things from created fields in profile.”

    You could use a Google search to do what you’re asking for.


    holdenandmason1
    Participant

    @holdenandmason1

    I was able to make an advanced search page by manipulating this line in bp-core-classes.php.

    $sql[‘where_searchterms’] = “AND pd.value LIKE ‘%%$search_terms%%'”;

    Example: Let’s say you have a profile field called “Location” whose field_id in the bp-xprofile-data table is 5, and you have a profile field called “Gender” whose field_id is 12. Then to search all females whose location start with “Los” you could replace that line above with:

    $sql[‘where_searchterms’] = “

    AND

    EXISTS (

    SELECT *

    FROM wp_bp_xprofile_data

    WHERE

    wp_bp_xprofile_data.value like ‘los%%’

    AND wp_bp_xprofile_data.field_id =5

    and wp_bp_xprofile_data.user_id=pd.user_id

    )

    AND

    EXISTS (

    SELECT *

    FROM wp_bp_xprofile_data

    WHERE

    wp_bp_xprofile_data.value = ‘FEMALE’

    AND wp_bp_xprofile_data.field =12

    and wp_bp_xprofile_data.user_id=pd.user_id

    )

    AND pd.field_id=1

    Of course, to make a fully functional advanced search page there’s a lot more than just that, but it demonstrates the basic idea. If anyone finds this helpful or wants an elaboration, let me know.

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar