Need to sort discussions by Date Created, not Most Recent Comment
Hi all,
I'm on 2.1.1 stable, running a forum for an online campus.
The faculty/students in particularly active classes are complaining that their classroom areas (read: private Categories) are 'confusing', because "the order in which discussions are listed keeps changing" (obviously, because they're ordered by most-recently-updated)... and apparently they want to be able to memorize the location of each discussion on the screen and click on the G-D thing with their eyes closed, rather than actually reading.
Ahem.
Anyway, I'd "like" to change the display of discussions on the forum - specifically, to order the discussions by the date created.
(Yes, this dumb. Yes, I hate it. Read that as a given.)
I added the following two lines to config...
$Configuration['Vanilla']['Discussions']['SortField'] = 'd.DateInserted'; $Configuration['Vanilla']['Discussions']['SortDirection'] = 'desc';
... as suggested by @hgtonight in this post - http://vanillaforums.org/discussion/comment/180112/ - but it doesn't seem to have any effect. Has the code changed in the last year, to the point where these config settings no longer do anything? Config-defaults.php does not seem to contain any hints on this one.
Comments
Look at the class.discussionmodel.php to see where it comes from
by the way you should update to 2.1.3 for security and other reasons
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
I can't really do a version update until the semester is done.
(I'm honestly trying not to mess with anything at all while classes are in session, so long as it's working as intended, or enough people complain about something dumb like this.)
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.
Okay. Updated to 2.1.3. See how I cave under pressure?
Unfortunately, the fact that those two config lines should work doesn't seem to have any bearing on my forum, which continues to order by most recently updated.
Update: Annnd it broke file uploading. Awesome.
Update: And all posting. Double Awesome.
you mean the config statements change or the update to 2.1.3....
if it was the update clear the cache,
not really needed but ....
run utility/structure. utility/update.
reinstall source files if you still have problems. 2.1.3 does work fine,
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Do you have any plugins that modify the sort field?
Search for
DiscussionModel_BeforeGet_
and report any plugins that use that hook.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.
Updated to 2.1.3.
Cleared Cache.
Ran structure and update.
This is what I get whenever anyone tries to post.
check your. .htaccess - did you overwrite it?
and make sure rewritebase is correct.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Its still not clear are you just trying to get your forum functional, or are you working on the sorting stuff.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I am not trying to reorder the posts anymore. Updating to 2.1.3 has rendered the forum unusable, and I am now trying to address that issue.
I would verify .htaccess and fix rewrite base
check if no go.
I would re-install source. make sure all files get copied, and then verify .htaccess
and if you made changes to config-defaults.php which shouldn't be done (since it gets over-written as well)
where as config.php doesn't get overwritten.
and remove these lines from config.php
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
.htaccess reads:
Config.php is back to where it was a couple hours before I did anything to it.
Hitting "post" throws a 404 error for ... something. Can't tell what file it wants that it can't find.
Hitting post again makes the page go completely blank.
Also just sitting on the page with the 404 error will make it go blank after about 30 seconds idle.
where is your forum folder.
If vanilla is in a subfolder then you need to specify it after the /.
uncomment this line and place your forum folder name
# RewriteBase /
e.g.
RewriteBase /forum
RewriteBase /vanilla
RewriteBase /whatever
I would verify .htaccess and fix rewrite base
check if no go.
I would re-install source. make sure all files get copied, and then verify .htaccess
and make sure all folders are readable. and permisions correctly set.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
What is the URL that is giving you the 404?
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.
It's possible a plugin is overriding your Vanilla.Discussions.SortField.
Regarding the 2.1.3 broken issue: Are you using a Bluehost 1-click installer, or manually uploading?
If you are using an installer, verify their version is 2.1.3 and not 2.1.2.
If you copy the files over yourself, do try copying them all again as peregrine suggested and checking your htaccess is as it should be.
That 404 error suggests a non-Vanilla problem with your setup - that ain't Vanilla's 404.
Would you also humor me and tell me what browser you're using and whether you've tried in any other browsers?
.htaccess now reads:
Forum is at nila.edu/orca - so that tracks.
I can't exactly tell - it's not actually saying what the 404 file is - just that it can't find a file when I try to post.
Nah, I uploaded the archive, unarchived, and copied everything over into the directory.
I'll give it a shot, but I think I'm on about my fourth copy-over.
a change in .htaccess isn't always immediate. that could be your issue now that you have changed .htaccess.
on localhosts ubuntu one has to apache2ctl for immediate change.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.