<?php
	if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!');
	if (!empty($post->post_password)) { if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { return; } }
?>

<div class="comments">

	<h2 id="comments">Comments: <?php comments_number('0', '1', '%');?></h2>
	
	<?php if ($comments) : ?>
		
			<?php foreach ($comments as $comment) : ?>

				<div class="comment <?php if ($comment->user_id == 1) echo "admincomment"; ?>"><?php echo get_avatar( $comment, 32 ); ?>
					<div class="author"><?php comment_author_link() ?> <span>// <?php comment_date('F jS, Y') ?> - <?php comment_time() ?></span></div>
			<?php if ($comment->comment_approved == '0') : ?>
		  <p>Your comment is awaiting moderation.</p>
		  <?php endif; ?>
					<?php comment_text() ?>
				</div>
				
			<?php endforeach; ?>

	<?php else : ?>

	
	<?php endif; ?>

</div>

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

<div class="comment-form">
	<h3>Leave a Reply</h3>
	<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
		<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
		
		<?php if ($user_ID) : ?>

			<p>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="Log out of this account">Log out</a></p>

		<?php else : ?>
		
			<p><input type="text" class="text" name="author" id="author" value="<?php echo $comment_author; ?>" /><label for="author">- name</label></p>
			<p><input type="text" class="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" /><label for="email">-  email (will not be published!)</label></p>
			<p><input type="text" class="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" /><label for="url">- website</label></p>
			
		<?php endif; ?>
		
		<p><textarea name="comment" id="comment"></textarea></p>
		<input type="submit" class="submit" value="Submit Comment" />

	</form>
</div>

<?php endif; ?>
