Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
keram opened this Issue · 6 comments

4 participants

@keram

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

@parndt
Owner

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

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

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
Owner
@keram

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
Collaborator

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

@parndt parndt closed this
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.