This discussion is related to the
Voting addon.
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!
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;
*****
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •As I need sorting to be specific to each category (as well as voting controls display in discussion).
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •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.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Please help.
Thank you.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •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!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Would like to bump this as I'm having the same issue.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •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.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Just comment out line 137-152 in class.voting.plugin.php
It worked for me.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •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?
VanillaSkins.com Themes / Custom Themes / Design & Graphics for Vanilla
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Mmh, all of the above solutions don't work. Did no one manage to do this? Thanx for help
VanillaSkins.com Themes / Custom Themes / Design & Graphics for Vanilla
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •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
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •