Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-09-05 22:26:24

jan
Member
From: Utrecht, The Netherlands
Registered: 2006-08-31
Posts: 71
Website

How can one enable/disable comments per section

I would like to set comments on or off per section, because I have, for example, a section that is being updated all the time but doesn’t need the ability to receive comments. Disabling comments in general isn’t an option, for that would require ticking comments to ‘on’ every time I update my blog (which I want to be commented), and besides, that leaves the “Commenting is closed for this article” notification.

Anyone?

Yours,

Jan

Last edited by jan (2006-09-05 22:31:42)


Kensington TXP powered rock

Offline

#2 2006-09-05 22:55:17

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: How can one enable/disable comments per section

It’d be fairly easy to write a plugin that does this by manipulating the values of Textpattern variables. See checkComments() in publish/comment.php for the technical details.


Alex

Offline

#3 2006-09-06 00:42:44

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How can one enable/disable comments per section

i.e: this isn’t availble “out of the box”. I don’t think a plugin currently exists for it.

Offline

#4 2006-09-06 07:16:52

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: How can one enable/disable comments per section

Not so quick but dirty solution: If you turn off auto-append comments and remove comment-related tags from the forms and pages for that section you can make it look just like comments were not enabled. It would theoretically still be possible to submit them and get them saved for someone who knows the structure of the comment-forms, but since they wouldn’t be displayed in that section that’s not so much of a problem. Only if you use sth. like recent_comments would those rogue comments be visible (though it’s unlikely someone would go through the trouble of doing that).

Offline

#5 2006-09-06 09:29:44

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: How can one enable/disable comments per section

Just add this to the bottom of your default article form (replacing the section names with the ones you want).

<code><txp:if_section name=“blog,news,etc”><txp:comments_invite /></txp:if_section></code>

Last edited by FireFusion (2006-09-06 09:30:22)

Offline

#6 2006-09-08 23:23:12

jan
Member
From: Utrecht, The Netherlands
Registered: 2006-08-31
Posts: 71
Website

Re: How can one enable/disable comments per section

FireFusion wrote:

Just add this to the bottom of your default article form (replacing the section names with the ones you want).
<code><txp:if_section name=“blog,news,etc”><txp:comments_invite /></txp:if_section></code>

Perfect! Thanks! Problem solved. I wasn’t aware of that tag yet. Practical that the tag accepts a comma separated list of sections…

Last edited by jan (2006-09-08 23:23:41)


Kensington TXP powered rock

Offline

#7 2006-09-10 16:34:48

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How can one enable/disable comments per section

Be aware that would only hide the “Comments” link on an article list. You’d need to also wrap the comments_form tag.

Offline

#8 2008-07-21 17:15:15

gvsmani
New Member
Registered: 2008-07-20
Posts: 3

Re: How can one enable/disable comments per section

I installed Textpattern… and am excited about it. I uploaded an article, but get a message “Commenting is closed for this article” . What should I do, to enable comments ? I was trying to figure out the solution, with replies available on this forum, but havent been able to fix mine, anyway.

Offline

#9 2008-07-21 17:27:27

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,198
Website GitHub Mastodon Twitter

Re: How can one enable/disable comments per section

Hi gvsmani

Go to Admin>Preferences then click your choices under the Comments heading

Then you have to enable comments on a per article basis if the “On by default?” preference is set to “No”


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#10 2008-07-22 16:57:36

gvsmani
New Member
Registered: 2008-07-20
Posts: 3

Re: How can one enable/disable comments per section

Thanks friends. After some jugglery, with the help of your suggestions, I am now getting the message “your_ip_is_blacklisted_by sbl.spamhaus.org”, when I try to click on Comment.

I am baffled… as I am no spammer !!!

Could anyone fix this, please?

gvsmani

Offline

#11 2008-07-22 19:15:01

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: How can one enable/disable comments per section

Hello,

Try going to Admin/Preferences/Advanced and removing “sbl.spamhaus.org” from the Comments preferences Spam Blacklists item. Leave it blank. It may be that your Internet Provider has allocated you to an IP number that is on the Spamhaus blacklist. If that solves the problem, try adding the entry back in a couple of weeks when the lease on the troublesome IP number is up and you have been allocated to another.

Offline

#12 2008-07-23 13:23:47

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: How can one enable/disable comments per section

All

As this is the first time I’ve seen this thread I’d like to take the opportunity to answer the original question posed here — “How can one enable/disable comments per section?”

This will be possible using the latest version of the sed_comment_pack plugin on the upcoming Txp 4.0.7 (or the current development version.)

Last edited by net-carver (2008-07-23 15:34:32)


Steve

Offline

Board footer

Powered by FluxBB