Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Sorting discussions by date
Hello,
I'd like to change my forum to display the discussions by the date the discussion was created and not by its latest reply.
I tried to change config.php and add these lines:
$Configuration['Vanilla']['Discussions']['SortField'] = 'd.DateInserted';
$Configuration['Vanilla']['Discussions']['SortField'] = 'asc';
It did not have the effect that I wanted.
Please advise. Thanks!
0
Answers
Just curious how would people find new discussions then, by paging through all discussion topics. Doesn't seem to optimal the way I am envisioning it, even if you could do it, which I think would require major tweaking in core, or a plugin or application to totally replace things.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@Ricardo_Viteri What version on Vanilla are you running?
I believe you want to use:
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight, I'm using Version 2.0.18.4
Hi @peregrine, most of the discussions are specific to what's going on with the events of the community. Therefore, you could be discussing the same topic in different times. Imagine a monthly conference meeting. Therefore, people have started adding comments to old discussions.
This is why I would like to keep discussions sorted by date and not by most recent comments.
@Ricardo_Viteri, did my configurations work?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Hi @hgtonight, unfortunately, the configurations did not work.
Thank you!
Have you modified any core files?
In /applications/vanilla/models/class.discussionmodel.php, on line 161 should be this:
Is this there for you?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight
there is this plugin which reverses comment order. Maybe it can be modified to do that with discussions. Or to show the oldest comments first.
http://vanillaforums.org/addon/reversecommentsort-plugin
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
@vrijvlinder Good idea on that plugin.
I looked into it and it deals with the comment model. Turns a discussion into a twitter feed. Or a facebook wall. Whatever. Since it just deals with the comment afterconstruct event, it won't help in this case.
Unfortunately, I can't see why those configurations aren't working. Are you placing them in the
/conf/config.php
file?Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I think a little debugging needs to be done. As soon as the changes in http://vanillaforums.org/discussion/comment/180410/#Comment_180410 does not change the sortorder, look in your debug list that is at the bottom of the page, when you turn on the debug modus. Look at the SQL query that's executed. If the sorting there is still different from the changes you made in conf/config.php then those changes are overridden somewhere else. Let's try that first.
There was an error rendering this rich post.
I don't know if this will shed any light
http://vanillaforums.org/discussion/comment/165569/#Comment_165569
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
This is what I have in line 161:
It looks like its the same.
@hgtonight, I am not looking to sort by the last comment. I am need to sort by the date that the post was created. Would d.DateLastComment be the right parameter?
That is the default that it will load if
$Configuration['Vanilla']['Discussions']['SortField'] = 'd.DateInserted';
isn't present in your config.php.Could you list out your config.php? Be sure to remove the database info and any other personal info.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@UnderDog, how do you turn on debug mode? and where is the log file located?
Thanks,
use < pre > code here < /pre> so it looks better
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
@vrijvlinder, thanks, I was looking for that.
@Ricardo_Viteri what view are you wanting to sort? If you don't know, you can just give a sample url.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
you might be using a plugin that changes the sort.
grep is your friend.