Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 3,276 through 3,300 (of 3,820 total)
  • @shanebp

    Moderator

    Visibility checks are not done when profile data is retrieved ‘outside’ BP_XProfile_Group.

    You can use bp_xprofile_get_hidden_fields_for_user() to do your own check.

    It is reasonable to expect bp_member_profile_data() to include an argument re visibility check.

    So it’s not a bug, but you can create an enhancement request ticket on trac.

    @shanebp

    Moderator

    I can see why you’d look at bp-core-avatars functions.

    But have you tried just replacing the avatar calls in templates with your own function?

    You’ll have to hunt down the calls in several templates, but probably easier than messing with core-avatar filters given that you don’t want anything from bp avatar code anyway.

    Try it in something like the members loop first:

    Members Loop

    Of course, in your theme, create an over-ride of the members-loop template first.

    @shanebp

    Moderator

    This:
    add_filter('friends_notification_new_request_message' , 'my_bp_friends_notification_new_request_message' , 110 , 2);

    Should be:
    add_filter('friends_notification_new_request_message' , 'my_bp_friends_notification_new_request_message', 110, 5);

    5 is the number of arguments you are passing, not 2.

    @shanebp

    Moderator

    @zintax

    Instead of writing new queries to manipulate data after the main user query has run, use this filter to make your adjustments before the main query:
    bp_pre_user_query_construct in bp-core-classes.php

    And run it via a conditional based on the page being viewed.
    Then your pagination data will be what you want.

    @shanebp

    Moderator

    Thanks for sharing your fix.
    To suggest a change to core code, please use
    https://buddypress.trac.wordpress.org/
    to submit a ticket re a bug or enhancement.

    The core devs will definitely see it there.

    @shanebp

    Moderator

    @henrywright-1

    Don’t initialize $i as a string if you’re going to use it as an integer.

    if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) {
        $i = 0;
        foreach ( $items as $item ) { ?>
            <div id="size-<?php echo ++$i; ?>">
            <?php echo $item; ?>
            </div>
        <?php }
    }
    In reply to: activity stream gone

    @shanebp

    Moderator

    I always use the files from
    /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress

    And would put them in:
    /wp-content/themes/BuddyEnglish/buddypress/

    @shanebp

    Moderator

    try:
    echo bp_core_get_username( bp_get_member_user_id() );

    In reply to: Search for user role

    @shanebp

    Moderator

    @henrywright-1
    I’ve never done it, but don’t see why you couldn’t do that.

    In reply to: Search for user role

    @shanebp

    Moderator

    ?s=band will only search within Post and Page content.
    If you want to search by user role, you will need a custom search function.

    And your 404 means you don’t have a basic search page set up.
    https://codex.wordpress.org/Creating_a_Search_Page

    @shanebp

    Moderator

    You could explode to an array and then loop thru it.

    But the default is to return an array, so just remove this
    $multi_format = 'comma'

    Then use a foreach loop to generate some markup that uses br or li tags.

    @shanebp

    Moderator

    Yes the plugin will use a lot of resources, in the form of spikes.

    A lot depends on the amount of resources you have available.

    From what you’ve written, it seems that the ‘load’ would come from creating matches based on the questionnaire, not from the actual questionnaire. So storing those answers in another database probably may not help much. And you don’t state whether you’re saving match data.

    If you want real-time matching based on interaction with a questionaire, then the only way to find out re performance is to write something and load test it.

    You’ll probably find that waiting until a user has completed the questionaire or even a page of it – and then providing matches will be more feasible on a setup with fewer resources.

    Good luck.

    @shanebp

    Moderator

    Your question is not simple 🙂

    re First: I don’t think a webservice will reduce the load

    re Second: each request does Not require reloading WP

    Since you’re generating and processing the requests ‘locally’, using a webservice might slow things down, depending on the setup of your servers.

    This is different from what you’re doing, but might be helpful:
    For member searching, some clients want to include radial results based on zip codes.
    So I create a separate database for zip data and do the processing outside WP and then return the results ( zips within the radius) for further processing within WP ( find matching zips).
    It’s fast and easy to maintain.

    @shanebp

    Moderator

    @kvschwartz

    For option a) , put this:

    define( 'BP_DEFAULT_COMPONENT', 'profile' );

    in your bp-custom.php file.

    @shanebp

    Moderator

    You could use this or study it to write your own:
    https://wordpress.org/plugins/bp-profile-search/

    @shanebp

    Moderator

    @shanebp

    Moderator

    In members/index.php, you will see this:
    <?php bp_get_template_part( 'members/members-loop' ); ?>

    Either create your own template and call it there.
    Or adjust the members/members-loop.php file.

    Since you are using a child theme, probably easiest to go with the adjust-file approach.

    Based on what you’re doing, there is no need to change members/index.php

    @shanebp

    Moderator

    Re your rebuild of the ajax_querystring…
    It’s even better to remove yourself before that query is constructed.
    Take a look at this hook: bp_pre_user_query_construct

    Re remove group admin from loop…
    That’s a tough one.
    I recall not being able to do that or that the consequences were too ugly or some fail.
    This is kinda of clunky – but sometimes I create a dummy user for use in those situations.
    And make it clear in that profile that you aren’t a member of _____.
    It gives you a ‘mask’ to wear and makes it easier to compartmentalize friend requests, etc.

    In reply to: Database Schema map

    @shanebp

    Moderator

    @xkronik13x
    Thanks much for the map.
    Do you know when it was generated ?
    Or the BP version used ?

    @shanebp

    Moderator

    Please add the patch to the ticket so that core devs can decide if they want it.

    @shanebp

    Moderator

    @henrywright-1 Solve that one !

    @shanebp

    Moderator

    @bphelp Thanks for the pointer.

    @buddhatunes Thanks for the purchase. Looks good on your site.

    @shanebp

    Moderator

    >This would be something different than their username.

    You mean different than their user_id ?

    You can create anything you like, such as integer assigned to a user.
    How you create it, where you store it and how you use it will require knowledge of WP, BP, php and mysql.

    @shanebp

    Moderator

    @r-a-y
    Any reason not to use bp_xprofile_get_hidden_fields_for_user() ?

    @shanebp

    Moderator

    It’s already an array. No need to turn it into an array. And that not how to create an array anyways.

    Try:

    <?php
    global $wpdb;
    $db_query = "SELECT user_id FROM wp_bp_xprofile_data WHERE field_id = 13 AND value = 'Yes'";
    $match_ids = $wpdb->get_col($db_query);
    ?>
    <?php if ( bp_has_members( $match_ids ) ) : ?>

    If that doesn’t work, try:

    $members_imploded = 'include=' . implode(",", $match_ids);
    <?php if ( bp_has_members( $members_imploded ) ) : ?>
Viewing 25 replies - 3,276 through 3,300 (of 3,820 total)
Skip to toolbar