<?php
// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
 
if ( post_password_required() ) { ?>
	<p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', 'trendytravel'); ?></p>
<?php 
	return;
}
?>
<!-- START EDITING HERE. -->

<?php if(have_comments()): ?>
	
	<?php if(get_comment_pages_count() > 1 && get_option('page_comments')): ?>
    	<div class="pagination">
            <ul class="commentNav">
                <li><?php previous_comments_link(); ?></li>
                <li><?php next_comments_link(); ?></li>
            </ul>
		</div>
	<?php endif; ?>
    
    <div class="reviewentries" id="reviews">
		<h2 class="section-title"><?php comments_number(__('No Travellers Word', 'trendytravel'), __('Travellers Word (1)', 'trendytravel'), __('Travellers Word (%)', 'trendytravel')); ?></h2>
        <div class="reviewlist">
            <?php wp_list_comments('avatar_size=62&type=comment&callback=trendytravel_hotel_comments&style=div'); ?>
        </div>
	</div><?php
	else:
		if('open' == $post->comment_status): ?>
            <h2 class="section-title"><?php _e('No Travellers Word', 'trendytravel'); ?></h2><?php
		endif;
	endif;
	
	//PERFORMING COMMENT FORM...
	if('open' == $post->comment_status):

		$commenter = wp_get_current_commenter();

		$comment_form = array(
			'title_reply'          => __('Leave a Review', 'trendytravel'),
			'comment_notes_before' => '',
			'comment_notes_after'  => '',
			'fields'               => array(
				'author' => '<div class="dt-sc-one-half column"><p><input id="author" name="author" type="text" required="" placeholder="'.__('Name (required)', 'trendytravel').'" /></p>',
				'email'  => '<p><input id="email" name="email" type="text" required="" placeholder="'.__('Email [required]', 'trendytravel').'" /></p>',
				'url' 	 => '<p><input id="url" name="url" type="text" placeholder="'.__('Website', 'trendytravel').'" /></p></div>'
			),
			'label_submit'  => __('Submit Review', 'trendytravel'),
			'logged_in_as'  => '',
			'comment_field' => '',
			'cancel_reply_link' => __('cancel reply', 'trendytravel')
		);

		$comment_form['comment_field'] = '<div class="dt-sc-one-column column"><p><textarea id="comment" name="comment" placeholder="'.__('Message', 'trendytravel').'"></textarea></p></div>';
		
		

		$comment_form['comment_field'] .= '<div class="dt-sc-one-half column first"><p><input type="text" id="profession" name="profession" placeholder="'.__('Profession', 'trendytravel').'"></p>
			<p><input type="text" id="title" name="title" required="" placeholder="'.__('Title (required)', 'trendytravel').'"></p>
			<p><label for="dt-rating">' . __( 'Your Rating', 'trendytravel' ) .'</label><select name="rating" id="dt-rating">
			<option value="">' . __( 'Rate&hellip;', 'trendytravel' ) . '</option>
			<option value="5">' . __( 'Perfect', 'trendytravel' ) . '</option>
			<option value="4">' . __( 'Good', 'trendytravel' ) . '</option>
			<option value="3">' . __( 'Average', 'trendytravel' ) . '</option>
			<option value="2">' . __( 'Not that bad', 'trendytravel' ) . '</option>
			<option value="1">' . __( 'Very Poor', 'trendytravel' ) . '</option>
		</select></p></div>';

		comment_form( $comment_form );

	endif; ?>