Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
323 views
in Q2A Core by
I want to make it so that answers can only be upvoted but questions remain up or down vote

1 Answer

+2 votes
by

There is no setting to do so. You'll have to modify the code. This can be done with a layer (or even modifying the theme) and an override. However, here are the the corehacks with the changes.

1. Edit qa-include/qa-theme-base.php

2. Locate function vote_buttons and edit it this way:

Wrap each line that contains 'vote_down_tags' inside an IF statement with this condition (@$post['raw']['basetype'] !== 'Q')

For example, this line:

$this->post_disabled_button($post, 'vote_down_tags', '', 'qa-vote-second-button qa-vote-down');

Would turn into this line:

if (@$post['raw']['basetype'] !== 'Q') {
    $this->post_disabled_button($post, 'vote_down_tags', '', 'qa-vote-second-button qa-vote-down');
}

3. Edit file qa-include/app/votes

4. Locate function qa_vote_set and add this:

if ($post['basetype'] === 'Q' && $vote == -1) {
    return;
}

Before this line:

require_once QA_INCLUDE_DIR.'db/points.php';

by
Thanks very much for the detail. I will try this next time I get a chance.
...