Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Posts sorting in discussions?

edited January 2008 in Vanilla 1.0 Help
Hi to everyone, I do not know, maybe I just did not searched that right but I do have a problem to solve. Does anyone know, how to get the newest post first instead of the oldest one? Thanx for any help ;)


  • Where do you get the oldest post? Eveything in Vanilla shows the latest (or newest) posts (or discussions).
  • Well, I guess I am asked the wrong way :( Lets say I add something to discussion and after 5 minutes I add something again. The first post is still placed on top of the page and newer one is second and so on. And I would like to have it the opposite way. When I click on the Name of discussion, I need to have the last post on top of the page and the oldest one at the bottom.
  • Hmm, it is the same thing here in this discussion. I would like to have this post placed on top of the page not as the 4th one at the bottom.
  • Do you mind if I ask why? It's a very unnatural way to read.
  • No, I do not mind. Even If I agree with you, I have more than half of my forum users asking for that. So, first of all I am trying to find out if it is possible or not and secondly how difficult the change is and how to make it? Any ideas, please?
  • Well it's definitely possible - the chronological extension does a similar-ish thing with discussions. All that needs to happen is to add an 'order by' command to the sql query. I'm gonna go out on a limb here and suggest you try this: Open Vanilla.Class.CommentManager.php from /library/vanilla Find the line: $s->AddOrderBy('DateCreated', 'm', 'asc'); Change it to: $s->AddOrderBy('DateCreated', 'm', 'desc'); Let me know what happens.
  • Thank you for that code change. It helps, it changes the direction of all posts but there is one more issue to fix. After the change, I logged in and clicked on the unread posts link next to the name of discussion. It sent me as used to to the last post on the last page and that is not helpful. The last post is now on the first page. Could you please find the way how to fix that as well? Thank you in advance
  • I cant think of an intelligent way off the top of my head but one way would just be to disable the feature which takes you to the last unread post - this would just leave you at the top of the page.
  • I have same problem as you Falcon. When I click on link on homepage it leads me to the oldest comment instead of newest. Please if someone should fix this I appreciate it.
  • i'm facing the same issue and would like a fix for it
  • lucluc ✭✭
    @justradar: Are you using vanilla 1?
    Because if you're on vanilla 2, this discussion is not for you.
Sign In or Register to comment.