Skip to main content

#146 Vote information for users

Posted in ‘NorrCompetition’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information (available for public)

PHP version
PHP 8.2.27

Latest post by b2z on Sunday, 02 March 2025 22:29 EET

fgevic

Hello,

I use NorrCompetition on the website hetdigitaleplaatje.nl.
Participants can vote for the photos from the monthly competition. They can cast 6 votes. Maximum 3 votes per photo. Unfortunately, participants cannot see which photo from the monthly competition they have already voted for and how many votes they have already cast for a particular photo. This only concerns logged in users. Is something like that possible? Or this is a good addition to future versions?

Best Regards,

Felix

b2z

Hi Felix,

This information (vote data) is displayed inside the tooltip of the vote button. If you want, you can create an override and make you own logic to display the needed information. The file is /layouts/default/partials/buttons/vote.php

Vote data object has the following properties:

allowedCompetitionVotes - allowed contest votes for a voter (int),
allowedParticipantVotes - allowed entry votes for a voter (int),
canVote - true if a voter can vote,
canUnvote - true if a voter can unvote,
competitionId - contest ID (int),
competitionVotes - total voter votes per contest (int),
competitionVotesLimit - true if a voter has reached the maximum votes per contest,
fraud - true if fraud attempt is detected,
hasPermission - true if a voter has permission to vote,
lastCompetitionVote - datetime or empty string,
lastVote - datetime or empty string,
nextVote - datetime or empty string,
participantId - entry ID (int),
participantVotes - total voter votes for entry (int),
participantVotesLimit - true if a voter has reached the maximum votes per participant,
success - true if a vote was saved as a valid vote,
userId - user ID in case a voter is a registered user (int),
voted - true if a voter have already voted and no votes left,
votingActive - true if voting is active.

Learn here how to make an override:

Template Overriding | NorrCompetition | NorrNext Documentation

Kind regards,

Dmitrijs

Support information

Support hours: You can get our help: Monday - Friday / 09:00 to 17:00 (GMT+3), but not limited. Our staff is pleased to provide Premium support to every paid subscriber asap, but sometimes you should be ready to wait for our reply for up to 3 days.


Our time: / Your time:

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. We also ask you to remove temporary credentials at your site after the problem is resolved. Thank you.

Support of free extensions is not provided on this forum. Please submit your questions or report issues via Github tracker. See link on the product page.