Hello There, Guest! › Register

MySubscriptions 2.2 released.
Looking for a custom plugin for your site? Ask here for a quote.

Few Questions
#1

*This is in the wrong forum, sorry

I though of an idea, its straight forward...

I need to have a button, and when a user press the button they earn "X" amount of points. The button can only be pressed once a day. I am planning on coding it myself (A good way to learn)

I just need help with the overlook of the process.

I need to add a column on every user that holds a value "1" or "2". 1 meaning that they haven't clicked the button, 2 meaning they have. I was thinking to simply revert that column value to "1" once a day for every user. With a forum of 1-10,000 users, how inefficient will this be? Any better way of doing this? (Can't be too complicated being that I am learning)

* I will be testing this on a separate forum, so trial and error isn't a problem.
* I know intermediate php and sql

Thanks
#2

Just add a new column for the last time they hit the button. Simple as that. If the value minus current time (MyBB's TIME_NOW macro) is bigger than 24*60*60 then they've waited enough and they can hit the button if they want to. Then give the points and update the field with the new time.
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
#3

(06-13-2012, 07:45 AM)Pirata Nervo Wrote: Just add a new column for the last time they hit the button. Simple as that. If the value minus current time (MyBB's TIME_NOW macro) is bigger than 24*60*60 then they've waited enough and they can hit the button if they want to. Then give the points and update the field with the new time.

Exactly why I made this thread, would have never of though of that.

Thanks




Users browsing this thread: 1 Guest(s)