Help - Search - Members - Calendar
Full Version: MTCloseComments closing all comments
Movable Type Community Forum > Additional Resources > Plugin Development and Usage
ladymisstree
I've just installed MTCloseComments and it's been too efficient! I set it to close comments on entries older than 7 days and inactive for the last three.

The most recent entry on my blog was older than 7 days, but had had three comments today. So comments should be open on it. But they were closed.

What have I done wrong? I've copied the code as it's displayed on the page:

CODE
<MTCloseComments old="7" inactive="3">


and placed it at the top of the page, and the plugin is in the correct directory.

Have I misunderstood this command to mean closing comments on entries seven days old OR inactive for the last three days? I assumed it was seven days old AND inactive for three.
jayseae
I didn't write this plugin, so I don't know for certain - but it appears to use "and" logic, so that if the comment is older than seven days, and if it has been inactive for more than your choice (3 days in this case), it should be closed. Your example seems to indicate that this isn't the case, however.

I think this is because the "inactive" check actually looks at the "modified" date of the entry. This value doesn't change if a comment is left. This is probably causing the problem you see. In reality, it makes it more of an "unchanged" setting, as opposed to "inactive".

For instance, you create an entry one week ago. The "created on" date is 20050124... and the "modified on" date is also 20050124.... If you edit the entry to fix a spelling error the next day, your "created on" date stays the same, but the "modified on" date becomes 20050125.... Does that make sense?

That date is the one that is being checked for inactives, when in reality it probably ought to check for the most recent comment date. The problem with that, I would assume, is the logic - it becomes a much more complicated join process (or at least a processing through of each record to check comments) to see what needs to happen - and also potentially causing a huge can of worms if you'd like to keep the converation running, even if there is a gap larger than 3 days.

You may want to contact the author, to see if they have addressed this deficiency. The page hasn't been updated since the middle of last year, so I'd suspect not - but I really don't know for certain. Because it's SQL, and not using the MT::Object class, it seems that this would be harder than they have made it.

Another option you have is to use another plugin - perhaps something like my own MT-Moderate - that simply moderates the comments, rather than closing the comments. Then you'd need to go in and approve them. This, of course, requires MT 3.1 or greater, and you didn't mention which version you are using.

Hope this helps!
ladymisstree
Ahhh, that might explain the problem. Bugger.

I'm using MT 2.661 at the moment, so I can't use your lovely plugin. But thanks for the offer.

In my searches for an answer to this, I noticed that the author of this plugin responded to a post earlier this month, so I'm hoping he notices this one and can help me.

Thanks again!
Annoying Old Guy
You can do this, but you have to tweak MT code. See the documentation under "Installation", section 3.

Someday soon I'll be working on this again, but it's likely to only work for MT 3.1. This project was basically a quick fix to an immediate problem. Much more can be done with the new plugin support in 3.1.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.