Changeset 6256
- Timestamp:
- 08/14/2012 08:49:51 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-themes/bp-default/comments.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-themes/bp-default/comments.php
r5737 r6256 1 1 <?php 2 3 // Bail if post type doesn't support comments 4 if ( ! post_type_supports( get_post_type(), 'comments' ) ) 5 return; 6 7 // Bail if is a page, and comments are not open 8 if ( is_page() && ! have_comments() && ! comments_open() && ! pings_open() ) 9 return; 10 2 11 if ( post_password_required() ) { 3 12 echo '<h3 class="comments-header">' . __( 'Password Protected', 'buddypress' ) . '</h3>'; … … 6 15 } 7 16 8 if ( is_page() && !have_comments() && !comments_open() && !pings_open() )9 return;10 11 17 if ( have_comments() ) : 12 $num_comments = 0;18 $num_comments = 0; 13 19 $num_trackbacks = 0; 14 20 foreach ( (array) $comments as $comment ) { 15 if ( 'comment' != get_comment_type() ) 21 if ( 'comment' != get_comment_type() ) { 16 22 $num_trackbacks++; 17 else23 } else { 18 24 $num_comments++; 25 } 19 26 } 20 27 ?> … … 40 47 41 48 </div><!-- #comments --> 49 42 50 <?php else : ?> 43 51 44 <?php if ( pings_open() && !comments_open() && ( is_single() || is_page() ) ) : ?> 45 <p class="comments-closed pings-open"> 46 <?php printf( __( 'Comments are closed, but <a href="%1$s" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.', 'buddypress' ), trackback_url( '0' ) ); ?> 47 </p> 48 <?php elseif ( !comments_open() && ( is_single() || is_page() ) ) : ?> 49 <p class="comments-closed"> 50 <?php _e( 'Comments are closed.', 'buddypress' ); ?> 51 </p> 52 <?php if ( ! comments_open() ) : ?> 53 <?php if ( pings_open() ) : ?> 54 <p class="comments-closed pings-open"> 55 <?php printf( __( 'Comments are closed, but <a href="%1$s" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.', 'buddypress' ), trackback_url( '0' ) ); ?> 56 </p> 57 <?php else : ?> 58 <p class="comments-closed"> 59 <?php _e( 'Comments are closed.', 'buddypress' ); ?> 60 </p> 61 <?php endif; ?> 52 62 <?php endif; ?> 53 63 54 64 <?php endif; ?> 55 65 56 <?php if ( comments_open() ) : ?> 57 <?php comment_form(); ?> 58 <?php endif; ?> 66 <?php if ( comments_open() ) comment_form(); ?> 59 67 60 68 <?php if ( !empty( $num_trackbacks ) ) : ?>
Note: See TracChangeset
for help on using the changeset viewer.