Re: Help needed on point system

From: Date: Wed, 06 Feb 2002 18:44:07 +0000
Subject: Re: Help needed on point system
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-11879@lists.php.net to get a copy of this message
"Jerry Leonard" <gcarlyle2@attbi.com> wrote in message news:20020201232505.83007.qmail@pb1.pair.com... > I am relatively new to php and mysql and would appreciate any help you can > provide. Here is the task: > > I need to have a point system added to my site. What I would like is when a > user logs in they will get 1000 points. But they only get it once per day. Seems simple enough; if they have to log in, you obviously already keep per-user records. Add a field for accumulated points and a timestamp. Each time a person logs on, check the timestamp; if the last log-on was not today, increment their points and update the timestamp. Note: be careful about how you define 'not today'. Does that mean roll-over at midnight? But then midnight where? I live on the East coast, my server is in California, and who knows where my users are. Does it mean not within the last 24 hours? Then a user who logs on in the afternoon and again the next morning will only be credited once. More to the point, someone who logs on every day at 'about five o'clock' will on average get chopped half the time, and might get quite peeved about it. I might look at something like 'not within the last fifteen hours' and accept the slop just to keep it simple. What about nerds that never log off? Maybe it should be checked for each page served, rather than just at login. There are quite a few ways of phrasing it, each with tradeoffs.

« previous php.windows (#11879) next »