Deactivate that voting changes order of answers

Hi there,

I'd like to know what I have to change in the the core-code, to deactivate that the
orders get flipped when some are voted +1 and some aren't.
They still can be voted of course, but they should stay in the same order.

I know that this is maybe not in the sense of a real Q&A, but I found out the last days,
that this would be much more comfortable for me.

Thanks in advance,
Patrick

  • aristath

    @Hakan before pinging you I tried it on my localhost, tried altering the template files, opened up the plugin core files but couldn't figure out how to do it. I looked for any similar issues but couldn't find any.

    From what I understood from the original post, Patrick simply wants to display posts by date and not by rating. I couldn't locate any variables for the list functions though, nor in the template files neither in the core files. That's why I pinged you.

    I'm sorry for not providing that info on my post, I know it would have made your life easier.

    Cheers,
    Ari.

  • Hakan

    Hi,

    Hakan, the answer with the highest rating moves to the top. It skips position with existing answers while moving more further to the top, while getting rated as best answer. This is what I meant with "flipping"

    Yes, that is the default and expected behavior. Which is also the same on similar websites like stackoverflow, Yahoo Answers, etc.

    So, actually you need to customize this sort order, am I wrong?

    We don't have a setting to do this and we don't support this, but it is always possible to customize the core files as they are not encrypted and they are WordPress compatible files.

    So you need to understand what codes do and modify them as required. But we cannot do this for you, because, as I wrote before, Q&A does not support this out of the box.

    Cheers,
    Hakan

  • patrick_s_0

    Well, I'm not going to try to modify it when a year-experienced wpmudev-Mod isn't even finding that function of ordering.

    Although I understand this is not supported by you as the dev, It would have been a nice and probably easily added new feature for persons knowing the sourcecode
    and as I already said in my first post:

    I know that this is maybe not in the sense of a real Q&A, but I found out the last days, that this would be much more comfortable for me.

    I already knew its not Q&A-style - but what Q&A-style is shouldn't be defined by stackoverflow, Yahoo Answers, etc., as you named them.
    It also could be definied by you as a dev, taking it to a higher level and some day people start to claim other question-plugin-devs: "What, no other ordering-option then "by rating"? Come on, this is not real Q&A, you have to able to leave it sorted "by date" too."

    Maybe some skilled member or other dev/mod/whatever is providing a code-change.

  • PC

    Hello @patrick_s_0

    Greetings and thanks for writing back.

    I already knew its not Q&A-style - but what Q&A-style is shouldn't be defined by stackoverflow, Yahoo Answers, etc., as you named them.
    It also could be definied by you as a dev, taking it to a higher level and some day people start to claim other question-plugin-devs: "What, no other ordering-option then "by rating"? Come on, this is not real Q&A, you have to able to leave it sorted "by date" too."

    I agree to this feature request as a regular member of the community and as its not currently available in the plugin, we will look forward for more votes on this thread and if a lot of members are asking for same kind of feature, there are more chances of getting it picked as a feature for future plugin versions.

    We have a limited scope of support on what we can offer on the support forums as what you are trying to achieve certainly comes into custom development and we can not offer that on the forums unfortunately.

    I will however suggest you to post a job requirement for any kind of custom modifications here : premium.wpmudev.org/wpmu-jobs/ and get someone right on it.

    PS : For this particular issue, just navigate to wp-content/plugins/qa/core/votes.php

    Search for

    $clauses['orderby'] = "qa_score DESC, post_date ASC";

    And replace it by

    $clauses['orderby'] = "post_date ASC";

    and save the file. That should remove the sorting by votes from it.

    You can use the below if you want reverse sorting

    $clauses['orderby'] = "post_date DESC";

    See it in action here : http://qna.wpdemo.in/ask-me-a-question/test/

    I hope that helps. Please feel free to ask if you have more questions on the same.

    Please note : That you will have to redo it whenever there is a plugin update as it will rewrite the current files.

    Cheers, PC

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.