Skip to content

feature: auto close/open comments after time period #217

Closed
keram opened this Issue Apr 2, 2012 · 6 comments

4 participants

@keram
keram commented Apr 2, 2012

it's one from 'standard' features and helps against some spambots

@parndt
Refinery member
parndt commented Apr 2, 2012

How could this be practically implemented? There would have to be a resque in the background.

Personally I think a better tactic might be to add moderation links to the emails per #205 so that these don't sit around.

@keram
keram commented Apr 2, 2012

i do not know how is implemented by others, but me simplest solution is:

extended the model of the blog post flag Post.comments_open = true/false ( if there is not)
add 2 Global Settings: AutoCloseComments = true / false
and AutoCloseCommentsAfter = 'some datetime range (default 3 months)'

add a condition on display form and save comment such as:

if (Post.comments_open AND (!Blog::Settings::AutoCloseComments OR Post.publish_time + Blog::Settings::AutoCloseCommentsAfter > Time.now()) ){
  # save / show form
else
  if Post.comments_open
    Post.close_comments()
  end

  ...
end

of course any other improvements such #205 would by appreciated too :)

@phiggins
phiggins commented Apr 3, 2012

How could this be practically implemented?

Adding a "maximum age" configuration setting and then conditionally rendering the comment form when the blog post is viewed seems relatively straightforward. Storing the status of the comments in the database seems a bit overkill to me.

@parndt
Refinery member
parndt commented Apr 3, 2012
@keram
keram commented Apr 4, 2012

Adding a "maximum age" configuration setting and then conditionally rendering the comment form

yep, this could be currently good and acceptable implementation for users/clients

@robyurkowski

@keram feel like making this a reality for us? :D

@parndt parndt closed this Nov 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.