Hey Bubbles, need help with any idea how to make each logged in user can click vote button only once a day?
anyone that good at this?
Hey Bubbles, need help with any idea how to make each logged in user can click vote button only once a day?
anyone that good at this?
Did you mean they will vote once a day and come tomorrow to vote again
Various ways to do it, no doubt, but here’s are two simple ones…
Have a field on the User (probably a yes/no) to determine whether or not they have voted that day…
Each day, at midnight, in a backend workflow, set that field to No (if it isn’t already), and if/when they vote set it to Yes.
Then just have a conditional on the page/button so that they can only vote if their Voted field is No.
Alternative, you could do it without using any backend workflows, using a date field instead of a yes/no, and using that date field value in your on-page conditionals, checking it against the current date/time rounded down to Day.
there is various thing to vote, the user only can vote once on every item per day
im afraid they can only vote for 1 item from your options
can suggest me more?
What do you mean?
if i use yes/no, the user only can vote 1 item, i want to make the user can vote on multiple item they want but only once for each item per day.
you get what i mean? all item can only +1 max / day, if the user want to vote on the same item, he must wait for the next day to +1 again on the item vote count
Here’s a quick suggestion:
You can add a new Data Type VoteCount. VoteCount will have 2 fields: Thing of Vote & User Voted.
Both of these Types are going to be Thing to Vote & User, relatively.
When items Upvote is clicked and Do a search for VoteCount. Constraint: Thing of Vote is this Thing & User is current user’s count is < 1 create the VoteCount.
When items Upvote is clicked and Do a search for VoteCount. Constraint: Thing of Vote is this Thing & User is current user’s count is 1 delete the VoteCount.
DM me on Twitter if you have more questions.
seems like i know what you trying to explain, gonna implement this + set schedule to reset the vote count for user daily?
Depends what you need this daily limit for. If you I upvoted your work today, can I upvote it again tomorrow?
In that case, don’t use a field on the User datatype, but create a new datatype instead (as @bestbubbledev suggests).
Then there are multiple ways to do what you’re trying to do.
One would be to simply delete that Thing at midnight the day it’s created (and then only allow a user to vote on something if there isn’t a thing in the database already for that user_vote).
Or, as I said before you can just reset the voted field to No.
Or, if you don’t want to use the backend to reset or delete anything you can just use a date/time field and compare that to the current date/time rounded down to day.
solved! thank you for helping me guys! adamholmes & gio.kakhiani
This topic was automatically closed after 70 days. New replies are no longer allowed.