Index: wp-content/themes/default/comments.php
===================================================================
--- wp-content/themes/default/comments.php	(revision 12605)
+++ wp-content/themes/default/comments.php	(working copy)
@@ -45,52 +45,51 @@
 	<?php endif; ?>
 <?php endif; ?>
 
+<?php
 
-<?php if ( comments_open() ) : ?>
+function hookable_comments_log_in() {
+	if ( !is_user_logged_in() ) { // This is not pretty, it's just here for demonstration purposes!
+		echo "<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script>";
+		echo '<p><a href="#" onclick="javascript:jQuery(\'#log-in-form\').slideToggle(); return false;">Log in now</a> to save some time</p>';
+		echo '<div id="log-in-form">' . wp_login_form( array( 'echo' => false, 'redirect' => get_permalink() . '#respond' ) ) . '</div>';
+		echo '<script type="text/javascript">jQuery(\'#log-in-form\').slideUp();</script>';
+	}
+}
 
-<div id="respond">
+function hookable_comments_logged_in( $str, $commenter, $identity ) {
+	if ( !empty( $commenter['comment_author_email'] ) ) {
+		$str = '<div style="border: dashed 1px #808080; padding: 3px 3px 3px 10px; background: #ebebeb; margin-right: -5px;">
+					<div style="float: right;">' . get_avatar( $commenter['comment_author_email'], 24 ) . '</div>
+					<p>Howdy, <a href="' . admin_url( 'profile.php' ) . '">' . $identity . '</a>! You can comment below, or <a href="' . wp_logout_url( get_permalink() ) . '">logout</a> if you like.</p>
+				</div>';
+	}
+	return $str;
+}
 
-<h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>
+function hookable_comments_setup( $defaults ) {
+	// Adjust the message displayed if users need to log in, but aren't currently.
+	$str = '<p>' . __( 'You must be logged in to comment.' ) . '</p>' . wp_login_form( array( 'echo' => false, 'redirect' => get_permalink() . '#respond' ) );
+	if ( get_option( 'users_can_register' ) )
+		$str .= '<p>' . sprintf( __( 'Not a member yet? <a href="%1$s">Register now</a>.' ), site_url( 'wp-register.php' ) ) . '</p>';
+	$defaults['must_log_in'] = $str;
+	
+	// Add a field to the comment form. This could also be done through the 
+	// comment_form_default_fields filter.
+	$defaults['fields']['twitter'] = '<p><input type="text" name="twitter" id="twitter" value="@" size="22" tabindex="4" /> <label for="twitter"><small>' . __( 'Twitter username (optional)' ) . '</small></label></p>';
+	
+	return $defaults;
+}
 
-<div class="cancel-comment-reply">
-	<small><?php cancel_comment_reply_link(); ?></small>
-</div>
+function hookable_comments_closed() {
+	echo '<div style="border: dashed 1px #808080; padding: 3px 3px 3px 10px; background: #ebebeb; margin-right: -5px;">' . __( 'Comments are closed, better luck next time cowboy!' ) . '</div>';
+}
 
-<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
-<p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p>
-<?php else : ?>
+add_action( 'comment_form_before', 'hookable_comments_log_in' );
+add_action( 'comment_form_comments_closed', 'hookable_comments_closed' );
 
-<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
+add_filter( 'comment_form_defaults', 'hookable_comments_setup' );
+add_filter( 'comment_form_logged_in', 'hookable_comments_logged_in', 10, 3 );
 
-<?php if ( is_user_logged_in() ) : ?>
+?>
 
-<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p>
-
-<?php else : ?>
-
-<p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
-<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
-
-<p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
-<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>
-
-<p><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
-<label for="url"><small>Website</small></label></p>
-
-<?php endif; ?>
-
-<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
-
-<p><textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea></p>
-
-<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
-<?php comment_id_fields(); ?>
-</p>
-<?php do_action('comment_form', $post->ID); ?>
-
-</form>
-
-<?php endif; // If registration required and not logged in ?>
-</div>
-
-<?php endif; // if you delete this the sky will fall on your head ?>
+<?php comment_form(); ?>
