BuddyDev

Search

Replies

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: Code Snippet 'Add Xprofile fields to the member code' #18005

    Hi Brajesh, it is the code from BuddyDevs own Code Snippet directory by bphelp:

    Add Xprofile fields to the members directory
    PHP
    // Here is one way you could add xprofile fields name as well as the value to the members directory!
    // Just remember to replace “Field-Name” with the names of your fields in the 5 variables in my code.
    // Also remember the field name is case sensitive. If you notice the pattern of 5 in my code you can
    // easily see how to add more fields if you need them. You can also use the div class bph_xprofile_fields
    // to adjust the CSS in your stylesheet. Place this code in bp-custom.php:
    add_action(‘bp_directory_members_item’, ‘bphelp_dpioml’);
    function bphelp_dpioml(){
    $bphelp_my_profile_field_1=’Field-Name’;
    $bphelp_my_profile_field_2=’Field-Name’;
    $bphelp_my_profile_field_3=’Field-Name’;
    $bphelp_my_profile_field_4=’Field-Name’;
    $bphelp_my_profile_field_5=’Field-Name’;
    if( is_user_logged_in() && bp_is_members_component() ) { ?>
    <div class=”bph_xprofile_fields” style=” margin-left: 25%;”>
    <?php echo $bphelp_my_profile_field_1 ?>: <?php echo bp_member_profile_data( ‘field=’.$bphelp_my_profile_field_1 ); ?><br />
    <?php echo $bphelp_my_profile_field_2 ?>: <?php echo bp_member_profile_data( ‘field=’.$bphelp_my_profile_field_2 ); ?><br />
    <?php echo $bphelp_my_profile_field_3 ?>: <?php echo bp_member_profile_data( ‘field=’.$bphelp_my_profile_field_3 ); ?><br />
    <?php echo $bphelp_my_profile_field_4 ?>: <?php echo bp_member_profile_data( ‘field=’.$bphelp_my_profile_field_4 ); ?><br />
    <?php echo $bphelp_my_profile_field_5 ?>: <?php echo bp_member_profile_data( ‘field=’.$bphelp_my_profile_field_5 ); ?><br />
    </div><?php
    }
    }

  • Participant
    Level: Yogi
    Posts: 1117

    Yes, it must be some conflict with something else, which affects the photo crop to look like this, https://imgur.com/a/mCpycby, even with all plugins deactivated, except BP and Friends Suggest.

    Thanks again.

    You wrote: ‘About filtering based on Gender, I will suggest using member types for the gender. If you do that, It can be very easily and efficiently achieved.’

    Can you describe this a little further, what you mean?

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    Did you test it with Jetpack installed and Lazy Loading enabled?

    Bottom line is that Jetpack’s Lazy Loading makes the crop tool disappear, and with BuddyPress Friends Suggest widget, this
    https://imgur.com/a/mCpycby

    But thank’s for the effort, I can live without the Friends Suggests, but I am glad I located the crop issue I have had for a long time created by Jetpack, on my page at least.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    The problem with the crop tool is created by Jetpack> Enable Lazy Loading for images

    with this disabled and BuddyPress Friends Suggest inactive the crop tool is working normal:

    https://imgur.com/a/me70Tho

    With BuddyPress Friends Suggest active:

    https://imgur.com/a/X47w49k

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    It’s Jetpack. When Jetpack is installed with default installation, and BuddyPress Friends Suggest widget is in place, the profile avatars are gone, and the change profile photo crop image tool is messed up.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    Sorry, here is the screenshot with the BuddyPress Friends Suggest widget removed

    https://imgur.com/a/53Psf1T

  • Participant
    Level: Yogi
    Posts: 1117

    Strange thing is going one in BuddyPress.

    This is the crop profile photo with BuddyPress Friends Suggest widget in sidebar:

    https://imgur.com/a/0SaKgsZ

    This is with the widget removed, notice the little dot, which is the crop tool.
    This issue has been going one for a while, topics in the BuddyPress support forum, reveals that others have experienced this problem, but no clear solution to the problem has come up.

    https://imgur.com/a/0SaKgsZ

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    I have come this issue closer, and the issue is not theme dependent.

    The issue occurs, on both themes, not when the plugin is activated, but when the widget is placed in sidebar or footer.

    I have disabled all plugins, activating them one by one, without finding a plugin causing the problem.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    Hi again, I have located the issue, which is not caused by a conflict with another plugin.

    The hidden avatars and other images in a gallery, is caused by a conflict when using BuddyPress Friends Suggest while running the GeneratePress theme.
    Changing to Twenty Seventeen resolves the problem.

    Would you please make the test while running the GeneratePress theme?

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    This reply has been marked as private.