PDA

View Full Version : Need Some Guidance - Working On Mod


paul41598
12-21-2006, 07:20 PM
Hey guys, I could use a little guidance with theory here...

I'm currently working on a hack that basically is a standalone CRON job that will run every (x) hours. Basically what it will do is, look for any users who have more than (x) number of scores. When it finds those users, it basically deducts points from their profile and sends a PM to them.

Ok so thats the basics of it for now. Now the part that I'm stuck at.

The problem I just thought of, is the fact that this cron job will run every hour or whatever and keep finding the same users who STILL have more than (x) number of scores and keep sending them PM's.

How do I write some code, options, or whatever to get around this? What is your advice on handling it?

peterska2
12-21-2006, 09:13 PM
why not get it to deduct from the scores too so that they are back to a low number or even 0?

paul41598
12-21-2006, 10:10 PM
Yeah I could I guess...but then their posts wont be scored anymore. In other words, users can score their posts and if its a crap rating, and they get 6 for example in a given month, once they reach that 6, the cron job does it's dirty work right? If I take that 6 and bring it back down to 0, then noone will ever know what posts were scored low in the first place. Guess it doesnt matter, but just working for a workaround

----------------------------------------------------------
In fact heres a question that applies to what I could do. Firstly though, I have a text box where you can enter a number. "Score Amount" for example. If I put in a 6 there, then any users that have greater than 6, get the cron job run on em.

Ok now... what if in place of that, I made that text box so you could type in more than one number. Lets say (6,15,21) seperate by comma's. Then the cron job would somehow look through each of these numbers, compare it to the SQL where statement...and if a user has more than 6, execute the cron on them, then it keeps cycling through and if it finds that same user now has 15 bad scores, then it executes the cron, etc.