Skip to:
Content
Pages
Categories
Search
Top
Bottom

Sorting Private Message Threads

  • Avatar of colabsadmin
    colabsadmin
    Participant

    @colabsadmin

    Is there a way to sort the content (threads) in individual private messages? Some of my members are complaining about having to scroll to the bottom of a page to see the latest thread within a long message.

    If I display newest thread first, they wont have to scroll down. I’ll also have to move the reply box to the top, but I think I can figure that out.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of colabsadmin
    colabsadmin
    Participant

    @colabsadmin

    I was able to do this by editing

    plugins/bp-messages/bp-messages/bp-messages-classes.php LINE 83

    date_sent” . $order,

    to

    date_sent DESC”,

    —————

    I tried copying the file to my child theme so it wont break when I update BP. It didn’t work. Is it even possible to do this with that file?

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    You can’t override core files.

    Undo the changes you made to /bp-messages-classes.php

    Copy
    bp-templates\bp-legacy\buddypress\members\single\messages\single.php
    to your child theme so that the dir structure looks like this:
    your-theme\buddypress\members\single\messages\single.php

    Then in single.php, change
    if ( bp_thread_has_messages() ) :
    to

    <?php  
    	$args = array(
    	   'order'     => 'DESC'
    	);
    if ( bp_thread_has_messages( $args ) ) : ?>
    Avatar of colabsadmin
    colabsadmin
    Participant

    @colabsadmin

    Thank you! Works great.

    The only issue I’ve noticed is now in my message list, the subject field shows a “Re:” for every time its been replied to. Before this change, it only showed one.

    Avatar of colabsadmin
    colabsadmin
    Participant

    @colabsadmin

    So, I suppose what’s going on is that its also sorting the threads for each message for the inbox too and using the subject from the last thread. How can I isolate this so it only sorts it DESC when you’re view the message and not in your inbox?

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

You must be logged in to reply to this topic.