<?php 
/*
 * @package WordPreciousss
 * @subpackage Precious_Parent_Theme
*/
?>


<div id="commentbox">
	<?php 
	if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) { die (__('Please do not load this page directly.','precious')); }

	if ( post_password_required()) { ?>
		<p><?php _e('Enter password to view comments.', 'precious'); ?></p>

	<?php return; } ?>

<!--<?php if ( $comments || comments_open() || pings_open() ) : ?>
	<h3 id="comments">
		<?php comments_rss_link('<img src="'. get_bloginfo('wpurl') .'/wp-includes/images/rss.png" alt="'.__('RSS Comments','precious').'" class="rssimg" />'); ?>

		 <?php comments_number(__('No replies','precious'),__('One reply','precious'),__('% replies','precious') );?>
	</h3>

<?php endif; ?>-->


<!--<p class="commenstatus">
	<?php if ( comments_open() ) : ?>
		<a href="<?php the_permalink() ?>#reply" 
			title="<?php _e('Write a comment to','precious'); ?> <?php the_title(); ?>">
			<?php _e('Write comment','precious'); ?></a>
		<?php endif; ?>

	<?php if ( pings_open() ) : ?>
			- <a href="<?php trackback_url() ?>" rel="trackback" 
			title="<?php _e('Trackback link to','precious'); ?> 
			<?php the_title(); ?>"><?php _e('Trackback','precious'); ?></a>
		<?php endif; ?>
	<?php if (comments_open() || pings_open() ) : ?>
	
	<?php elseif ( have_comments() && (!comments_open() && !pings_open())  )  : ?>
		<?php _e('Comments closed','precious'); ?>
	<?php endif; ?>
</p>-->


<?php if ( have_comments() ) { ?>


	<?php if ( ! empty($comments_by_type['comment']) ) { ?>

		<ol id="commentlist">
			<?php wp_list_comments('type=comment&callback=precious_list_comments&end_callback=precious_end_listing&avatar_size=100'); ?>
		</ol>
	<?php  
		} if ( ! empty($comments_by_type['pings']) ) { ?>

		<ol id="pinglist">
			<?php wp_list_comments('type=pings&callback=precious_list_pings&end_callback=precious_end_listing'); ?>
		</ol>

	<?php } ?>

	
		<?php paginate_comments_links(array('prev_next' => true, 'type' => 'list')); ?>




<?php } else { // If there are no comments yet ?>
		<?php if ('open' == $post->comment_status) : ?>
		<p class="small"></p>
		<?php endif; ?>
<?php } ?>



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

<div id="respond">

<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p><?php _e('You have to be','precious'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>"><?php _e('logged in','precious'); ?></a> <?php _e('to post a comment','precious'); ?></p>
<?php else : ?>

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


<fieldset>
<legend id="reply"><?php comment_form_title(__('Leave a reply','precious'),__('Reply to %s','precious'), TRUE ); ?></legend>

<div class="cancel-comment-reply">
	<?php cancel_comment_reply_link(__('Cancel reply','precious')); ?>
</div>

<?php if ( $user_ID ) : ?>

<p><?php _e('You are logged in as','precious'); ?> <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"><?php _e('Logout','precious'); ?></a></p>


<?php else : ?>

<label for="author"><?php _e('Name','precious'); ?></label>
<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="30" tabindex="1" />

<label for="email"><?php _e('Email','precious'); ?></label>
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="30" tabindex="2" />

<label for="url"><?php _e('Website','precious'); ?> <small>(<?php _e('optional','precious');?></small></label>
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="30" tabindex="3" />


<?php endif; ?>



<label for="comment"><?php _e('Your comment','precious'); ?></label>
<textarea name="comment" id="comment" cols="40" rows="10" tabindex="4"></textarea>
<!--<small><strong>XHTML:</strong>  <?php echo allowed_tags(); ?></small>-->

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

<input name="submit" type="submit" id="submit" tabindex="6" value="<?php _e('Submit','precious'); ?>" />
<?php comment_id_fields(); ?>
</fieldset>

</form>

<?php endif; // If registration required and not logged in ?>

</div>

<?php endif; ?>

</div>
