1. <?php
  2. if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  3. die ('Please do not load this page directly. Thanks!');
  4. if (post_password_required()) {
  5. art_post_wrapper(array('content' => '<p class="nocomments">' . __('This post is password protected. Enter the password to view any comments.', THEME_NS) . '</p>'));
  6. return;
  7. }
  8. if (have_comments()){
  9. ob_start();
  10. printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), THEME_NS ), number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
  11. art_post_wrapper(array('content'=>'<h4 id="comments">' .ob_get_clean() . '</h4>'));
  12. $prev_link = get_previous_comments_link(__('Newer Comments <span class="meta-nav">&rarr;</span>', THEME_NS));
  13. $next_link = get_next_comments_link(__('<span class="meta-nav">&larr;</span> Older Comments', THEME_NS));
  14. art_pagination(array('prev_link' => $prev_link, 'next_link' => $next_link));
  15. echo '<ul id="comments-list">';
  16. wp_list_comments('type=all&callback=art_comment');
  17. echo '</ul>';
  18. art_pagination(array('prev_link' => $prev_link, 'next_link' => $next_link));
  19. } elseif('open' != $post->comment_status && !is_page()) {
  20. art_post_wrapper(array('content' => '<p class="nocomments">' . __('Comments are closed.', THEME_NS) .'</p>'));
  21. }
  22. if (function_exists('comment_form')){
  23. ob_start();
  24. comment_form();
  25. art_post_wrapper(array('content' => str_replace(array(' id="respond"', 'type="submit"'), array('', 'class="art-button" type="submit"'), ob_get_clean()), 'id' => 'respond'));
  26. return;
  27. }
  28. if ('open' == $post->comment_status) {
  29. ob_start();
  30. ?>
  31. <h3>Dejanos tu consulta</h3>
  32. <div class="cancel-comment-reply"><small><?php cancel_comment_reply_link(); ?></small></div>
  33. <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  34. <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.', THEME_NS), get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode(get_permalink())); ?></p>
  35. <?php else : ?>
  36. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  37. <?php if ( $user_ID ) : ?>
  38. <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>', THEME_NS), admin_url( 'profile.php' ), $user_identity, wp_logout_url(get_permalink())); ?></a></p>
  39. <?php else : ?>
  40. <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
  41. <label for="author"><small><?php _e('Name', THEME_NS); ?> <?php if ($req) _e("(required)", THEME_NS); ?></small></label></p>
  42. <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
  43. <label for="email"><small><?php _e('Your email address will not be published.', THEME_NS); ?> <?php if ($req) _e("(required)", THEME_NS); ?></small></label></p>
  44. <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
  45. <label for="url"><small><?php _e('Website', THEME_NS); ?></small></label></p>
  46. <?php endif; ?>
  47. <!--<p><small><?php printf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ), ' <code>' . allowed_tags() . '</code>' ) ?></small></p>-->
  48. <p><textarea name="comment" id="comment" cols="40" rows="10" tabindex="4"></textarea></p>
  49. <p>
  50. <span class="art-button-wrapper"><span class="art-button-l"> </span><span class="art-button-r"> </span>
  51. <input class="art-button" type="submit" name="submit" tabindex="5" value="<?php _e('Submit Comment', THEME_NS); ?>" />
  52. </span>
  53. <?php comment_id_fields(); ?>
  54. </p>
  55. <?php do_action('comment_form', $post->ID); ?>
  56. </form>
  57. <?php endif;?>
  58. <?php
  59. art_post_wrapper(array('content' => ob_get_clean(), 'id' => 'respond'));
  60. }