Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • VentureCore
    Participant

    @manakio2k

    The main issue I’m (still) trying to solve is that when users upload avatars or backgrounds they are saved into directories under the uploads folder. That’s all fine and dandy until LargeFS, an awesome product by wpengine.com, pushes those images up to your AWS S3 bucket (and removes them from the server to allow for better unlimited storage). The only plugin that seems to have an issue with this is Buddypress. LargeFS intercepts the request for an image and if it’s not present in the folder on your server it retrieves and caches it from your S3 bucket and/or CDN.

    Buddypress just sees an empty folder and reverts everything to default.

    If I could find a way to store the background profile images outside of the uploads folder like you can with avatars; (see script in initial post) then all would be heavenly again. No searching or tweaking has delivered a solution yet.

    I’ve tried tweaking core files and writing a redirect a dozen different ways and ‘no joy’.

    So if you’re more brilliant than I am and I know most of you are, a solution would bring tears of joy to my eyes and I would bring her (buddypress) flowers and chocolates and stuff…


    VentureCore
    Participant

    @manakio2k

    Downgrading to 2.8.2 fixed this for me. WP is 4.8.1


    VentureCore
    Participant

    @manakio2k

    I’m having this problem on a brand new install. Multisite, single site activated.


    VentureCore
    Participant

    @manakio2k

    You have to add part of the code to the members loop and part of the code goes in your functions.php file. You also have to manually reorder the php to display/default alphabetical first in the dropdown menu


    VentureCore
    Participant

    @manakio2k

    You can see it working here… http://qr2.bz/3days
    Link will expire in 3days 🙂


    VentureCore
    Participant

    @manakio2k

    Question:

    This works with and without the semicolon after string in ‘before_members_loop’

    <?php do_action( 'bp_before_members_loop' ); ?>
    or
    <?php do_action( 'bp_before_members_loop' ) ?>

    Do you see either of these causing other problems or preventing other calls?


    VentureCore
    Participant

    @manakio2k

    OK, so here’s the solution…

    <?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter() */ ?>
    <?php do_action( 'bp_before_members_loop' ) ?>
    
    <?php
    if ( bp_ajax_querystring( 'members' ) ==""){
    $queryString = "type=alphabetical&action=alphabetical&page=1";}
    else {$queryString = bp_ajax_querystring( 'members' );}
    ?>
    
    <?php if ( bp_has_members( $queryString) ) : ?>

    Depending on how/if your theme developer has written their members-loop.php you will want to replace these two entries…

    <?php do_action( 'bp_before_members_loop' ); ?>
    
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>

    This not only gives you the ability to have buddypress default to listing names Alphabetically, it also maintains your ability to sort ‘Last Active’ and ‘Newest Registered’. This should be the default way to display the members directory. IMOP

    Now, if you want to then change the alphabetical listing default to return names by the lastname of your members you would add the following code to your theme’s function.php file. Preferably to the child theme’s function.php file.

    /** Sort alphabetical name listings by lastname */
    function alphabetize_by_last_name( $bp_user_query ) {
        if ( 'alphabetical' == $bp_user_query->query_vars['type'] )
            $bp_user_query->uid_clauses['orderby'] = "ORDER BY substring_index(u.display_name, ' ', -1)";
    }
    add_action ( 'bp_pre_user_query', 'alphabetize_by_last_name' );

    Good luck!


    VentureCore
    Participant

    @manakio2k

    Thank you,

    I tried that both in members-loop and now in index and neither work. It changes the order the list shows up in the dropdown but does not affect the default sort order.

    I had a solution but didn’t record it, it is either not working now or got overwritten through an update.

    Any other thoughts? 🙂


    VentureCore
    Participant

    @manakio2k

    Is there any hope someone might help me with this?


    VentureCore
    Participant

    @manakio2k

    Hello @hnla, @maaazkhan007 spammed my thread with a masked link too.


    VentureCore
    Participant

    @manakio2k

    Thank you @maaazkhan007, it’s very comforting to know there are spelling police monitoring the forums. I feel so much better now… or is really just your way of spamming the forums like a troll with your masked links?

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