Plugins & Hacks

How can I allow comments for a blog, but have them disabled by default?

Scenario:
"I want my blog by default to have commenting for a post turned off, unless a blogger decided to turn them on for a particular post."

Solution:
Change the default option for "Disable Comments?" in the "Add Item" admin page to "Yes", so if bloggers don't specifically enable commenting, it will be disabled by default.

Original forum thread:
http://forum.nucleuscms.org/viewtopic.php?t=6807

Method:

  1. Open up the file "admin-add.template" in your /nucleus/libs/include/ directory. Be very careful about what you change in here because Nucleus needs these files!!
  2. Find this section of code:
    <%ifblogsetting(bcomments)%>
      <td><%text(_ADD_DISABLE_COMMENTS)%></td>
      <td>
       <input name="closed" type="radio" tabindex="30" value="1" id="closed_yes" /><label for="closed_yes"><%text(_YES)%></label>
       <input name="closed" type="radio" tabindex="30" value="0" checked="checked" id="closed_no" /><label for="closed_no"><%text(_NO)%></label>
      </td>
     </tr><tr>
    <%endif%>
  3. The simplest way to do it is to display the "Disable Comments?" option on all "Add Item" pages with "Yes" as the default option by replacing it with this code:
    <td><%text(_ADD_DISABLE_COMMENTS)%></td>
    <td>
     <input name="closed" type="radio" tabindex="30" value="1" checked="checked" id="closed_yes" /><label for="closed_yes"><%text(_YES)%></label>
     <input name="closed" type="radio" tabindex="30" value="0" id="closed_no" /><label for="closed_no"><%text(_NO)%></label>
    </td>
    </tr><tr>
  4. Save the file.

WARNING: If you have some blogs on which you NEVER want anyone to be able to enable comments on, do NOT use this method as it makes setting "Comments enabled?" in the individual blog settings useless. Use one of the more complicated methods outlined in the forum post under "Further Reading" or have yourself as the only team member on those blogs.

Further Reading:
For more complicated ways of manipulation this, see this forum post:
http://forum.nucleuscms.org/viewtopic.php?p=34619#34619

section: Plugins & Hacks | submitted by Leng on 2005.Apr.24 | 3732 views

item rate
Total votes: 6 - Rating: 9.17

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10