HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

If your version of the plugin causes accepted answers to rise to the top.

peregrineperegrine MVP
edited December 2013 in Feedback

@Pryor74

In answer to http://vanillaforums.org/discussion/25606/question-and-answer-how-to-not-moving-accepted-answers-to-top-of-thread

and you prefer to keep the accepted answers in context, as well as have accepted answers rise to the top. (the best of both worlds in my opinion) So for viewers who want to see context - context remains. and for people who want answers to rise they rise as well.

I believe it depends on the version of the plugin you are using (whether answered questions rise to the top.)
1.0.8b - accepted answers don't rise.
1.1.8. - accepted answers rise and are taken out of context.

If you retrieve it from github.

e.g. with version of plugin 1.1.8.

look around lines 400-410 in class.qna.plugin.php

 // Remove the accepted answers from the comments.
      if (isset($Sender->Data['Comments'])) {
         $Comments = $Sender->Data['Comments']->Result();
         $Comments = array_filter($Comments, function($Row) {
            return strcasecmp(GetValue('QnA', $Row), 'accepted');
         });
     // comment out the line below (and it will leave answers in context (but have a duplicate aacepted answer at top.
     //    $Sender->Data['Comments'] = new Gdn_DataSet(array_values($Comments));

As a continual nag, I wish this line were commented out as well on this forum (vanillaforums.org) too. So we could see answers in context as well. @Todd :) pretty please.

assuming this mod doesn't affect page count or drop off of comments, because you now have total comments = all comments + accepted comments (actually a bit of a side effect if comments exceeds comments per page, but liveable.

You could also hide or disable accepted answers at top as well.

I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Comments

Sign In or Register to comment.