Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Discussion Expiry

edited May 2007 in Vanilla 1.0 Help
An option to set a message to "expire" on a certain day. We use the forum internally for things like shift swaps and company notices and the board can get really cluttered with old posts. I think it would be sweet to have a discussion set to expire when it is no longer relevant. That post could either be set to close, sink, or hide/delete.

Would anyone else find this useful? Any takers on developing one? I am going to try but I am very new to PHP and this may be out of my scope.

Comments

  • Yes, love it.

    My example: I post info on events that repeat yearly. It would be great to auto-expire
    those posts after 240 days, just so there will be less confusion about the 2007 or 2008
    event (especially in Vanilla where old discussions are easily 're-posted' to the home page
    with one new comment.
  • edited May 2007
    I also need this for my blog extension. Autoclose blog posts after a month so no new comments can be added.
    I cannot seem to figure out when do i make that check. Check it when the record is pulled from the database. If the posted data is 30 days older than the current day then Its closed on the spot. Or I do I run a automatic script that checks the database once a day and closes old posts.

    if u make a mockup of the interface. I'll make an extension of it.
  • edited May 2007
    This is what I envision.

    image

    Ideally, I figure there would be an option menu under Settings that would allow you to select the Categories its enabled for (eg: enable for event listings, disable for General Discussion.) but I think that would be more complicated.
    Another possible option would be what choices are available for the change (eg: Closed, Sink, Deleted) and maybe what roles have access.

    With that said, even a basic version would be handy.
  • edited May 2007
    any idea where to get the calender widget
    i was thinking discussion expires after X days. which is real easy to do. plus u will be able to assign a default value of 30 days for eg.

    to do the way in the mockup. 95% of the code will be to make the calender and 5% to do what the extension is supposed to do

    what happens u edit a closed discussion. Should u be allowed to change the time or only admins can do that
    What happens when u change ur mind about a particular category not having expiration date. and tons of ur posts for that category already have expirations on them.
  • edited May 2007
    Well there are two that use jquery (http://kelvinluck.com/assets/jquery/datePicker/ , http://marcgrabanski.com/code/jquery-clean-calendar/ ).

    If that just complicates things, a text field could be fine with a (MM/DD/YYYY) to the side. Not as user-friendly, but an option. Or just go with a drop down ;) I just think it would be a great Add-on either way.

    Re Editing, I guess run a check when resubmitted and if the date is now in the future, change the status back to normal. I am not sure really since this is still all pretty new to me.
    ...Although if you close someones discussion, they could reopen it just by adding a future expire date. Hmmm I would say the date would have to be edited my a Moderator/admin. OR, even better. Can we create other statuses in addition to the four (sticky, closed, sink, deleted)? If so, a status of "expired" would solve that. Especially if you could hide expired from view.

    Re Categories. I would disregard that as an option since I think it just adds too many layers of what-ifs

    Update: Here are a couple more

    http://www.mattkruse.com/javascript/calendarpopup/ (second and 4th seem best for this)
    http://www.javascriptkit.com/script/script2/epoch/index.shtml (last one "Date picker calendar")
    http://developer.yahoo.com/yui/examples/calendar/formtxt/2.html (from Yahoo's Code)
  • edited May 2007
    You cannot have a column of Expired. cause Vanilla isn't aware of it, and won't use that column. This extension will put a 1 in the closed field. Once that is done. Vanilla knows what to do with it. If a new column is added. Vanilla won't know what to do with that column.

    users should not be allowed to reopen once its closed.

    I like the calender examples. I'm picking the calender popup example 5. It has a nice blocking code, to block out all dates before Today. So users won't mess things up by selecting a previous date than posting date.
  • edited May 2007
    It would essentially be the same as/behave as "closed/sink/deleted" but having it separate would avoid issues with moderators since there could be a loophole. Here is an example:

    Problem without a separate classification.
    *Moderator makes a discussion 'closed'.
    *User edits their discussion and changes expiration to some date in the future
    *That re-establishes the discussion as 'open' and thus the loophole

    Fix with 'expired' classification
    *Moderator makes a discussion 'closed'.
    *Discussion 'expires' (discussion now 'closed' and 'expired')
    *User edits their discussion and changes expiration, that removes the 'Expired' tag but it remains 'closed'.

    So basically ignore the "and changes to" option in my mockup. The best way would be to have an option in the settings to have 'expired' behave as 'deleted' (hidden), 'closed' (no comments), or 'sink' (comments allowed)
  • edited May 2007
    How about once the discussion is autoclose, the users don't have a way to change the date. Its greyed out. or its not there anymore.
    the expiration selection only appears on nonclosed discussions.

    Moderators can unclose the discussion. when that happens the expiration thingy appears again and moderator can put in a new date.
    Deleted is no good. then people won't find discussions they posted. what if that discussion has imp info for others. and now no one can find it . It has to be closed. So its still visible and searcable
  • ok 90% done.
    There is one CSS issue I can't seem to solve. the calender icon is appearing below the input field rather than next to it.
    Once Someone tells me how to store NULL in the database. I'll upload the extension for testing
  • Sweet! Nice work man. I can't wait to see it.
  • edited May 2007
    OK all done now. I can release it now.
    But wallphone suggested i add support for verbose dates like "Next month" or "next friday" using strtotime() function. I'll try if i can't do it i'll release what i have now.

    what u can do to help is make a nice colored table
    I'm using this date picker
    http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/

    it comes with a butt ugly table colors
    make the colors like this calendar from Veerle
    http://veerle.duoh.com/blog/comments/a_css_styled_calendar/

    u just have to change the color values in the css. thats all. do that and whisper me the css
  • Ok cool. That should be within my realm of ability ;)

    I am in meeting all day until 11pm EST so I will tackle it then.
  • ok one last thing. a new name right now its called Discussion Expiration
  • How about "Dan"

    Why not? Works for Squirrel
  • Squirrel is just a bad name. I have no idea what it does. Either Auto Close Discussions or Discussion Expiration
  • i vote for discussion expiration expiry works too, i like that word:)
  • Discussion Expiration works for me. Did the CSS work ok? I was half asleep when I did it.
  • have to make some changes to the css. All dates that are blocked should have a cross on them.
  • I was attempting at making a joke on naming schemes. Suggesting an actual name, as Squirrel did with his extensions: Janine and Mary.
This discussion has been closed.