<?php
	// Prevent the direct loading

	if(!empty($_SERVER['SCRIPT-FILENAME']) && basename($_SERVER['SCRIPT-FILENAME']) == 'comments.php') {
		die(__('You cannot access this file', WFT_DOMAIN));
	}

	// Check if post is pwd protected

	if(post_password_required()){
		?>
			<p><?php _e('This post is password protected. Enter the password to view the comments.', ETHENE_DOMAIN); ?></p>
		<?php
		return;
	}

	if ( have_comments() ) { ?>

		<div class="line"></div>
		<h3><?php comments_number(__('No Comments', WFT_DOMAIN), __('One Comment', WFT_DOMAIN), __('Comments (%)', WFT_DOMAIN)); ?></h3>

		<div class="comments" id="comments">
			<?php wp_list_comments(array('style' => 'div', 'avatar_size' => 88, 'callback' => 'wft_comments')); ?>
		</div>

		<?php if ( get_comment_pages_count() > 1 && get_option('page_comments') ) { ?>

			<div class="comments-nav">
				<div class="left"><?php previous_comments_link(__('&larr; Older Comments', WFT_DOMAIN)); ?></div>
				<div class="right"><?php next_comments_link(__('Newer Comments &rarr;', WFT_DOMAIN)); ?></div>
				<div class="clear"></div>
			</div>

		<?php } // endif ?>

	<?php }
	if ( !comments_open() && !is_page() && post_type_supports(get_post_type(), 'comments') ) { ?>

		<p class="no-comments"><?php _e('Comments are closed', WFT_DOMAIN) ?></p>

	<?php
	} //endif;

	// Display Comment Form
	wft_comment_form();
?>