Author Topic: [SOLVED] Creating "turns" to users  (Read 718 times)

0 Members and 1 Guest are viewing this topic.

Offline GathTopic starter

  • Irregular
  • Posts: 36
    • View Profile
[SOLVED] Creating "turns" to users
« on: September 02, 2007, 12:39:40 AM »
Hi.

What i want is to have a way for users to get a certain amount of "turns" every certain time (let's say 10 minutes = 1 turn). What are my options? So far i planned a way that checks the last time the user saw a page, and gives him the amount of "turns" depending on the time it passed.
But i'm wondering if there might be other/better ideas.
I could set somekind of cronjob, but i dont like that idea mutch. I'd rather have it update independently then in "batch".

So, if you have any ideas that you'd like to share... i'm listening   :)

Offline Eric_Ryk

  • Enthusiast
  • Posts: 230
    • View Profile
    • http://aerial9.com
Re: Creating "turns" to users
« Reply #1 on: September 02, 2007, 10:58:33 AM »
Hi.

What i want is to have a way for users to get a certain amount of "turns" every certain time (let's say 10 minutes = 1 turn). What are my options? So far i planned a way that checks the last time the user saw a page, and gives him the amount of "turns" depending on the time it passed.
But i'm wondering if there might be other/better ideas.
I could set somekind of cronjob, but i dont like that idea mutch. I'd rather have it update independently then in "batch".

So, if you have any ideas that you'd like to share... i'm listening   :)
Those are your two options. Cron really is the way to go though.

Offline steelmanronald06

  • Staff Alumni
  • Addict
  • *
  • Posts: 2,599
  • Gender: Male
    • View Profile
    • Ronald Steelman
Re: Creating "turns" to users
« Reply #2 on: September 02, 2007, 11:39:48 AM »
Cron would be easier on your system. do you really wanna run an sql statement every time a person loads a page just to see if a certain amount of time has passed?  That would be less productive than a single cron job ever so often.

Offline GathTopic starter

  • Irregular
  • Posts: 36
    • View Profile
Re: Creating "turns" to users
« Reply #3 on: September 02, 2007, 02:42:32 PM »
Cron would be easier on your system. do you really wanna run an sql statement every time a person loads a page just to see if a certain amount of time has passed?  That would be less productive than a single cron job ever so often.

I'd prefer not to have cron because every place i knew had a cron, and created similar "turns", would lag down everytime the turn would take place. Not very important when one has a small amount of users, but becomes kind of a drag when the community becomes big.
Also, since i still have to make around 2-3 sql query per page, so, having some code checking the time isnt that big of a deal.

But... i'll try both ways :) Then i'll check how it goes with one and hte other  ;)
Thanks for the input.