BuddyDev

Search

[Resolved] Using Member Type Generator with BP core widgets


  • Participant
    Level: Master
    Posts: 403
    calu on #24661

    Hi Brajesh, I look forward to that, thanks.

    I discovered an issue with the code above.

    If you have an option in the registration page for choosing not only your own gender, but also a field for choosing which gender you are looking for, the member list shows both genders.

    Is there a workaround for this?

    Regards
    Carsten


  • Participant
    Level: Master
    Posts: 403
    calu on #24662

    *if same gender is chosen in both fields


  • Keymaster
    (BuddyDev Team)
    Posts: 12862
    Brajesh Singh on #24663

    Hi Carsten,
    I am not sure what are the gender option on your registration page or how you have implemented genders.

    The above code works by following assumption:-

    1. Your site have some genders
    2. A gender is defined as a member type
    3. It assumes that you are able to assign user a gender member type. If no gender member type is assigned, no filtering will be done.

    Now, if you are somehow assigning multiple gender to a user or no gender to a user(member type), The above code may not work as expected.

    PS:- The code only deals with user listing with member type and has no understanding of how you add the gender member type to user. It does not/can not affect registration process.

    Regards
    Brajesh


  • Participant
    Level: Master
    Posts: 403
    calu on #24665
    This reply has been marked as private.

  • Keymaster
    (BuddyDev Team)
    Posts: 12862
    Brajesh Singh on #24666

    Hi Carsten,
    I am sorry but the screenshots does not help.

    Making the profile fields and call them gender is not going to have any effect on our code.

    If you want to utilize the above code you will need to create Genders as member type and then assign gender to users on registration(or in any other way). These genders must be ‘member type’.

    In your case, It seems gender is normal field which has no effect on listing.

    Regards
    Brajesh


  • Participant
    Level: Master
    Posts: 403
    calu on #24667

    Hi Brajesh, sorry for the misunderstanding, my main question was:

    If a profile is looking for another profile of the same gender, this code can’t be used.

    Regards
    Carsten


  • Participant
    Level: Master
    Posts: 403
    calu on #24669
    This reply has been marked as private.

  • Keymaster
    (BuddyDev Team)
    Posts: 12862
    Brajesh Singh on #24672

    Hi Carsten,

    Here is what you are doing. You are using 2 xprofile fields for gender. This method is inefficient for filtering the member list.

    here is an example on how to do that

    https://buddydev.com/support/forums/topic/conditionsprofile-field-if-i-am-a-women-i-search-man/page/5/#post-21684

    I suggested the member type code and route as that is more efficient way.

    Now, coming back to your other question. Profile fields and member types are different things and are associated differently. you can not exchange them in fetching list. You can put conditions for individual user’s display though.

    Regards
    Brajesh


  • Participant
    Level: Master
    Posts: 403
    calu on #24673
    This reply has been marked as private.

  • Keymaster
    (BuddyDev Team)
    Posts: 12862
    Brajesh Singh on #24680
    This reply has been marked as private.

You must be logged in to reply to this topic.

This topic is: resolved
Subscribe