<?php
/**
 * The template for displaying comments
 *
 * The area of the page that contains both current comments
 * and the comment form.
 *
 * @package WordPress
 * @subpackage MyArcadeTheme
 * @since 1.0.0
 */

// 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!", 'myarcadetheme') );
}

if ( function_exists('post_password_required') ) {
  if ( post_password_required() ) {
    echo '<p class="nocomments">'.__("This post is password protected. Enter the password to view comments.", 'myarcadetheme').'</p>';
    return;
  }
}
else {
  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">
        <?php _e("This post is password protected. Enter the password to view comments.", 'myarcadetheme'); ?>
      </p>
      <?php
      return;
    }
  }
}

if ( have_comments() ) : ?>
  <!--<blk-cn>-->
  <div class="blk-cn">
    <div class="titl"><?php printf( __('COMMENTS %s#%s%s', 'myarcadetheme'), '<strong>', get_comments_number(), '</strong>'); ?></div>
    <ul class="lst-cmnt" id="comments">
      <?php wp_list_comments( array( 'callback' => 'myarcadetheme_comment' ) ); ?>
    </ul>
  </div>
  <!--</blk-cn>-->

  <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
    $pagination = paginate_comments_links( array( 'prev_next' => true, 'echo' => false ) );

    if( ! empty( $pagination ) ) : ?>
      <div class="mt-pagnav wp-pagenavi"><?php echo $pagination ?></div>
      <?php
    endif; ?>
  <?php endif; ?>

<?php endif; // end have_comments(); ?>

<?php if ( comments_open() ) : ?>
  <!--<blk-cn>-->
  <div class="blk-cn" id="respond">
   <div class="cancel-comment-reply">
    <span><?php cancel_comment_reply_link(); ?></span>
  </div>
  <div class="titl"><?php _e('LEAVE A REPLY', 'myarcadetheme'); ?></div>
  <form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" name="commentform" class="comment-form">
    <?php if ( !is_user_logged_in() ) : ?>
      <p class="comment-notes"><?php _e('Your email address will not be published.', 'myarcadetheme'); ?></p>
    <?php endif; ?>
    <ul class="cntcls-n4-lstcl-100p-spr10">
      <?php if ( is_user_logged_in() ) : ?>
        <p><?php printf(__( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ),admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) )); ?></p>
      <?php else : ?>
        <li><div class="frmspr"><label class="icofrm fa-user"><input id="author" name="author" type="text" value="<?php echo esc_attr($commenter['comment_author'] ); ?>" placeholder="<?php _e('Name', 'myarcadetheme'); ?>" size="30"></label></div></li>
        <li><div class="frmspr"><label class="icofrm fa-envelope"><input id="email" name="email" type="text" value="<?php echo esc_attr(  $commenter['comment_author_email'] ); ?>" placeholder="<?php _e('Email', 'myarcadetheme'); ?>" size="30"></label></div></li>
        <li><div class="frmspr"><label class="icofrm fa-link"><input id="url" name="url" type="text" value="<?php echo esc_attr( $commenter['comment_author_url'] ); ?>" placeholder="<?php _e('Website', 'myarcadetheme'); ?>" size="30"></label></div></li>
      <?php endif; ?>
      <li><div class="frmspr"><label class="icofrm fa-comment"><textarea id="comment" name="comment" cols="66" rows="6" placeholder="<?php _e('Your comment here...', 'myarcadetheme'); ?>" aria-required="true"></textarea></label></div>
      </ul>
      <?php /*
      <p class="form-allowed-tags"><?php //printf(__( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ),' <code>' . allowed_tags() . '</code>'); ?></p> */
      ?>
      <p class="form-submit">
        <input name="submit" type="submit" id="submit" value="<?php _e('Post Comment', 'myarcadetheme'); ?>">
      </p>
      <?php comment_id_fields(); ?>
      <?php do_action('comment_form', $post->ID); ?>
    </form>
  </div>
  <!--</blk-cn>-->
<?php endif; ?>