Skip to Content.
Sympa Menu

lyceum-users - [Lyceum-users] what's the mysql command to change comment status

lyceum-users AT lists.ibiblio.org

Subject: Lyceum-users mailing list

List archive

Chronological Thread  
  • From: bai.xiaoyu AT gmail.com
  • To: lyceum-users AT lists.ibiblio.org
  • Subject: [Lyceum-users] what's the mysql command to change comment status
  • Date: Fri, 21 Sep 2007 12:23:01 +0800

Is this the correct mysql command to change comment status

update posts set comment_status = 'registered_only'
# also available value: open , closed

It doesn't work for me. After using that, all posts comment_status became
blank.

I want to change comment status all the posts currently in the
database to registered_only, therefore, only registered users can
comment. New posts will still inherent the default comment_status
value which is _ open _ , which is my prefered value for new posts.

Thanks in advance!

Some more help request:

1. What if I want to change comment_status default value? How to do that?

2. I think one can do more, e.g change comment status of posts older
than 3 months to registered only or closed.

One can get post published date in post_date post_date_gmt .

What could be make more sense is to use the value post_modified,
because if an author updated a post recently, she probably expect some
more comment.

How to write the sql command

update posts set comment_status = 'registered_only' where
# where posts hasn't been modified for 3 months or a week,
# whatever

3. Combine that sql command with a cron, we get a comment closer plugin.

I am proposing somebody write one ;) No rush.

But, i want a quick dirty tip of how to change comment status all the
posts currently in the database to registered_only, NOW :)



  • [Lyceum-users] what's the mysql command to change comment status, bai . xiaoyu, 09/21/2007

Archive powered by MHonArc 2.6.24.

Top of Page