Skip to:
Content

BuddyPress.org

Ticket #3245: 3245-4.patch

File 3245-4.patch, 2.4 KB (added by DJPaul, 13 years ago)
  • bp-themes/bp-default/functions.php

     
    671671}
    672672add_action( 'bp_sidebar_login_form', 'bp_dtheme_sidebar_login_redirect_to' );
    673673
     674if ( !function_exists( 'bp_dtheme_comment_status' ) ) :
     675/**
     676 * Inserts the nu
     677 *
     678 * @since 1.3
     679 */
     680function bp_dtheme_comment_status() {
     681        $comments_count = get_comments_number();
     682
     683        if ( comments_open() ) {
     684                if ( 0 == $comments_count )
     685                        $comment_status = __( 'No Comments', 'buddypress' );
     686                else
     687                        $comment_status = sprintf( _n( '1 Comment', '%d Comments', $comments_count, 'buddypress' ), $comments_count );
     688
     689        } else {
     690                if ( 0 == $comments_count )
     691                        $comment_status = __( 'No Comments (now closed)', 'buddypress' );
     692                else
     693                        $comment_status = sprintf( _n( '1 Comment (now closed)', '%d Comments (now closed)', $comments_count, 'buddypress' ), $comments_count );
     694        }
     695
     696        echo apply_filters( 'bp_dtheme_comment_status', $comment_status );
     697}
     698endif;
    674699?>
     700 No newline at end of file
  • bp-themes/bp-default/single.php

     
    3030                                                        <?php wp_link_pages( array( 'before' => '<div class="page-link"><p>' . __( 'Pages: ', 'buddypress' ), 'after' => '</p></div>', 'next_or_number' => 'number' ) ); ?>
    3131                                                </div>
    3232
    33                                                 <p class="postmetadata"><?php the_tags( '<span class="tags">' . __( 'Tags: ', 'buddypress' ), ', ', '</span>' ); ?> <span class="comments"><?php comments_popup_link( __( 'No Comments &#187;', 'buddypress' ), __( '1 Comment &#187;', 'buddypress' ), __( '% Comments &#187;', 'buddypress' ) ); ?></span></p>
     33                                                <p class="postmetadata">
     34                                                        <?php the_tags( '<span class="tags">' . __( 'Tags: ', 'buddypress' ), ', ', '</span> ' ); ?>
     35                                                        <span class="comments"><?php bp_dtheme_comment_status(); ?></span>
     36                                                </p>
    3437
    3538                                                <div class="alignleft"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'buddypress' ) . '</span> %title' ); ?></div>
    3639                                                <div class="alignright"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'buddypress' ) . '</span>' ); ?></div>