<<

NAME

MT::App::Comments

SYNOPSIS

The application-level callbacks of the MT::App::Comments application are documented here.

METHODS

$app->init

Initializes the application and defines the serviceable modes.

$app->init_request

Initializes the application to service the request.

$app->do_preview($cgi[, $err])

Handles the comment preview request and displays the preview using the Comment Preview blog template. If $err is specified, the error message is relayed to the user using the Comment Error blog template.

$app->blog

Returns the MT::Blog object related to the entry being commented on.

$app->eval_comment

Evaluates the comment being posted in a variety of ways and an MT::Comment object is returned. If the comment request is rejected due to throttling, no object is returned and the Comment Pending blog template is displayed.

$app->handle_error

Returns an error message to the user using the Comment Error blog template.

APPLICATION MODES

$app->commenter_name_js

Returns some JavaScript code that sets the 'commenter_name' variable based on the 'tk_commenter' cookie that is accessible to the comments CGI script.

$app->do_red

Handles a commenter URL redirect, where the comment_id points to a MT::Comment object with a URL. The response redirects the user to that URL. The comment must be approved and published.

Note: This behavior has been deprecated in favor of using the 'nofollow' plugin.

$app->handle_sign_in

Handles the sign-in process for a sign-in request handled by external such authentication APIs as TypeKey and OpenID.

$app->post

Mode that handles posting of a new comment.

$app->preview

Mode for previewing a comment before posting.

$app->view

Mode for displaying a dynamic view of comments for a particular entry.

CALLBACKS

CommentThrottleFilter

Called as soon as a new comment has been received. The callback must return a boolean value. If the return value is false, the incoming comment data will be discarded and the app will output an error page about throttling. A CommentThrottleFilter callback has the following signature:

    sub comment_throttle_filter($cb, $app, $entry)
    {
        ...
    }

$app is the MT::App::Comments object, whose interface is documented in MT::App::Comments, and $entry is the entry on which the comment is to be placed.

Note that no comment object is passed, because it has not yet been built. As such, this callback can be used to tell the application to exit early from a comment attempt, before much processing takes place.

When more than one CommentThrottleFilter is installed, the data is discarded unless all callbacks return true.

CommentFilter

Called once the comment object has been constructed, but before saving it. If any CommentFilter callback returns false, the comment will not be saved. The callback has the following signature:

    sub comment_filter($cb, $app, $comment)
    {
        ...
    }

SPAM PROTECTION

Spam filtering (or "Junk" filtering in MT terminology) is handled using the MT::JunkFilter package and plugins that implement them. Please refer to that module for further documentation.

AUTHOR & COPYRIGHT

Please see the MT manpage for author, copyright, and license information.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 2117:

You forgot a '=back' before '=head1'

Around line 2127:

=back without =over

<<