solved Reversing the order of replies to forum discussion (newest first)

Elise
Elise
@elise
8 years ago
249 posts
Some of my discussions are 15 miles long and user have to do a lot of scrolling when replying to the latest comment.

My users are asking if we can reverse the order of the replies (newest first) like they had in the group discussion.

Possible?
Thanks!

PS: The "support module" is the BEST EVER to manage all the user requests and problems. Love it!
updated by @elise: 05/23/17 02:55:55PM
douglas
@douglas
8 years ago
2,790 posts
In your ACP > Item Features > Comments > Global Config > List Options change the Comment Sort direction to "Newest Comment First"

Be sure to clear your cache if you are NOT running in developer mode.

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Elise
Elise
@elise
8 years ago
249 posts
Oh i should have said: Yes I saw this setting and it IS set to Newest first (always been set to that).
Reset caches too.
updated by @elise: 10/29/16 09:29:27AM
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
I have mine set the same as Elise, and like hers, my Forum posts are not showing up as newest on top either.
I too would like to have them show as newest posts on top. (Maybe that's because i have created a "forums" profile that 'owns' all the site forums?)

AND I want to move the Reply textbox to the top of page as well (I may have to create a separate thread here for that, I know)


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
brian
@brian
8 years ago
10,148 posts
It's important here to understand there is a distinction between modules:

1) Profile Forum - does NOT use the Comments module - has it's own handling. You cannot reverse or change anything without creating a custom module

2) the DICUSSION FORUM module, which is a custom module Paul created for Ning migrants - this DOES use the comments module so will support reversing as well as threaded comments.

If you are using the PROFILE FORUM module then no - you cannot reverse the threads.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
brian:
1) Profile Forum - does NOT use the Comments module - has it's own handling. You cannot reverse or change anything without creating a custom module

Ok thank you for making this clear for me.
I believe I am using a profile I created named "Forums" that 'owns all my site's discussion forums. (not Group discussions tho of course)

Is it possible for me to get a general idea of the cost of sponsoring a custom module that would order my new forum posts on Top, and also the Reply textbox on top...in my profile Forums?... and if that's do-able by the JR Team if I decide I'd like to pay to have it created?


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Elise
Elise
@elise
8 years ago
249 posts
Strumelia:
AND I want to move the Reply textbox to the top of page as well (I may have to create a separate thread here for that, I know)

Did you see how to do that in the template? If not, let me know and I will show you where to make the change.
Elise
Elise
@elise
8 years ago
249 posts
@brian or @paul : can we migrate from the profile forum to the discussion forum?
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
Elise:
Strumelia:
AND I want to move the Reply textbox to the top of page as well (I may have to create a separate thread here for that, I know)
Did you see how to do that in the template? If not, let me know and I will show you where to make the change.

Elise, thanks! yes I did do that in my GROUP Discussions, because I was able to reverse the posts order there to make the newer posts on top. Getting a favorable response from my members on it.
However, in my Profile site-wide forums, It would make no sense to put the reply box on top of the page if the newest posts were still at the bottom of the page, so that's what I would have to focus on first.

btw, in my case I don't want to switch from the Profile Forum setup to the Discussion Forum module, I like how it's currently set on my site.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
michael
@michael
8 years ago
7,714 posts
in your Forum item_detail.tpl page you can reverse the output order of the items by using the array_reverse() function

ACP -> MODULES -> PROFILE -> FORUM -> TEMPLATES -> item_detail.tpl -> MODIFY

