0byt3m1n1
Path:
/
data
/
0
/
0
/
6
/
46
/
6861
/
user
/
7034
/
cgi-bin
/
mt
/
docs
/
[
Home
]
File: mtmanual_comments.html
<html> <head> <title>COMMENTS</title> <link rel="stylesheet" href="doc-styles.css" type="text/css"> </head> <body> <h3>Movable Type User Manual: COMMENTS</h3> <p><a href="mtmanual.html">« Table of Contents</a></p> <a name="__index__"></a> <ul> <li><a href="#comments">COMMENTS</a></li> <ul> <li><a href="#comment previewing">Comment Previewing</a></li> <li><a href="#comment submission errors">Comment Submission Errors</a></li> <li><a href="#comment management">Comment Management</a></li> <ul> <li><a href="#registered comments">Registered Comments</a></li> <li><a href="#comment moderation">Comment Moderation</a></li> </ul> <li><a href="#enabling comment registration">Enabling Comment Registration</a></li> </ul> </ul> <hr size="1" color="#CCCCCC"> <p> <h1><a name="comments"></a>COMMENTS</h1> <p>Movable Type features a built-in comment system. You can edit existing comments by visiting the <i>Comments</i> area of your weblog, or you can view those associated with a particular entry on the <i>Edit Entry</i> screen for that entry. In either area, you can delete comments by checking their checkboxes, then clicking <code>DELETE CHECKED</code>.</p> <p>The default templates that ship with Movable Type are comment-ready; in other words, you should be able to use comments in your weblog without editing any of the comment templates at all. The default templates are set up so that comments appear on both the popup comment window (linked from the <i>Main Index</i> template) and the individual archive pages. You can alter this behavior by altering the appropriate templates.</p> <p>Movable Type's comment system can be used in either of two ways (or both):</p> <ul> <li><strong><a name="item_Inline"></a>Inline</strong><br> If you use individual entry archives (see <a href="./mtmanual_archiving.html">ARCHIVING</a>), each archive page can include the comments on that particular entry. For example, you might use a template something like this: <pre><p><font class="title"><$MTEntryTitle$></font></p> <$MTEntryBody$> <MTComments> <$MTCommentBody$> <font class="post">Posted by <$MTCommentAuthorLink$>.</font><br><br> </MTComments> </pre><p>In fact, the default <i>Individual Entry Archive Template</i> contains this same structure.</p> <p></p> <li><strong><a name="item_Popup_Windows"></a>Popup Windows</strong><br> If you use any other type of archiving--in other words, a type of archiving where more than one entry is on an archive page--it may not make as much sense to include the comments inline. In that case, Movable Type supports dynamically-built popup windows for your comments (&agrave; la Blog Voices and others). The default templates that ship with Movable Type support popup comments automatically with code like this in the <i>Comment Listing</i> template: <pre><MTComments> <$MTCommentBody$> <font class="post">Posted by <$MTCommentAuthorLink$>.</font><br><br> </MTComments> </pre><p>The following Javascript function is used to link to the comment popup window:</p> <pre><script language="javascript"> function OpenComments (c) { window.open(c, 'comments', 'width=480,height=480,scrollbars=yes,status=yes'); } </script> </pre><p>And the following code invokes the Javascript function:</p> <pre><MTEntryIfAllowComments> <a href="<$MTCGIPath$><$MTCommentScript$>?entry_id=<$MTEntryID$>" onclick="OpenComments(this.href); return false">Comments (<$MTEntryCommentCount$>)</a> </MTEntryIfAllowComments> </pre><p></p></ul> <p>Of course, in either of these scenarios, you will also want to provide a form for users to enter new comments. That form can look something like this:</p> <pre><form method="post" action="<$MTCGIPath$><$MTCommentScript$>"> <input type="hidden" name="entry_id" value="<$MTEntryID$>"> Name: <input name="author"><p> Email Address: <input name="email"><p> URL: <input name="url"><p> Body: <textarea name="text" rows="10" cols="50"></textarea><p> <input type="submit" name="preview" value="PREVIEW"> <input type="submit" name="post" value="POST"> </form> </pre><p>If you are using static/inline comments, note that the sample form above will require the addition of one more hidden input field:</p> <pre><input type="hidden" name="static" value="1"> </pre><p>This tells the comments system that you are using inline comments, which will force a rebuild of the entry archives and of the index pages for your weblog, after a new comment is posted.</p> <p>Note that in either scenario--inline comments or popup comments--your index pages will be rebuilt after a new comment is added; this is to update the count of the number of comments on the entry (see the <code>MTEntryCommentCount</code> tag, in <a href="./mtmanual_tags.html">TEMPLATE TAGS</a>). In addition, if you are using inline comments, your archive pages for the entry will be rebuilt; this is to add the new comment to your individual entry archive page for the entry.</p> <p> <h2><a name="comment previewing"></a>Comment Previewing</h2> <p>Comment previews are built into Movable Type, so that your visitors can preview their comments before posting. Support for previews ships with the default templates built into the system; you can remove this support, if you wish, by removing the <code>PREVIEW</code> button from the comments form. The layout of the comment previews is defined using the <code>Comment Preview</code> template. You can use the <code><$MTCommentPreview*$></code> tags, along with the global tag attribute <code>encode_html</code>, to create an editable comment preview form; this allows users to preview their comment, then edit the comment being previewed, then post the comment. The default templates have an example of an editable comment preview template.</p> <p>When creating an editable comment preview template, you should always paste this hidden input field into the forms in your <code>Comment Preview</code> and <code>Comment Error</code> templates:</p> <pre><input type="hidden" name="static" value="<$MTCommentPreviewIsStatic$>"> </pre><p>This is a magical tag that tells the system whether a user is posting a comment from your individual archives, or from the comment popup window, so that the user can be redirected to the proper page after posting a comment.</p> <p>You can also list all of the previous comments posted to the entry, using the standard <MTComments> container tag:</p> <pre>Previous comments: <MTComments> <$MTCommentBody$> Posted by <$MTCommentAuthorLink$> at <$MTCommentDate$> </MTComments> </pre><p> <h2><a name="comment submission errors"></a>Comment Submission Errors</h2> <p>If an error occurs when a comment is submitted--for example, if you have disallowed anonymous comments, and the user does not supply a name or email address--you can customize the error page that the user receives using the <code>Comment Error Template</code>. You can use this template to provide a form where users can fix whatever error has occurred in their submissions, then re-post (or preview) the comment. The default templates have an example of a <code>Comment Error Template</code> ( <a href="http://www.movabletype.org/default_templates.shtml">http://www.movabletype.org/default_templates.shtml</a> ).</p> <p> <h2><a name="comment management"></a>Comment Management</h2> <p>Comments can be managed by clicking the ``COMMENTS'' button on the left-side menu of a weblog. This screen will display all the comments to your weblog in chronological order, and you can page through them. Beside each comment is a symbol that indicates whether the comment was placed by a registered commenter and, if so, what the commenter's status is. If it was placed by an unregistered commenter, it will indicate whether that comment is awaiting approval.</p> <p>This screen also allows you to approve and reject commenters and to approve and reject moderated comments. These features are useful if you have enabled ``Allow comments from registered users'' or ``Moderate comments from unregistered users'' in your weblog configuration.</p> <p>You can also check the checkbox next to one or more comments on this screen and delete them by clicking the ``Delete Comments'' button at the bottom of the screen.</p> <p> <h3><a name="registered comments"></a>Registered Comments</h3> <p>When registered comments are allowed on your site, you have the option to approve each new commenter when she or he posts a first comment. Until you've approved a commenter, his or her comments will not be displayed on the weblog, but after approval, that user's comments will appear as soon as they are posted. This way, you can control the community of people who comment on your site, without managing each individual comment.</p> <p>On the comment listing screen, you'll see colored buttons by each new registered commenter which allow you to ``Approve User'' or ``Ban User''. If you approve, all of that commenter's comments to date will appear on your weblog, and future comments will appear immediately. If you ``bane'', the commenter's comments to date will be deleted and future comments from that person will be disallowed.</p> <p>Once you have approved or banned a commenter the first time, you still have the option to change that commenter's status later on. When you return to the comment listing screen, you'll see a button next to the commenter's name which will allow you to approve (or ban) <i>future</i> comments from that person. Once the user has been approved or banned the first time, clicking ``approve'' or ``ban'' doesn't affect any comments to date; it only affects whether that account is allowed to post in the future.</p> <p>Registered commenters are also listed in the <i>Commenters</i> area of your weblog. You can always approve or ban a commenter through this screen, even if there are no comments associated with that commenter.</p> <p> <h3><a name="comment moderation"></a>Comment Moderation</h3> <p>If you enable unregistered comments for your weblog, you may still wish to have some control over the comments that are posted. Comment moderation means that comments won't appear on the site until you approve them individually.</p> <p>To approve moderated comments, go to the Comments screen and click the ``Approve comment'' button beside each comment that you want to approve.</p> <p> <h2><a name="enabling comment registration"></a>Enabling Comment Registration</h2> <p>To accept comments from registered users, go into <i>Weblog Config</i>, then <i>Preferences</i>, then select the checkbox ``Accept Comments from Registered Visitors''. This should unfold a subordinate set of checkboxes and input fields.</p> <p>You'll also need to insert a TypeKey token into the field that appears when you've selected this checkbox. To sign up for a free TypeKey account, visit the TypeKey website at www.typekey.com. The <i>token</i> is a string of 20 characters that identifies your weblog to the TypeKey authentication service. You'll also need to let TypeKey know the URL of your weblog. To do so, log in to your TypeKey account and follow the instructions on that screen.</p> <p>To find more information about the other comment registration options, see <a href="./mtmanual_weblog_config.html#item_accept_comments_from_registered_visitors">``Comment Registration Configuration''</a></p> <hr size="1" color="#CCCCCC"> <span class="copyright">Copyright © 2001-2004 Six Apart. All Rights Reserved.</span> </body> </html>