Use comment_form(). Props beaulebens. see #9015

git-svn-id: http://svn.automattic.com/wordpress/trunk@13031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-02-08 21:02:08 +00:00
parent b34fd9b448
commit 152304f1e1
1 changed files with 2 additions and 62 deletions

View File

@ -49,66 +49,6 @@
<?php endif; ?>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<?php comment_form(); ?>
<div id="respond">
<h3 id="reply-title"><?php comment_form_title( __('Leave a Reply', 'twentyten'), __('Leave a Reply to %s', 'twentyten') ); ?> <small><?php cancel_comment_reply_link( __('Cancel reply', 'twentyten') ); ?></small></h3>
<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
<p><?php printf( __('You must be <a href="%s">logged in</a> to post a comment.', 'twentyten'), wp_login_url( get_permalink() ) ); ?></p>
<?php else : // here's the big comment form ?>
<form action="<?php echo site_url('wp-comments-post.php'); ?>" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p id="login"><?php printf(__('<span class="loggedin">Logged in as <a href="%1$s" title="Logged in as %2$s">%2$s</a>.</span> <span class="logout"><a href="%3$s" title="Log out of this account">Log out?</a></span>', 'twentyten'),
admin_url('profile.php'),
wp_specialchars($user_identity, true),
wp_logout_url(get_permalink()) ) ?></p>
<?php else : ?>
<p id="comment-notes"><?php _e('Your email is <em>never</em> published nor shared.', 'twentyten') ?> <?php if ($req) _e('Required fields are marked <span class="required">*</span>', 'twentyten') ?></p>
<div id="form-section-author" class="form-section">
<div class="form-label"><label for="author"><?php _e('Name', 'twentyten') ?></label> <?php if ($req) _e('<span class="required">*</span>', 'twentyten') ?></div>
<div class="form-input"><input id="author" name="author" type="text" value="<?php echo esc_attr($comment_author) ?>" size="30" tabindex="3" /></div>
</div><!-- #form-section-author .form-section -->
<div id="form-section-email" class="form-section">
<div class="form-label"><label for="email"><?php _e('Email', 'twentyten') ?></label> <?php if ($req) _e('<span class="required">*</span>', 'twentyten') ?></div>
<div class="form-input"><input id="email" name="email" type="text" value="<?php echo esc_attr($comment_author_email) ?>" size="30" tabindex="4" /></div>
</div><!-- #form-section-email .form-section -->
<div id="form-section-url" class="form-section">
<div class="form-label"><label for="url"><?php _e('Website', 'twentyten') ?></label></div>
<div class="form-input"><input id="url" name="url" type="text" value="<?php echo esc_attr($comment_author_url) ?>" size="30" tabindex="5" /></div>
</div><!-- #form-section-url .form-section -->
<?php endif; // if ( $user_ID ) ?>
<div id="form-section-comment" class="form-section">
<div class="form-label"><label for="comment"><?php _e('Comment', 'twentyten') ?></label></div>
<div class="form-textarea"><textarea id="comment" name="comment" cols="45" rows="8" tabindex="6"></textarea></div>
</div><!-- #form-section-comment .form-section -->
<div id="form-allowed-tags" class="form-section">
<p><span><?php _e('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'twentyten') ?></span> <code><?php echo allowed_tags(); ?></code></p>
</div>
<?php do_action('comment_form', $post->ID); ?>
<div class="form-submit"><input id="submit" name="submit" type="submit" value="<?php esc_attr_e('Post Comment', 'twentyten') ?>" tabindex="7" /><input type="hidden" name="comment_post_ID" value="<?php echo esc_attr($id); ?>" /></div>
<?php comment_id_fields(); ?>
</form>
<?php endif; // If registration required and not logged in ?>
</div> <!-- #respond -->
<?php endif; // if you delete this the sky will fall on your head ?>
</div><!-- #comments -->
</div><!-- #comments -->