I need advice to help me deal with this problem:
I use userpoints in a site where points are awarded to users when they login, but only once a day.
I have setup a rule:
On event "User has logged in"
If
$today = date("d-m-Y"); // if he has logged in yesterday at 23:50 he can log in today at 0:05
$today_timestamp = strtotime($hoy);
if ([account:user-last-login-raw]<$today_timestamp)
return true;
else
return false;
DO
Grant points to a user
This works as planned, except when the user clicks very fast the login button. Then it grants points to the user multiple times.
I have also tried , as a condition, a comparison of "$today_timestamp" with max(time_stamp) for the user in the userpoints_txn table, with similar results.
Any ideas on how to avoid this?
Thanks!