<?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.', 'oneroom') ?></p>
	<?php
		return;
	}
?>

<!-- You can start editing here. -->
<div class="clear"></div>

<?php if ( have_comments() ) : ?>
    <div class="left-sidebar">
	    <h3 id="comments"><?php comments_number(__('No Comments', 'oneroom'), __('1 Comment', 'oneroom'), __('% Comments', 'oneroom'), '', '');?></h3>
    </div>

	<div class="nav nav-padding">
	    <div class="alignleft"><?php previous_post(__('&laquo; %', 'oneroom'), __('Previous Post', 'oneroom'), __('no', 'oneroom'), '', '');?>&nbsp;</div>
		<div class="alignright">&nbsp;<?php next_post(__('&laquo; %', 'oneroom'), __('Next Post', 'oneroom'), __('no', 'oneroom'), '', '');?></div>
	</div>

    <ul class="commentlist">
        <?php wp_list_comments('type=comment&callback=mytheme_comment'); ?>
    </ul>

	<div class="nav">
		<div class="alignleft"><?php previous_comments_link() ?></div>
		<div class="alignright"><?php next_comments_link() ?></div>
	</div>

 <?php else : // this is displayed if there are no comments so far ?>

	<?php if ('open' == $post->comment_status) : ?>
		<!-- If comments are open, but there are no comments. -->
        <div class="left-sidebar">
    	    <h3 id="comments"><?php _e('No Comments', 'oneroom') ?></h3>
        </div>

	<div class="nav nav-padding">
	    <div class="alignleft"><?php previous_post(__('&laquo; %', 'oneroom'), __('Previous Post', 'oneroom'), __('no', 'oneroom'), '', '');?>&nbsp;</div>
		<div class="alignright">&nbsp;<?php next_post(__('&laquo; %', 'oneroom'), __('Next Post', 'oneroom'), __('no', 'oneroom'), '', '');?></div>
	</div>
	

	 <?php else : // this is displayed if there comments are closed ?>
		<!-- If comments are closed -->
    	<div class="nav nav-padding nav-border-bottom">
    	    <div class="alignleft"><?php previous_post(__('&laquo; %', 'oneroom'), __('Previous Post', 'oneroom'), __('no', 'oneroom'), '', '');?>&nbsp;</div>
			<div class="alignright">&nbsp;<?php next_post(__('&laquo; %', 'oneroom'), __('Next Post', 'oneroom'), __('no', 'oneroom'), '', '');?></div>
    	</div>
     <?php endif; ?>
<?php endif; ?>


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

<div id="respond">
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <div class="left-sidebar">
        <h3><?php comment_form_title(__( 'Leave a Reply') , ('oneroom'), __('', 'oneroom'), __('', 'oneroom'), '', '');?></h3>
    </div>

    <div class="comment-content">
        <p><?php _e('You must be', 'oneroom') ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>"><?php _e('logged in', 'oneroom') ?></a> <?php _e('to post a comment.', 'oneroom') ?></p>
    </div>

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

        <div class="left-sidebar">
            <h3><?php comment_form_title(__( 'Leave a Reply') , ('oneroom'), __('Leave a Reply<br /> to %s', 'oneroom'), __('', 'oneroom'), '', '');?></h3>

            <div class="cancel-comment-reply">
            	<small><?php cancel_comment_reply_link(); ?></small>
            </div>

            <?php if ( $user_ID ) : ?>

            <p><?php _e('Logged in as', 'oneroom') ?> <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>.<br /> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account', 'oneroom') ?>"><?php _e('Log out', 'oneroom') ?> &raquo;</a></p>
            <p>&nbsp;</p>

            <?php else : ?>

            <p> <label for="author"><small><?php _e('Name', 'oneroom') ?> <?php if ($req) echo "(*)"; ?></small></label>
			<input class="field" type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
           </p>

            <p><label for="email"><small><?php _e('Mail', 'oneroom') ?> <?php if ($req) echo "(*)"; ?></small></label>
			<input class="field" type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
            </p>

            <p><label for="url"><small><?php _e('Website', 'oneroom') ?></small></label>
			<input class="field" type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
            </p>

            <?php endif; ?>

            <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit', 'oneroom') ?>" />
            <?php comment_id_fields(); ?>
            </p>
            <?php do_action('comment_form', $post->ID); ?>
        </div>

        <div class="comment-content comment-form">
            <textarea name="comment" id="comment" cols="56" rows="5" tabindex="4"></textarea>
            <!--<p><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></p>-->
            <p><?php _e('You can follow any responses to this entry through the', 'oneroom') ?> <?php post_comments_feed_link('RSS 2.0'); ?> <?php _e('feed.', 'oneroom') ?></p>
        </div>
    <div class="clear"></div>
    </form>

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

    <div class="clear"></div>
</div>
<div class="clear"></div>

<?php endif; // if you delete this the sky will fall on your head ?>
