comments.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. global $defaultoptions;
  3. global $options;
  4. if ( post_password_required() ) : ?>
  5. <p><?php _e("This entry is protected by password. Please enter the password to see comments.", 'piratenkleider'); ?></p>
  6. <?php return;
  7. endif;
  8. if ( have_comments() ) : ?>
  9. <h2 id="comments-title"><?php _e("Kommentare", 'piratenkleider'); ?></h2>
  10. <p>
  11. <?php printf( _n( 'One comment for %2$s', '%1$s comments for %2$s', get_comments_number(), 'piratenkleider' ), number_format_i18n( get_comments_number() ), '' . get_the_title() . '' ); ?>
  12. </p>
  13. <?php
  14. if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
  15. previous_comments_link( __( '&larr; Older comments', 'piratenkleider' ) );
  16. next_comments_link( __( 'Newer comments &rarr;', 'piratenkleider' ) );
  17. endif; ?>
  18. <ol>
  19. <?php wp_list_comments( array( 'callback' => 'piratenkleider_comment' ) ); ?>
  20. </ol>
  21. <?php
  22. if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
  23. previous_comments_link( __( '&larr; Older comments', 'piratenkleider' ) );
  24. next_comments_link( __( 'Newer comments &rarr;', 'piratenkleider' ) );
  25. endif;
  26. if ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
  27. <p><?php _e("It's not possible to make comments anymore.", 'piratenkleider'); ?></p>
  28. <?php
  29. endif;
  30. endif;
  31. $comment_before = '';
  32. if (isset($options['comments_disclaimer'])) {
  33. $comment_before = '<div class="comment-disclaimer">'.$options['comments_disclaimer'] .'</div>';
  34. }
  35. if ($options['anonymize-user']==1) {
  36. // Emailadresse kann/soll weggelassen werden
  37. if ($options['anonymize-user-commententries']==1) {
  38. // Autorname
  39. $comments_args = array( 'fields' => array(
  40. 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name', 'piratenkleider' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
  41. '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>'
  42. ),
  43. 'comment_notes_before' => $comment_before,
  44. );
  45. comment_form( $comments_args);
  46. } elseif ($options['anonymize-user-commententries']==2) {
  47. // Name + URL
  48. $comments_args = array( 'fields' => array(
  49. 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name', 'piratenkleider' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
  50. '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
  51. 'url' => '<p class="comment-form-url"><label for="url">' . __( 'Website', 'piratenkleider' ) . '</label>'.
  52. '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>'
  53. ),
  54. 'comment_notes_before' => $comment_before,
  55. );
  56. comment_form( $comments_args);
  57. } else {
  58. // WP-Default (Name+Email+URL)
  59. $comment_before = $comments_before. $defaultoptions['default_comment_notes_before'];
  60. comment_form( array( 'comment_notes_before' => $comment_before ) );
  61. }
  62. } else {
  63. $comment_before = $comment_before. $defaultoptions['default_comment_notes_before'];
  64. comment_form( array( 'comment_notes_before' => $comment_before ) );
  65. }
  66. ?>