Skip to:
Content

bbPress.org

Ticket #3652: 3652-2.diff

File 3652-2.diff, 1.4 KB (added by johnjamesjacoby, 7 months ago)

Rev 2 - a bit cleaner, with more docs

  • template.php

     
    33163316
    33173317                // Topic has activity (could be from reply or topic author)
    33183318                $last_active = bbp_get_topic_last_active_id( $topic_id );
    3319                 if ( ! empty( $vc_int ) && ! empty( $last_active ) ) {
    3320                         $last_updated_by = bbp_get_author_link( array( 'post_id' => $last_active, 'size' => $r['size'] ) );
    3321                         $retstr          = sprintf( esc_html__( 'This topic has %1$s, %2$s, and was last updated %3$s by %4$s.', 'bbpress' ), $reply_count, $voice_count, $time_since, $last_updated_by );
     3319                if ( ! empty( $last_active ) ) {
    33223320
     3321                        // Last-updated-by should always exist if last-active does
     3322                        $last_updated_by = bbp_get_author_link( array(
     3323                                'post_id' => $last_active,
     3324                                'size'    => $r['size']
     3325                        ) );
     3326
     3327                        // Voice count is non-zero (registered users engaged)
     3328                        if ( ! empty( $vc_int ) ) {
     3329                                $retstr = sprintf( esc_html__( 'This topic has %1$s, %2$s, and was last updated %3$s by %4$s.', 'bbpress' ), $reply_count, $voice_count, $time_since, $last_updated_by );
     3330
     3331                        // Voice count is zero (anonymous users only)
     3332                        } else {
     3333                                $retstr = sprintf( esc_html__( 'This topic was last updated %1$s by %2$s.', 'bbpress' ), $time_since, $last_updated_by );
     3334                        }
     3335
    33233336                // Topic has no replies
    33243337                } elseif ( ! empty( $vc_int ) && ! empty( $reply_count ) ) {
    33253338                        $retstr = sprintf( esc_html__( 'This topic has %1$s and %2$s.', 'bbpress' ), $voice_count, $reply_count );