<?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 (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
?>

<p class="nocomments">This post is password protected. Enter the password to view comments.</p>

<?php
return;
}
}
$oddcomment = 'class="alt" ';
?>

<!-- Begin Comments List -->
<?php if ($comments) : ?>
<h2 id="comments"><?php comments_number('No Comments', 'One Comment', '% Comments' );?> on &#8220;<?php the_title(); ?>&#8221;</h2>
<ul class="commentlist">
<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>
<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">

<div class="avatar"><?php echo get_avatar( $comment, 50 ); ?></div>

<div class="commentinfo">
<span class="cauthor"><?php comment_author_link() ?></span> <span class="cdate">wrote on <?php comment_date('j F, Y, G:i'); ?></span><?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?>
<span class="ctext"><?php comment_text() ?></span>
<?php if ($comment->comment_approved == '0') : ?><span class="approve">Your comment is awaiting approval.</span><?php endif; ?>
</div><div class="clear"></div>

</li>
<?php $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : ''; ?>
<?php } else { $trackback = true; } /* End of is_comment statement */ ?>
<?php endforeach; ?>
</ul>
<!-- End Comments List -->

<!-- Setup Trackbacks box -->
<?php if ($trackback == true) { ?>
<h4>Trackbacks</h4>
<ol class="trackbacks">
<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type != 'comment') { ?>
<li><?php comment_author_link() ?></li>
<?php } ?>
<?php endforeach; ?>
</ol>
<?php } ?>
<!-- End Trackbacks display -->

<!-- Leave a Reply Box -->
<?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. -->

<?php else : // comments are closed ?>
<!-- If comments are closed. -->

<?php endif; ?>
<?php endif; ?>

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

<h2 id="respond">نوشتن دیدگاه</h2>

<p>شما میتوانید از تصاویر مخصوص خود در قسمت نظرات استفاده نمایید برای اینکار از وب سایت <a href="http://gravatar.com"><b>آواتار</b></a>کمک بگیرید .</p>

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

<?php else : ?>

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

<?php if ( $user_ID ) : ?>
<p style="line-height: 1.5em">وارد شده با نام <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">خروج &raquo;</a></p>

<?php else : ?>
<label for="author">نام <?php if ($req) echo "(required)"; ?></label>
<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" tabindex="1" class="replytext" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="email">پست الکترونیک <?php if ($req) echo "(required)"; ?></label>
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" tabindex="2" class="replytext" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="url">صفحه اینترنتی</label>
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" tabindex="3" class="replytext" />
<?php endif; ?>
<label for="comment">نظر</label>
<textarea name="comment" id="comment" tabindex="4" class="replyarea"></textarea>
<input name="submit" type="submit" id="submit" tabindex="5" value="ارسال" class="replybutton" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<?php do_action('comment_form', $post->ID); ?>

</fieldset>
</form>
<!-- End Leave a Reply Box -->

<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this the sky will fall on your head ?>