Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
294 views
in Q2A Core by

Hello

When you give positive or negative points to a question or answer, the other voteup or votedown  mark is hidden. 

I don't want this to happen and I would like to have both symptoms

 what should I do?

Q2A version: 1.8

1 Answer

+2 votes
by
selected by
 
Best answer

You need to override how the voting buttons are rendered in your theme. The starting point is the method voting_inner_html(). That method invokes other methods for rendering the elements in the voting boxes (buttons, vote count, etc.). Find the methods that render the buttons (in SnowFlat it's just one method vote_buttons(), other themes like my own might use separate methods for rendering the upvote and downvote buttons) and override them in your theme. You need to ensure that for the vote states "voted_up" and "voted_down" both buttons are rendered.

For SnowFlat that might look somewhat like this:

switch (@$post['vote_state']) {
  case 'voted_up':
    $this->post_hover_button($post, 'vote_up_tags', '+', 'qa-vote-first-button qa-voted-up');
    $this->post_disabled_button($post, 'vote_down_tags', '', 'qa-vote-second-button qa-vote-down');
    break;
  case 'voted_down':
    $this->post_disabled_button($post, 'vote_up_tags', '', 'qa-vote-first-button qa-vote-up');
    $this->post_hover_button($post, 'vote_down_tags', '–', 'qa-vote-second-button qa-voted-down');
    break;
  ...
}

With that said, I don't recommend displaying both buttons once a vote has been cast. Removing the opposite button serves as a visual cue that the post has already been voted on by the user, and that the existing vote must be revoked first before a different vote could be cast.

by
Great, thanks a lot
...