Page 1 of 1

Limiting user actions by day

Posted: Sat Jun 06, 2009 7:24 am
by Teonnyn
I want to limit what my users can do within a twenty-four hour period. For example, voting for a particular user can only be done once a day but voting can be done five times a day for other users. Once that five-times a day limit is reached, the user has to wait to vote again. I understand that this can be done with a mySQL table, but what is the best way to set timers on this?

Re: Limiting user actions by day

Posted: Sat Jun 06, 2009 10:28 am
by mikemike
Mark the timestamp when the user voted, then when they come to vote again check the database for the last entry and check the timestamp.

Re: Limiting user actions by day

Posted: Sat Jun 06, 2009 1:42 pm
by Teonnyn
I see. So once users have reached their limits set timestamps and just check against that. Sounds easier then setting up a CRON action :)