locate the section that starts the {foreach loop for all of the forum posts. Around line 40 ish. Probably looks like this:
 <div class="block_content">
    {foreach $_items as $_itm}
.......

flip the order of that array by adding this one line:
 <div class="block_content">
    {$_items = array_reverse($_items)}
    {foreach $_items as $_itm}
.......
michael
@michael
8 years ago
7,714 posts
actually, that will only reverse the order of the items on the page, if there's more than all of the posts on the page thats not going to work. Will only be any good if you are NOT using pagination.
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
michael:
actually, that will only reverse the order of the items on the page, if there's more than all of the posts on the page thats not going to work. Will only be any good if you are NOT using pagination.
Not sure what you mean by 'not going to work'... what would it show if i did it while having pagination?


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
paul
@paul
8 years ago
4,326 posts
This option has been added to the latest version of the jrForum module. Its in the marketplace now.


--
Paul Asher - JR Developer and System Import Specialist
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
Paul, this would be amazing! But...I'm not seeing the update in my /marketplace/system_update area...?
I currently have jrForum version 1.8.9. Is the update only for those on JR6 perhaps?


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
brian
@brian
8 years ago
10,148 posts
Strumelia:
Paul, this would be amazing! But...I'm not seeing the update in my /marketplace/system_update area...?
I currently have jrForum version 1.8.9. Is the update only for those on JR6 perhaps?
This is for JR6.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
I'm thrilled! Wow, thank you guys sooooo much for making this happen!!
I will look forward to it when i update to JR 6. So good of you to do this for us! (I know how busy you are, yikes) I'm assuming the new 'order by' option will play nice with pagination, then.

Thank yuuuuuu! :)


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
paul
@paul
8 years ago
4,326 posts
Quote: I'm assuming the new 'order by' option will play nice with pagination, then.
jrForum topic posts don't paginate, so this is not an issue.


--
Paul Asher - JR Developer and System Import Specialist
brian
@brian
8 years ago
10,148 posts
paul:
jrForum topic posts don't paginate, so this is not an issue.

Forum topics DO support pagination, and yes - the reverse order works correctly with pagination :)


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 11/03/16 11:28:03AM
paul
@paul
8 years ago
4,326 posts
Sorry - Brian is right. I've never seen a JR forum with it implemented so that's why I'd forgot it was an option ;-)


--
Paul Asher - JR Developer and System Import Specialist
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
Yes, my site uses a Profile Forum for its site-wide discussion forums, and here is my pagination setting in jrForum module:
forum_admin_global.jpg




--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
brian
@brian
8 years ago
10,148 posts
There's a new "post sort direction" config option in the new version.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
brian:
Forum topics DO support pagination, and yes - the reverse order works correctly with pagination :)

Woo-HOOOOOOOO! yipeeeeee! this will be GREAT when i move to JR6. :D

I already learned how to move the 'reply' textbox up to the top of page in my Group Discuss module, so I'll also do that in my jrForum module after I move to jr6 and flip the post order in jrForum module.
Thank Yew !


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
You guys are geniuses.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
brian
@brian
8 years ago
10,148 posts
If you set the forum post order to NEWEST first (like you want) the "post response" box will show at the top, so you should not have to make any modifications.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
Ok, I'll check that out when the time comes- merci Brian!


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Elise
Elise
@elise
8 years ago
249 posts
I second Strumelia, you are TOTALLY AWESOME!
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
brian:
If you set the forum post order to NEWEST first (like you want) the "post response" box will show at the top, so you should not have to make any modifications.

Hmm...that's seemingly not happening for me- have updated to jr6 and reversed the (profile forum) posts order to Newest first...but the post response box (and the original thread post) is remaining at the bottom of the page. So gotta figure out how to pull it up to on top of the most recent response post.

Ideally, I'd like the topic's FIRST post to be treated differently and remain at very top of the discussion page, then the response text box right under it, and then all the topic response posts underneath those...with the newest on top. That would match how our Group Discussions are laid out, and I really like that layout, as do many of my members. It uses much less scrolling down, and keeps the original post in view too, which helps keep folks on topic.

The thing about keeping original post at top like in Group discussions would be really great, but minimally I do need to pull the response textbox up from the bottom of each page.
Thanks for any help with this- I tried to see where to move the response texbox myself, but I honestly couldn't figure it out due to all the new updates I'm still looking through..
Is this a bug though maybe, where it was supposed to move it up if I reversed order to newest on top?


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
Here's a screenshot of how my Group Discuss discussions are laid out, which I just love. I'd LOVE to make my profile Forums match the same-
Note that the Original post stays at very top. Then the reply box right under it, then all the replies to the topic are under that, with oldest replies at bottom:
groupdiscuss layout.jpg




