Notifications
Clear all

How to move the block vote for comment up

2 Posts
2 Users
1 Likes
1,445 Views
Minusator
(@igjijklgf4)
Member Customer
Joined: 6 years ago
Posts: 31
Topic starter  

Hi!

Tell me please. How to move the voting block up comment?

In  class.WpdiscuzWalker.php I found the code responsible for voting

if (!$this->optionsSerialized->votingButtonsShowHide) {
if ($args['can_user_vote']) {
$voteClass = ' wc_vote wc_not_clicked';
$voteUp = $this->optionsSerialized->phrases['wc_vote_up'];
$voteDown = $this->optionsSerialized->phrases['wc_vote_down'];
} else {
$voteClass = '';
$voteUp = $this->optionsSerialized->phrases['wc_login_to_vote'];
$voteDown = $this->optionsSerialized->phrases['wc_login_to_vote'];
}
$voteUpClasses = apply_filters('wpdiscuz_vote_up_icon_classes', array('fas', $args['voting_icons']['like'], 'wc-vote-img-up'), $comment, $args['current_user']);
$voteDownClasses = apply_filters('wpdiscuz_vote_down_icon_classes', array('fas', $args['voting_icons']['dislike'], 'wc-vote-img-down'), $comment, $args['current_user']);
if ($this->optionsSerialized->votingButtonsStyle) {
$votesArr = $this->dbManager->getVotes($comment->comment_ID);
if ($votesArr && count($votesArr) == 1) {
$like = 0;
$dislike = 0;
} else {
$like = isset($votesArr[0]) ? intval($votesArr[0]) : 0;
$dislike = isset($votesArr[1]) ? intval($votesArr[1]) : 0;
}
$commentOutput .= '<span class="wc-vote-link wc-up wc-separate' . $voteClass . '">';
$commentOutput .= '<i class="' . implode(' ', $voteUpClasses) . '"></i><span>' . $voteUp . '</span>';
$commentOutput .= '</span>';
$commentOutput .= '<span class="wc-vote-result wc-vote-result-like' . (($like) ? ' wc-positive' : '') . '">' . $like . '</span>';
$commentOutput .= '<span class="wc-vote-result wc-vote-result-dislike' . (($dislike) ? ' wc-negative' : '') . '">' . $dislike . '</span>';
$commentOutput .= '<span class="wc-vote-link wc-down wc-separate' . $voteClass . '">';
$commentOutput .= '<i class="' . implode(' ', $voteDownClasses) . '"></i><span>' . $voteDown . '</span>';
$commentOutput .= '</span>';
} else {
$voteCount = get_comment_meta($comment->comment_ID, WpdiscuzCore::META_KEY_VOTES, true);
$commentOutput .= '<span class="wc-vote-link wc-up' . $voteClass . '">';
$commentOutput .= '<i class="' . implode(' ', $voteUpClasses) . '"></i><span>' . $voteUp . '</span>';
$commentOutput .= '</span>';
$commentOutput .= '<span class="wc-vote-result">' . intval($voteCount) . '</span>';
$commentOutput .= '<span class="wc-vote-link wc-down' . $voteClass . '">';
$commentOutput .= '<i class="' . implode(' ', $voteDownClasses) . '"></i><span>' . $voteDown . '</span>';
$commentOutput .= '</span>&nbsp;';
}
}

And moved to <div class="wc-comment-header"> but the ajax stopped working when voting

This topic was modified 5 years ago by Minusator

   
Quote
 Tom
(@tomson)
Famed Member Admin
Joined: 9 years ago
Posts: 4171
 

Hi @igjijklgf4,

Some JS functions of voting actions search voting div's in <div class="wc-comment-footer"> div. So if you move voting buttons they must have wrapper div wc-comment-footer class.


   
Minusator reacted
ReplyQuote
Share:
Scroll to top