Reverse Comment Sorting
Luigi_Donato
New
Hi,
I've installed Vanilla Forum for first time, I have the latest version and I'm trying to reverse the comments order to sort ascending..
From default this is setted to desc, why?
Where I go to reverse the sorting? I've tryied from Admin Panel, from themes php files, discussion.php (in applications/vanilla), but I haven't found a solution..!
How to solve?
1
Comments
Try
However it is old so may not work with latest VF version.
Hi..
Thank you but I know this plugin and is the reverse that I want..!
I want first the old comments.
I've try to edit this plugin but not work.. This take the textbox first of comments..!
Solved by editing the plugin.
Thank you
Sorry, if I misunderstood.
Comments are listed with oldest ones first and newer underneath by default.
So you should not need a plugin for that.
In conf/config-defaults.php under embedding forum & comments you can find this
$Configuration['Garden']['Embed']['SortComments'] = 'desc';Add it to your conf/config.php
Changing desc to asc I assume would do it.
Thanks for lesson 😂🖤
In my case, I want to list the embedded comments in a "newest first" order but... they appear to be unordered when there are "more comments" underneath
Info: the ordering doesn't work when the comments are embedded
Auto answer:
In
applications/vanilla/models/class.commentmodel.phpThis code:
359 $sql2->select('CommentID') 360 ->from('Comment c') 361 ->where($where, null, true, false) 362 ->limit($limit, $offset); 363 $this->orderBy($sql2); 364 $select = $sql2->getSelect(); 365 366 $px = $this->SQL->Database->DatabasePrefix; 367 $this->SQL->Database->DatabasePrefix = ''; 368 369 $this->SQL->join("($select) c2", "c.CommentID = c2.CommentID"); 370 $this->SQL->Database->DatabasePrefix = $px; 371 }should be like this:
359 $sql2->select('CommentID') 360 ->from('Comment c') 361 ->where($where, null, true, false) 362 ->limit($limit, $offset); 363 $this->orderBy($sql2); 364 $select = $sql2->getSelect(); 365 366 $px = $this->SQL->Database->DatabasePrefix; 367 $this->SQL->Database->DatabasePrefix = ''; 368 369 $this->SQL->join("($select) c2", "c.CommentID = c2.CommentID"); + $this->orderBy($this->SQL); 370 $this->SQL->Database->DatabasePrefix = $px; 371 }