![]() |
Purge "number" of warnings?
Is there a way to set up a task to completely remove warnings after a set period? (eg 6 mos). I'm using "Maintain Historical Records", but I don't want the warning number to remain with a user forever since that's also used to ban. I tried prune warnings after 180 days, but that didn't change the warning number.
If that's not practical, a query that would set everyone's number of warnings to 0 will do. Thanks |
1 Attachment(s)
It's not as simple as you think. A cron script has to be written, which will check each of your warned members and then it will check the dates of their warnings. For each warning that is older than a predefined time period, it will subtract 1 from the number of warnings of that member.
Here is a script I made up quickly, which should do that for you. I haven't tested it, but it should work. It's using the Alerts life time (How long will your Alerts stay in a users account?) as a cut-off limit. For any warnings it finds, issued before that time limit, it reduces the number of warnings the user has by one. You can change the script so that it works based not on the issue date, but on the date the warning has matured and was rendered inactive (I believe this is the proper way to do it). You will find comments in that part of the script, basically you uncomment a line, and comment the line below it. You can run that script manually or you can add it in your Scheduled Tasks to run once a day. Let me know if it works. |
Quote:
I changed the comment outs as shown here- PHP Code:
|
No, if it's been entered in your AWS Options. Have you set it up there?
Did the script worked when you changed the commented line or not? |
Quote:
|
So the script does not work, in either form, right? Hmm, let me check that out again.
One question, you are using the Historical records, right? So there are active and inactive warnings in your log. The script is trying to find inactive warnings (i.e. warnings which have matured). It then removes 1 from the member's warnings number. It does not remove the warnings themselves. Did you check if the warnings number of the members are reduced? Do you also want the script to remove those warnings from your database? |
Quote:
|
We are not getting anywhere like that. Of course and the script will not work with no historical data in your database. The program checks to find Inactive warnings, i.e. warnings which have matured and are marked as Inactive. If it does not find any, it will not reduce the number of warnings a member has.
Initially you told me you had Historical on, now you say you turned it off. I can't change the script every day, just because you change your criteria. Sorry. |
Quote:
Maintain Historical Records?If set to No, warnings and bans which expire or are removed, will be deleted and will not show in the user's account. If set to Yes, these records will be kept in the database, but be marked as Inactive. |
Yes, the warnings are removed, and do not show. But how many warnings a user has received is not removed, because the management team wants to know how good a user is. If you do not use historical, you do not see the warnings a member has received, but you still know that that particular user has been warned x times. If you want that removed, just run the following query, it will set all your user warnings to zero
Code:
update user set warnings=0 |
Thanks John, that's what I needed. I won't cause you anymore trouble until I update to 3.5.x :D. Happy Holidays!
|
Well, if you do upgrade to 3.5 then you will not cause any more troubles, since I DO NOT support the 3.5 version, Andreas supports that.
|
All times are GMT. The time now is 08:35 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|