Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-14 17:29:46

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

Auto-disable comments after more than 6 weeks

Don’t think there’s a plugin to modify such a preference: is there a way to tell txp to automatically close comments after an amount of time larger than 6 weeks? In my case, 6 months (or a year) would be perfect…

Thanks in advance


Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com

Offline

#2 2009-01-14 18:10:39

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Auto-disable comments after more than 6 weeks

In the txp_prefs table, you can find a row where name=‘comments_disabled_after’. That’s the number of days that comments are allowed. Setting that to 365 would keep comments open for a year. To avoid this value from being changed each time you save something on the preferences tab, you’d have to change the value in the type column for that preference from 0 to 2, which hides the preference.

Offline

#3 2009-01-15 11:33:21

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

Re: Auto-disable comments after more than 6 weeks

ruud wrote:

In the txp_prefs table, you can find a row where name=‘comments_disabled_after’. That’s the number of days that comments are allowed. Setting that to 365 would keep comments open for a year. To avoid this value from being changed each time you save something on the preferences tab, you’d have to change the value in the type column for that preference from 0 to 2, which hides the preference.

Thanks ruud, I’ll give it a try.
Anyway, i think it would be much more useful (and safe, i guess!) to modify in some way the options in the preferences. Best thing would be to change, say, 1 -> 6 weeks in 1 -> 6 months. Which lines of which file should I modify to achieve this result?


Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com

Offline

#4 2009-01-15 15:56:19

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Auto-disable comments after more than 6 weeks

I’d recommend against changing TXP code, because that would make upgrading more difficult.

Offline

#5 2009-01-15 16:00:55

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

Re: Auto-disable comments after more than 6 weeks

Uhm, You’re not completely wrong, i guess… :)


Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com

Offline

#6 2009-01-15 16:43:33

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Auto-disable comments after more than 6 weeks

Could a plugin do it?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#7 2009-01-15 16:46:43

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

Re: Auto-disable comments after more than 6 weeks

MattD wrote:

Could a plugin do it?

Sure, but currently there’s no such a plugin…


Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com

Offline

Board footer

Powered by FluxBB