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.
Voting Addon : Default Sort
Hi, I like this plugin a lot. Thanks.
I wondered if it's possible to set the default sort to by Date Added rather than by Votes. I like that you can sort by votes, but the problem is that we have conversations by threads with another plugin (replies to specific comments). What happens is that when the original comment gets voted (or liked), it moves to the top automatically, leaving it's conversation (replies) to be orphans.
Is there a way to default to sort by Date?
Thanks!
I wondered if it's possible to set the default sort to by Date Added rather than by Votes. I like that you can sort by votes, but the problem is that we have conversations by threads with another plugin (replies to specific comments). What happens is that when the original comment gets voted (or liked), it moves to the top automatically, leaving it's conversation (replies) to be orphans.
Is there a way to default to sort by Date?
Thanks!
Tagged:
1
Comments
***** voting.bak // No sort was specified so grab it from the user's preferences. $Sort = Gdn::Session()->GetPreference('Plugins.Voting.CommentSort', 'popular'); } else { ***** CLASS.VOTING.PLUGIN.PHP // No sort was specified so grab it from the user's preferences. $Sort = Gdn::Session()->GetPreference('Plugins.Voting.CommentSort', 'date'); } else { ***** ***** voting.bak if (!in_array($Sort, array('popular', 'date'))) $Sort = 'popular'; self::$_CommentSort = $Sort; ***** CLASS.VOTING.PLUGIN.PHP if (!in_array($Sort, array('popular', 'date'))) $Sort = 'date'; self::$_CommentSort = $Sort; *****
As I need sorting to be specific to each category (as well as voting controls display in discussion).
class.voting.plugin.php
LINE 140
From
$CommentModel->OrderBy(array('coalesce(c.Score, 0) desc', 'c.CommentID'));
To
$CommentModel->OrderBy('c.DateInserted');
That worked for me, so just sharing.
Please help.
Thank you.
I thought it might be something I'd done in my development theme, but the same thing happens when switching back to the default Vanilla theme.
Anyone got any clues? Many thanks!
Would like to bump this as I'm having the same issue.
This is something I won't spend to much time testing as any changes I make to voting will be to remove the sort by votes altogether.
Just comment out line 137-152 in class.voting.plugin.php
It worked for me.
Any DEV that can confirm that @BboyHavoc's idea to comment out line 137-152 in class.voting.plugin.php is not making any trouble?
Mmh, all of the above solutions don't work. Did no one manage to do this? Thanx for help
Hi guys,
This solves the problem :
"On line 174 of the "class.voting.plugin.php" change "popular" to "date", this should change it for comments, not sure about anything else."
http://vanillaforums.org/discussion/20938/change-vote-plugin-sorting-default-to-date-instead-of-votes
In 2014 script changes again
a) In line 137 Must be defaut insted of 140
then
b) In line 156 between 164
All date's must be popular, all popular must be date.
Two steps work for me.