2012-07-11 16:28:51 +00:00
< ? php
if ( post_password_required () ) {
echo '<h3 class="comments-header">' . __ ( 'Password Protected' , 'buddypress' ) . '</h3>' ;
echo '<p class="alert password-protected">' . __ ( 'Enter the password to view comments.' , 'buddypress' ) . '</p>' ;
return ;
}
if ( is_page () && ! have_comments () && ! comments_open () && ! pings_open () )
return ;
if ( have_comments () ) :
$num_comments = 0 ;
$num_trackbacks = 0 ;
2012-08-08 16:49:22 +00:00
foreach ( ( array ) $comments as $comment ) {
2012-07-11 16:28:51 +00:00
if ( 'comment' != get_comment_type () )
$num_trackbacks ++ ;
else
$num_comments ++ ;
}
?>
< div id = " comments " >
< h3 >
2012-08-08 16:49:22 +00:00
< ? php printf ( _n ( '1 response to %2$s' , '%1$s responses to %2$s' , $num_comments , 'buddypress' ), number_format_i18n ( $num_comments ), '<em>' . get_the_title () . '</em>' ) ?>
2012-07-11 16:28:51 +00:00
</ h3 >
2012-08-08 16:49:22 +00:00
< ? php do_action ( 'bp_before_blog_comment_list' ) ?>
2012-07-11 16:28:51 +00:00
< ol class = " commentlist " >
2012-08-08 16:49:22 +00:00
< ? php wp_list_comments ( array ( 'callback' => 'bp_dtheme_blog_comments' , 'type' => 'comment' ) ) ?>
2012-07-11 16:28:51 +00:00
</ ol ><!-- . comment - list -->
2012-08-08 16:49:22 +00:00
< ? php do_action ( 'bp_after_blog_comment_list' ) ?>
2012-07-11 16:28:51 +00:00
< ? php if ( get_option ( 'page_comments' ) ) : ?>
< div class = " comment-navigation paged-navigation " >
2012-08-08 16:49:22 +00:00
< ? php paginate_comments_links () ?>
2012-07-11 16:28:51 +00:00
</ div >
< ? php endif ; ?>
</ div ><!-- #comments -->
< ? php else : ?>
< ? php if ( pings_open () && ! comments_open () && ( is_single () || is_page () ) ) : ?>
< p class = " comments-closed pings-open " >
2012-08-08 16:49:22 +00:00
< ? 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' ) ) ?>
2012-07-11 16:28:51 +00:00
</ p >
< ? php elseif ( ! comments_open () && ( is_single () || is_page () ) ) : ?>
< p class = " comments-closed " >
2012-08-08 16:49:22 +00:00
< ? php _e ( 'Comments are closed.' , 'buddypress' ) ?>
2012-07-11 16:28:51 +00:00
</ p >
< ? php endif ; ?>
< ? php endif ; ?>
< ? php if ( comments_open () ) : ?>
2012-08-08 16:49:22 +00:00
< ? php comment_form () ?>
2012-07-11 16:28:51 +00:00
< ? php endif ; ?>
< ? php if ( ! empty ( $num_trackbacks ) ) : ?>
< div id = " trackbacks " >
2012-08-08 16:49:22 +00:00
< h3 >< ? php printf ( _n ( '1 trackback' , '%d trackbacks' , $num_trackbacks , 'buddypress' ), number_format_i18n ( $num_trackbacks ) ) ?> </h3>
2012-07-11 16:28:51 +00:00
< ul id = " trackbacklist " >
2012-08-08 16:49:22 +00:00
< ? php foreach ( ( array ) $comments as $comment ) : ?>
2012-07-11 16:28:51 +00:00
< ? php if ( 'comment' != get_comment_type () ) : ?>
< li >
2012-08-08 16:49:22 +00:00
< h5 >< ? php comment_author_link () ?> </h5>
< em > on < ? php comment_date () ?> </em>
2012-07-11 16:28:51 +00:00
</ li >
< ? php endif ; ?>
< ? php endforeach ; ?>
</ ul >
</ div >
< ? php endif ; ?>