[vengeance]
09-08-2009, 06:14 PM
Hello.
I have a shoutbox which logs automatically in the database, if a user floods the shoutbox.
However, it logs it in the database more than once if a user floods the shoutbox way too fast.
1st time punishment > Kick
2nd time punishment > Kick
3rd time punishment > Mute
So if the user sends messages too fast, the bot will auto-message something like "X has been kicked for flooding", "X has been kicked for flooding" and "X has been muted for flooding" - at the same time.
Although, I only want the user to be punished once, and then another punishment if the user does it again.
Does anyone have any suggestions about doing this? I thought of something like:
Check if there's any database inputs with the same $user['id'] and if the `date` column (timestamp) is the exact same, then delete it/prevent the script from adding another input to the database?
Thanks
I have a shoutbox which logs automatically in the database, if a user floods the shoutbox.
However, it logs it in the database more than once if a user floods the shoutbox way too fast.
1st time punishment > Kick
2nd time punishment > Kick
3rd time punishment > Mute
So if the user sends messages too fast, the bot will auto-message something like "X has been kicked for flooding", "X has been kicked for flooding" and "X has been muted for flooding" - at the same time.
Although, I only want the user to be punished once, and then another punishment if the user does it again.
Does anyone have any suggestions about doing this? I thought of something like:
Check if there's any database inputs with the same $user['id'] and if the `date` column (timestamp) is the exact same, then delete it/prevent the script from adding another input to the database?
Thanks