Gath Posted September 2, 2007 Share Posted September 2, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/67609-solved-creating-turns-to-users/ Share on other sites More sharing options...
Eric_Ryk Posted September 2, 2007 Share Posted September 2, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/67609-solved-creating-turns-to-users/#findComment-339862 Share on other sites More sharing options...
steelmanronald06 Posted September 2, 2007 Share Posted September 2, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/67609-solved-creating-turns-to-users/#findComment-339887 Share on other sites More sharing options...
Gath Posted September 2, 2007 Author Share Posted September 2, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/67609-solved-creating-turns-to-users/#findComment-339966 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.