<?php if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>

<p>This page is password-protected. Enter your password to continue!</p>

<?php return; endif; ?>



<?php if ( $comments ) : ?>

<h2 class="archiveheader" id="comments">Comments</h2>



<?php foreach ($comments as $comment) : ?>



<div class="comment">

<p class="commenticon">

<strong><?php comment_type('Comment','Trackback','Pingback'); ?></strong> from <strong><?php if ('' != get_comment_author_url()) { ?><a href="<?php comment_author_url(); ?>"><?php comment_author() ?></a><?php } else { comment_author(); } ?></strong>

<?php edit_comment_link('[e]',' | '); ?><br />

<strong>Time:</strong> <?php comment_date() ?>, <?php comment_time(); ?></p>

<?php comment_text() ?>



<?php if ($comment->comment_approved == '0') : ?>

<p><strong>Thank you for your comment! It has been placed in the moderation queue.</strong></p>

<?php endif; ?>

</div>



<?php endforeach; ?>

<?php endif; ?>



<?php if ($post->comment_status == "open") : ?>



<div id="respond">

<h2>Write a comment</h2>

<?php if (get_option('comment_registration') && !$user_ID) : ?>

<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>



<?php else : ?>



<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">



<?php if ($user_ID) : ?>

<p class="loggedin">Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout</a>.</p>



<?php else : ?>



<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">



<p><label for="author">Name:</label><br />

<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" tabindex="1" /></p>

<p><label for="email">E-mail:</label><br />

<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" tabindex="2" /></p>

<p><label for="url">Website:</label><br />

<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" tabindex="3" /></p>



<?php endif; ?>



<p><label for="comment">Comment:</label><br />

<textarea name="comment" id="comment" cols="45" rows="4" tabindex="4"></textarea></p>

<p><input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />

<input type="submit" name="submit" value="Submit" class="button" tabindex="5" /></p>

<?php do_action('comment_form', $post->ID); ?>

</form>



</div>



<?php endif; ?>

<?php endif; ?>