Advertisement
bcworkz

comments.php-10_Nov

Nov 10th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.14 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying Comments.
  4.  * Modified for "sicktb"
  5.  *
  6.  * For variants of this template alter "Test:" at line 91 (input) and 142 (output)
  7.  * Coordinate with bcw_handle_comment() on functions.php
  8.  *
  9.  * The area of the page that contains both current comments
  10.  * and the comment form.
  11.  *
  12.  * @package WordPress
  13.  * @subpackage Twenty_Ten
  14.  * @since Twenty Ten 1.0
  15.  */
  16. ?>
  17.  
  18.                         <div id="comments">
  19. <?php if ( post_password_required() ) : ?>
  20.                                 <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyten' ); ?></p>
  21.                         </div><!-- #comments -->
  22. <?php
  23.                 /* Stop the rest of comments.php from being processed,
  24.                  * but don't kill the script entirely -- we still have
  25.                  * to fully load the template.
  26.                  */
  27.                 return;
  28.         endif;
  29. ?>
  30.  
  31. <?php
  32.         // You can start editing here -- including this comment!
  33. ?>
  34.  
  35. <?php if ( have_comments() ) : ?>
  36.                         <h3 id="comments-title"><?php
  37.                         printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'twentyten' ),
  38.                         number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
  39.                         ?></h3>
  40.  
  41. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
  42.                         <div class="navigation">
  43.                                 <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'twentyten' ) ); ?></div>
  44.                                 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  45.                         </div> <!-- .navigation -->
  46. <?php endif; // check for comment navigation ?>
  47.  
  48.                         <ol class="commentlist">
  49.                                 <?php
  50.                                         /* Loop through and list the comments. Tell wp_list_comments()
  51.                                          * to use twentyten_comment() to format the comments.
  52.                                          * If you want to overload this in a child theme then you can
  53.                                          * define twentyten_comment() and that will be used instead.
  54.                                          * See twentyten_comment() in twentyten/functions.php for more.
  55.                                          */
  56.                                         wp_list_comments( array( 'callback' => 'twentyten_comment1' ) );
  57.                                 ?>
  58.                         </ol>
  59.  
  60. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
  61.                         <div class="navigation">
  62.                                 <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'twentyten' ) ); ?></div>
  63.                                 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  64.                         </div><!-- .navigation -->
  65. <?php endif; // check for comment navigation ?>
  66.  
  67.         <?php
  68.         /* If there are no comments and comments are closed, let's leave a little note, shall we?
  69.          * But we only want the note on posts and pages that had comments in the first place.
  70.          */
  71.         if ( ! comments_open() && get_comments_number() ) : ?>
  72.                 <p class="nocomments"><?php _e( 'Comments are closed.' , 'twentyten' ); ?></p>
  73.         <?php endif;  ?>
  74.  
  75. <?php endif; // end have_comments() ?>
  76.  
  77. <?php $post_id = get_the_ID();
  78.         if ( comments_open( $post_id ) ) : ?>
  79.         <div id="respond" class="comment-respond">
  80.                 <h3 id="reply-title" class="comment-reply-title"><?php comment_form_title(__( 'Leave a Reply' ),__( 'Leave a Reply to %s' )); ?> <small><?php cancel_comment_reply_link(__( 'Cancel reply' )); ?></small></h3>
  81.                 <?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
  82.                         <?php echo '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>'; ?>
  83.                 <?php else : ?>
  84.                         <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo 'commentform'; ?>" class="comment-form">
  85.                                 <?php $args = '<p class="logged-in-as">' . sprintf( __( 'Logged in as %2$s. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>';
  86.                                 echo apply_filters( 'comment_form_logged_in', $args, $commenter, $user_identity ); ?>
  87.                                 <?php $args = '<p class="comment-form-comment" style="display: none;"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true">' . time() . '</textarea></p>';
  88.                                 echo apply_filters( 'comment_form_field_comment', $args ); ?>
  89.  
  90.                                 <!-- !!!!!! Custom form fields start here !!!!!!! -->
  91.                                 Wat is kaas?: <input type="text" name="kaas" id="kaas" size="22" /><br style="clear: both;"><br>
  92.                                 Wat is vlees?: <input type="text" name="vlees" id="vlees" size="22" /><br style="clear: both;">
  93.  
  94.                                 <p class="form-submit">
  95.                                         <input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo __( 'Post Comment' ); ?>" />
  96.                                         <?php comment_id_fields( $post_id ); ?>
  97.                                 </p>
  98.                         </form>
  99.                 <?php endif; ?>
  100.         </div><!-- #respond -->
  101. <?php else :
  102.         do_action( 'comment_form_comments_closed' );
  103. endif; ?>
  104.  
  105. </div><!-- #comments -->
  106. <?php
  107. /**
  108.  * Template for comments and pingbacks.
  109.  *
  110.  * To override this walker in a child theme without modifying the comments template
  111.  * simply create your own twentyten_comment(), and that function will be used instead.
  112.  *
  113.  * Used as a callback by wp_list_comments() for displaying the comments.
  114.  *
  115.  * @since Twenty Ten 1.0
  116.  */
  117. function twentyten_comment1( $comment, $args, $depth ) {
  118.         $GLOBALS['comment'] = $comment;
  119.         switch ( $comment->comment_type ) :
  120.                 case '' :
  121.         ?>
  122.         <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
  123.         <div id="comment-<?php comment_ID(); ?>">
  124.             <div class="comment-author vcard">
  125.                     <?php echo get_avatar( $comment, 40 ); ?>
  126.                     <?php printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
  127.             </div><!-- .comment-author .vcard -->
  128.             <?php if ( $comment->comment_approved == '0' ) : ?>
  129.                     <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
  130.                     <br />
  131.             <?php endif; ?>
  132.  
  133.             <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
  134.             <?php
  135.             /* translators: 1: date, 2: time */
  136.             printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
  137.             $user_id = get_current_user_id();
  138.             $nonce = wp_create_nonce('del-comment');
  139.             $link = get_permalink();
  140.             if ( current_user_can('moderate_comments') || $comment->user_id == $user_id ) {
  141.                 echo " <a href=\"$link?bcw_task=del&com_id={$comment->comment_ID}&user_id=$user_id&_wpnonce=$nonce\" title=\"Move immediately to trash (no confirmation)\">(Del)</a><br />";
  142.             }
  143.             if ( current_user_can('moderate_comments')) {
  144.                 echo '<br />Timestamp:';
  145.                 comment_text();
  146.             }
  147.             ?>
  148.  
  149.             <!-- !!!!!! Custom form field output starts here !!!!!!! -->
  150.             Wat is kaas?: <?php echo get_comment_meta( $comment->comment_ID, 'bcw_kaas', true ); ?><br />
  151.             Wat is vlees?: <?php echo get_comment_meta( $comment->comment_ID, 'bcw_vlees', true ); ?><br />
  152.            
  153.             </div><!-- .comment-meta .commentmetadata -->
  154.          </div><!-- #comment-##  -->
  155.         <?php
  156.                     break;
  157.                 case 'pingback'  :
  158.                 case 'trackback' :
  159.         ?>
  160.         <li class="post pingback">
  161.                 <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
  162.         <?php
  163.                     break;
  164.         endswitch;
  165. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement