Changeset 3558 for branches/plugin/bbp-includes/bbp-topic-template.php
- Timestamp:
- 10/30/2011 04:41:28 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-topic-template.php
r3505 r3558 185 185 186 186 // Get all stickies 187 if ( $sticky_posts = get_posts( $sticky_query ) ) { 187 $sticky_posts = get_posts( $sticky_query ); 188 if ( !empty( $sticky_posts ) ) { 188 189 189 190 // Get a count of the visible stickies … … 520 521 521 522 // Set root text to page title 522 if ( $page = bbp_get_page_by_path( $bbp->topic_archive_slug ) ) { 523 $page = bbp_get_page_by_path( $bbp->topic_archive_slug ); 524 if ( !empty( $page ) ) { 523 525 $title = get_the_title( $page->ID ); 524 526 … … 688 690 689 691 // Add pagination to query object 690 if ( $pagination_links = paginate_links( $pagination ) ) { 692 $pagination_links = paginate_links( $pagination ); 693 if ( !empty( $pagination_links ) ) { 691 694 692 695 // Remove first page from pagination 693 if ( $wp_rewrite->using_permalinks() ) 696 if ( $wp_rewrite->using_permalinks() ) { 694 697 $pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $pagination_links ); 695 else698 } else { 696 699 $pagination_links = str_replace( '&paged=1', '', $pagination_links ); 700 } 697 701 698 702 // Add before and after to pagination links … … 1162 1166 $author_avatar = ''; 1163 1167 1164 if ( $topic_id = bbp_get_topic_id( $topic_id ) ) { 1165 1166 // Check for anonymous user 1167 if ( !bbp_is_topic_anonymous( $topic_id ) ) 1168 $topic_id = bbp_get_topic_id( $topic_id ); 1169 if ( !empty( $topic_id ) ) { 1170 if ( !bbp_is_topic_anonymous( $topic_id ) ) { 1168 1171 $author_avatar = get_avatar( bbp_get_topic_author_id( $topic_id ), $size ); 1169 else1172 } else { 1170 1173 $author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size ); 1174 } 1171 1175 } 1172 1176 … … 1479 1483 1480 1484 // Try to get the most accurate freshness time possible 1481 if ( !$last_active = get_post_meta( $topic_id, '_bbp_last_active_time', true ) ) { 1482 if ( $reply_id = bbp_get_topic_last_reply_id( $topic_id ) ) { 1485 $last_active = get_post_meta( $topic_id, '_bbp_last_active_time', true ); 1486 if ( empty( $last_active ) ) { 1487 $reply_id = bbp_get_topic_last_reply_id( $topic_id ); 1488 if ( !empty( $reply_id ) ) { 1483 1489 $last_active = get_post_field( 'post_date', $reply_id ); 1484 1490 } else { … … 1712 1718 1713 1719 // No link 1714 if ( bbp_get_view_all() ) 1720 if ( bbp_get_view_all() ) { 1715 1721 $retval .= " $extra"; 1716 1722 1717 1723 // Link 1718 else1724 } else { 1719 1725 $retval .= " <a href='" . esc_url( bbp_add_view_all( bbp_get_topic_permalink( $topic_id ), true ) ) . "'>$extra</a>"; 1726 } 1720 1727 } 1721 1728 … … 2743 2750 2744 2751 // Topic has replies 2745 if ( $last_reply = bbp_get_topic_last_active_id( $topic_id ) ) { 2752 $last_reply = bbp_get_topic_last_active_id( $topic_id ); 2753 if ( !empty( $last_reply ) ) { 2746 2754 $last_updated_by = bbp_get_author_link( array( 'post_id' => $last_reply, 'size' => $size ) ); 2747 $retstr = sprintf( __( 'This topic has %1$s, contains %2$s, and was last updated by %3$s %4$s ago.', 'bbpress' ), $voice_count, $reply_count, $last_updated_by, $time_since );2755 $retstr = sprintf( __( 'This topic contains %1$s, has %2$s, and was last updated by %3$s %4$s ago.', 'bbpress' ), $reply_count, $voice_count, $last_updated_by, $time_since ); 2748 2756 2749 2757 // Topic has no replies 2750 2758 } else { 2751 $retstr = sprintf( __( 'This topic has %1$s, contains %2$s.', 'bbpress' ), $voice_count, $reply_count );2759 $retstr = sprintf( __( 'This topic contains %1$s and has %2$s.', 'bbpress' ), $voice_count, $reply_count ); 2752 2760 } 2753 2761
Note: See TracChangeset
for help on using the changeset viewer.