Skip to:
Content
Pages
Categories
Search
Top
Bottom

Private Message Thread – Reply-Box on Top


  • Marvin_Klempert
    Participant

    @marvin_klempert

    Hello,

    I changed the message-order in my message threads from Ascending to Descending. Now the newest messages are visible at first. But now I still have the reply-composing box at the bottom. How can I get that on top?

    My code of the “buddypress/bp-messages/classes/class-bp-messages-thread.php” is visible here:
    http://pastebin.com/QFF9n1Wi

    It would be really awesome if someone knows the answer.

    Greetings,
    Marvin

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

  • shanebp
    Moderator

    @shanebp

    You shouldn’t change core files.

    You should be able to make your changes via template overloads.

    Copy this file
    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 ) ) : ?>

    To change the location of the reply box, adjust the html in that same template overload.


    Marvin_Klempert
    Participant

    @marvin_klempert

    Thanks for your answer and the hints.

    Now the messages show in the desired order, but I get the following frontend-error: “There was a problem sending that reply. Please try again.”.

    What could I´ve done wrong?

    Here is my code in a pastebin:
    http://pastebin.com/5SCRxju3


    shanebp
    Moderator

    @shanebp

    The reply form has hidden fields that require variables only available within the bp_thread_has_messages conditional.

    See https://gist.github.com/shanebp/3d04465213e99665e512


    Marvin_Klempert
    Participant

    @marvin_klempert

    Aaah, I see. Not it works perfectly. Thank you very much 🙂


    BackpackersUnion
    Participant

    @backpackersunion

    Building on this idea (which is awesome!), is there a way to have the new message post below the ‘reply-composing box’?

    With this setup, new messages are posting above the ‘reply-composing box’ until the page is reloaded. I’ve tried altering the single.php to accomplish this, but it seems a function might be controlling this layout?

    Thanks @shanebp and @marvin_klempert!


    djsteveb
    Participant

    @djsteveb

    anyone know if the code mentioned here: https://buddypress.org/support/topic/option-to-sort-inbox-msgs-new-to-old/#post-244547

    is similar, worse, better ?

    I need this functionality, but don’t trust random github code, and don’t know enough to understand that or the code above yet.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Private Message Thread – Reply-Box on Top’ is closed to new replies.
Skip to toolbar