Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


bans of different durations

edited May 2012 in Questions

I would like to be able to have a system to ban people for different durations, with the bans automatically expiring. If there were a mechanism to keep notes on the reason for the bans that would be wonderful. I'm guessing there isn't an add-on for this. Can anyone point me in the right direction to get started with developing this it would be greatly appreciated.

Best Answer

  • peregrineperegrine MVP
    Answer ✓

    the simple soulution would be to use the notes column in the ban table and assign names to groups there

    short is 30 days, medium is 60 days, long is 90 days.

    notes

    short med long

    then write a program that reads the table, convert the dates to seconds

    pseudo code
    
    case short
       if today - (insert date + 30 * 24 * 60 *60) 
       deleteban(id)
    
    case med
       if today - (insert date + 60 * 24 * 60 *60) 
    
    case long
     if today - (insert date + 90 * 24 * 60 *60) 
    

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

Answers

  • peregrineperegrine MVP
    edited May 2012

    there is an option for notes on the reason in the 2.0.18.4 version.

    To develop an expiration - there is a date inserted in the ban table.

    what ever code you write could test whether the date inserted is 60 days old or what ever than it could remove the ban. You could also add a column to the ban table that would be a date offset based on the insert date, when that point is reached the ban would expire. I suppose you could write a little program the executes daily in cron to make the deletion in the ban table when the target is met. That's the extent of what I can suggest. There might be other ways, but this one possible solution.

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • Okay I was not being totally clear. My mistake. What I wanted to do was keep a ban history so Moderators can look over previous bans. I think I will need a new table to manage this. Think I will get to grips with this framework before I start doing anything like that.

Sign In or Register to comment.