--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Elise
Elise
@elise
7 years ago
249 posts
I know this post is marked as solved but just wanted to update for those reading this later.

The feature Forum > Page Settings> Reverse Order does NOT keep the original post/question at the top.
So someone reading the thread for the first time has no idea what this is about. Only the title of the post is retained at the top.

So instead of

Title
Description/Question (first comment in jamroom database)
reply box
comment#3
comment#2
comment#1

We have

Title
reply box
comment#3
comment#2
comment#1
Description/Question

which loses the context of the post.


updated by @elise: 02/21/17 08:50:26AM
paul
@paul
7 years ago
4,326 posts
If you but a {debug} near the top of the jrForum item_detail.tpl template you'll see that there is an array called $topic available to the template. Part of that array is 'forum_text' which contains the initial topic text, so in this template add {$topic.forum_text} where you want the original post to show.
hth
Paul


--
Paul Asher - JR Developer and System Import Specialist
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
Yes, this has been the last step needed for the whole "reverse order in forums' thing to function well. (see my last two posts and my screenshots).

I had been thinking just yesterday about starting a new thread here about just this remaining issue... particularly because this thread is marked 'solved'. But with Elise's new post above, perhaps it can still be a part of completing the project of making the reverse order work well in actual use.

In Group discussions, it all works well simply because group discussions don't use pagination- they use "show more" link at bottom. So technically it's all on one page which can be made longer to show older posts...and thus the original post will always show on top. jrForums however still keep the orig post only on the with the oldest replies. When a discussion gets to be more than 1 page long the orig post gets buried.
It's true that a member who comes to the thread from seeing a new post in activity feed will then not see the orig post and will be in the dark about the actual topic being talked about. As Elise says, they see only the title ...unless they are savvy enough to scroll down and use the pager to get to the oldest page where the orig post resides. This is very problematic, especially on mobile devices.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Elise
Elise
@elise
7 years ago
249 posts
I think Strumelia and I were looking for a fix inside the module, not quick template editing which creates other issues.
For example, I tried adding this above the reply box, but it loses the original poster's image and profile.
paul
@paul
7 years ago
4,326 posts
Something like this at about line 145 of the Forum item_detail.tpl template will put it above the form -
                            <div class="p5" style="display:table-cell;width:95%;padding:5px 12px;">
                                {if isset($_conf.jrForum_direction) && $_conf.jrForum_direction == 'desc'}
                                    <h2>{$topic.forum_text}</h2>
                                {/if}
                                <div class="forum_new_post_form">



--
Paul Asher - JR Developer and System Import Specialist
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
Paul-
Question: it will put it "above the form"- on EVERY page of the discussion? - or only on the page with the most recent posts? - or only on the page with the oldest replies?

Other question: I have a jrForum_item_index.tpl in my custom skin. Is that the template that your code should go in? Would it need to go in the jrForum module's item_index.tpl as well?

I personally think that this should be standard whenever someone selects the 'reverse forum posts order' option... because I can't imagine anyone not needing to have the orig post show on multipage discussions. I have to agree with Elise that it should be built in to happen automatically when someone reverses the forum post order. Otherwise others will continue asking in the future how to tweak this.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
michael
@michael
7 years ago
7,714 posts
Strumelia:....
Other question: I have a jrForum_item_index.tpl in my custom skin. Is that the template that your code should go in? ....
jrForum_item_index.tpl over-rides /jrForum/templates/item_index.tpl

Paul's code indicates the template is /jrForum/templates/item_detail.tpl so the skin over-ride method would have that file copied to your skin as jrForum_item_detail.tpl.

Or you could use the ACP method to put the code in there if preferred
ACP -> MODULES -> PROFILES -> FORUM -> TEMPLATES -> item_detail.tpl -> MODIFY

Docs: "Altering a modules template"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1051/altering-a-modules-template

Tags