stash('blog'); if (!($blog['blog_allow_reg_comments'] || $blog['blog_allow_unreg_comments'])) { return ''; } $cfg =& $ctx->mt->config; $path = $cfg['CGIPath']; $path = preg_replace('|([^/])$|', '$1', $path); $comment_script = $cfg['CommentScript']; $e =& $ctx->stash('entry'); if (!$e) { return $ctx->error('No entry available'); } $entry_id = $e['entry_id']; $signon_url = $cfg['SignOnURL']; $allow_comment_html_note = (($blog['blog_allow_comment_html']) ? $ctx->mt->translate("(You may use HTML tags for style)") : ""); $needs_email = $blog['blog_require_comment_emails'] ? "&need_email=1" : ""; $registration_required = ($blog['blog_allow_reg_comments'] && !$blog['blog_allow_unreg_comments']); $registration_allowed = $blog['blog_allow_reg_comments']; $unregistered_allowed = $blog['blog_allow_unreg_comments']; $static_arg = $args['static'] ? "static=1" : "static=0"; $static_field = ($args['static'] || !isset($args['static'])) ? ('') : (''); $typekey_version = $cfg['TypeKeyVersion']; $comment_author = ""; $comment_email = ""; $comment_text = ""; $comment_url = ""; if ($args['preview']) { $ctx->localize(array('tag')); $ctx->stash('tag', 'Preview'); require_once("MTUtil.php"); $comment_author = encode_html($ctx->tag('CommentAuthor')) || ""; $comment_email = encode_html($ctx->tag('CommentEmail')) || ""; $comment_text = encode_html($ctx->tag('CommentBody',array('convert_breaks'=>0))) || ""; $comment_url = encode_html($ctx->tag('CommentURL')) || ""; $ctx->restore(array('tag')); } global $_typekeytoken_cache; $blog = $ctx->stash('blog'); $blog_id = $blog['blog_id']; $token = 0; if (isset($_typekeytoken_cache[$blog_id])) { $token = $_typekeytoken_cache[$blog_id]; } else { $token = $blog['blog_remote_auth_token']; if ($token) { $_typekeytoken_cache[$blog_id] = $token; } else { # look for authors with permissions for this blog and return # the first that has a token $token = $ctx->mt->db->get_author_token($blog_id); $_typekeytoken_cache[$blog_id] = $token; } } $rem_auth_token = $token; if (!$rem_auth_token && $registration_required) { return $ctx->error("To enable comment registration, you need to add a TypeKey token " . "in your weblog config or author profile."); } $tk_version = $cfg['TypeKeyVersion']; if ($registration_required) { #return MT->translate_templatized(<
$allow_comment_html_note