Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > Advanced Warning System (AWS)
FAQ Community Calendar Today's Posts Search

Closed Thread
 
Thread Tools
Purge "number" of warnings? Details »»
Purge "number" of warnings?
Version: , by beano33 beano33 is offline
Developer Last Online: Sep 2016 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 12-08-2005 Last Update: Never Installs: 0
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-11-2005, 05:58 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Attached Files
File Type: (21.4 KB, 5 views)
  #3  
Old 12-12-2005, 04:07 PM
beano33 beano33 is offline
 
Join Date: Feb 2003
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sv1cec
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.
I ran the script trying for the first option - "reduce the warnings of a member for those warnings which had MATURED xx days before today", and no warnings were removed.

I changed the comment outs as shown here-
PHP Code:
// UNCOMMENT ONLY ONE OF THE LINES BELOW.
        
        
$date=$warn['removed_date']+$vboptions['warn_alertslifetime']*24*60*60;
        
//$date=$warn['warned_time']+$vboptions['warn_alertslifetime']*24*60*60; 
My alerts have a 5 day expiration time. Does that need to be entered somewhere? Thanks!
  #4  
Old 12-12-2005, 04:14 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
  #5  
Old 12-12-2005, 04:47 PM
beano33 beano33 is offline
 
Join Date: Feb 2003
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sv1cec
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?
Alerts are set up in AWS Options (great feature BTW). It's not working with the line commenting done as I posted.
  #6  
Old 12-12-2005, 05:26 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
  #7  
Old 12-12-2005, 06:10 PM
beano33 beano33 is offline
 
Join Date: Feb 2003
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sv1cec
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?
I have historical warnings off now, but the old warning number still shows for the users. I'm trying to get that so it's the same as the number of unexpired warnings, or alternatively just reset everyone's warning number to zero so we can start fresh with warning number as a ban critera. The warning number hasn't been reduced for any of the members I checked, even though the expired ones no longer show.
  #8  
Old 12-12-2005, 06:49 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
  #9  
Old 12-12-2005, 07:16 PM
beano33 beano33 is offline
 
Join Date: Feb 2003
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sv1cec
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.
I changed it because no one responded to my post for 2-3 days. I realize your time is limited, as is mine, but this absolutely had to be dealt with as I was getting dozens of complaints. I ended up removing it from the template to calm the angry masses, but I'd still like make it functional. I assumed from the AWS menu text that the warnings would be removed by turning off historical warnings so that was a logical step to take.

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.
  #10  
Old 12-12-2005, 07:39 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
add the table prefix in front of the table name (user) if you are using one. That will reset all your user warnings to zero.
Closed Thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:06 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
  • Page Generation 0.04495 seconds
  • Memory Usage 2,320KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete