W09

After Comments In Progressmany moons of bickering and looking around, I decided to take up the gloves and do it myself. Currently I’m using a slightly altered script that ‘automatically’ folds and closes comments after 10 days. This generally works good and has stopped the flow of sapm directed at the comments. However, I’m lacking precise control, that is, I’d like to have some posts to keep their comments available for a longer time.

You’ll find some of these plugins in the WordPress repository, but most of them make no sense and work rather not really good1.

I also noticed something funny in queries of existing plugins where in the code roundabout attempts are made to make a selection first and then pass the resultset to an ‘update’ statement: hey rookies, the following statement is ‘legal’ SQL:

update wp_posts
set ping_status = 'closed'
where post_date < DATE_ADD( DATE_SUB(CURDATE(), INTERVAL 4 month), INTERVAL 1 DAY);

On the other hand, using subselects in MySQL should generally be avoided. There's no real consensus around which MySQL version supports subselects. 4.xx maybe. 3.23 maybe. Who knows!

On a related note, I see that there's a new WP version out.

1 That is an understatement.

This entry was posted in SQL, Wordpress. Bookmark the permalink.

2 Responses to W09

  1. alfons says:

    Will it work with WP 1.0?

  2. Arthur says:

    Yes. NO. I don’t know. It works with 1.5. I think.

Comments are closed.