Hide vote button in poll if user already voted (#1235)

* Hide vote button in poll if user already voted

* Update viewtopic.php

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2023-12-21 00:15:06 +07:00 committed by GitHub
commit 428984524e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 6 deletions

View file

@ -552,7 +552,8 @@ if ($topic_has_poll) {
$template->assign_vars(['TOPIC_HAS_POLL' => false]);
} else {
$template->assign_vars([
'SHOW_VOTE_BTN' => \TorrentPier\Legacy\Poll::poll_is_active($t_data),
'SHOW_VOTE_BTN' => \TorrentPier\Legacy\Poll::pollIsActive($t_data),
'POLL_ALREADY_VOTED' => \TorrentPier\Legacy\Poll::userIsAlreadyVoted($topic_id, (int)$userdata['user_id']),
'POLL_VOTES_JS' => $poll_votes_js
]);
}