Skip to:
Content

bbPress.org

Ticket #1573: 1573.diff

File 1573.diff, 6.2 KB (added by scribu, 15 years ago)
  • bbp-includes/bbp-reply-template.php

    diff --git a/bbp-includes/bbp-reply-template.php b/bbp-includes/bbp-reply-template.php
    index 9fc3839..4509388 100644
    a b function bbp_has_replies( $args = '' ) { 
    140140
    141141                // If pretty permalinks are enabled, make our pagination pretty
    142142                if ( $wp_rewrite->using_permalinks() ) {
    143                                
     143
    144144                        // Page or single
    145145                        if ( is_page() || is_single() ) {
    146                                 $base = user_trailingslashit( trailingslashit( get_permalink() ) . 'page/%#%/' );
     146                                $base = get_permalink();
    147147
    148148                        // Topic
    149149                        } else {
    150                                 $base = user_trailingslashit( trailingslashit( get_permalink( bbp_get_topic_id() ) ) . 'page/%#%/' );
     150                                $base = get_permalink( bbp_get_topic_id() );
    151151                        }
    152152
     153                        $base = trailingslashit( $base ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' );
     154
    153155                // Unpretty permalinks
    154156                } else {
    155157                        $base = add_query_arg( 'paged', '%#%' );
    function bbp_has_replies( $args = '' ) { 
    172174
    173175                // Remove first page from pagination
    174176                if ( $wp_rewrite->using_permalinks() )
    175                         $bbp->reply_query->pagination_links = str_replace( 'page/1/\'',     '\'', $bbp->reply_query->pagination_links );
     177                        $bbp->reply_query->pagination_links = str_replace( $wp_rewrite->pagination_base . "/1/'", "'", $bbp->reply_query->pagination_links );
    176178                else
    177                         $bbp->reply_query->pagination_links = str_replace( '&paged=1', '',   $bbp->reply_query->pagination_links );
     179                        $bbp->reply_query->pagination_links = str_replace( '&paged=1', '', $bbp->reply_query->pagination_links );
    178180        }
    179181
    180182        // Return object
    function bbp_reply_excerpt( $reply_id = 0, $length = 100 ) { 
    527529 * @return string Content with the revisions appended
    528530 */
    529531function bbp_reply_content_append_revisions( $content = '', $reply_id = 0 ) {
    530        
     532
    531533        // Bail if in admin
    532534        if ( is_admin() )
    533535                return;
  • bbp-includes/bbp-topic-template.php

    diff --git a/bbp-includes/bbp-topic-template.php b/bbp-includes/bbp-topic-template.php
    index 167ccd8..933e5a5 100644
    a b function bbp_has_topics( $args = '' ) { 
    238238
    239239                        // Profile page
    240240                        if ( bbp_is_single_user() )
    241                                 $base = user_trailingslashit( trailingslashit( bbp_get_user_profile_url( bbp_get_displayed_user_id() ) ) . 'page/%#%/' );
     241                                $base = bbp_get_user_profile_url( bbp_get_displayed_user_id() );
    242242
    243243                        // View
    244244                        elseif ( bbp_is_single_view() )
    245                                 $base = user_trailingslashit( trailingslashit( bbp_get_view_url() ) . 'page/%#%/' );
     245                                $base = bbp_get_view_url();
    246246
    247247                        // Page or single post
    248248                        elseif ( is_page() || is_single() )
    249                                 $base = user_trailingslashit( trailingslashit( get_permalink() ) . 'page/%#%/' );
     249                                $base = get_permalink();
    250250
    251251                        // Topic archive
    252252                        elseif ( bbp_is_topic_archive() )
    253                                 $base = user_trailingslashit( trailingslashit( home_url( $bbp->topic_archive_slug ) ) . 'page/%#%/' );
     253                                $base = home_url( $bbp->topic_archive_slug );
    254254
    255255                        // Default
    256256                        else
    257                                 $base = user_trailingslashit( trailingslashit( get_permalink( $post_parent ) ) . 'page/%#%/' );
     257                                $base = get_permalink( $post_parent );
    258258
     259                        $base = trailingslashit( $base ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' );
    259260                // Unpretty pagination
    260261                } else {
    261262                        $base = add_query_arg( 'paged', '%#%' );
    function bbp_has_topics( $args = '' ) { 
    276277                $bbp->topic_query->pagination_links = paginate_links ( $bbp_topic_pagination );
    277278
    278279                // Remove first page from pagination
    279                 $bbp->topic_query->pagination_links = str_replace( 'page/1/\'', '\'', $bbp->topic_query->pagination_links );
     280                $bbp->topic_query->pagination_links = str_replace( $wp_rewrite->pagination_base . "/1/'", "'", $bbp->topic_query->pagination_links );
    280281        }
    281282
    282283        // Return object
    function bbp_topic_pagination( $args = '' ) { 
    655656
    656657                // If pretty permalinks are enabled, make our pagination pretty
    657658                if ( $wp_rewrite->using_permalinks() )
    658                         $base = user_trailingslashit( trailingslashit( get_permalink( $topic_id ) ) . 'page/%#%/' );
     659                        $base = trailingslashit( get_permalink( $topic_id ) ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' );
    659660                else
    660661                        $base = add_query_arg( 'paged', '%#%' );
    661662
    function bbp_topic_pagination( $args = '' ) { 
    683684
    684685                        // Remove first page from pagination
    685686                        if ( $wp_rewrite->using_permalinks() )
    686                                 $pagination_links = str_replace( 'page/1/',       '', $pagination_links );
     687                                $pagination_links = str_replace( $wp_rewrite->pagination_base . '1/',       '', $pagination_links );
    687688                        else
    688689                                $pagination_links = str_replace( '&paged=1', '', $pagination_links );
    689690
  • bbpress.php

    diff --git a/bbpress.php b/bbpress.php
    index 40653d5..c48d3a5 100644
    a b class bbPress { 
    931931                        $this->topic_tag_slug . '/([^/]+)/edit/?$' => 'index.php?' . $this->topic_tag_tax_id . '=' . $wp_rewrite->preg_index( 1 ) . '&edit=1',
    932932
    933933                        // Profile Page
    934                         $this->user_slug      . '/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?' . $this->user_id  . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ),
     934                        $this->user_slug      . '/([^/]+)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$' => 'index.php?' . $this->user_id  . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ),
    935935                        $this->user_slug      . '/([^/]+)/?$'                   => 'index.php?' . $this->user_id  . '=' . $wp_rewrite->preg_index( 1 ),
    936936                        $this->user_slug      . '/([^/]+)/edit/?$'              => 'index.php?' . $this->user_id  . '=' . $wp_rewrite->preg_index( 1 ) . '&edit=1',
    937937
    class bbPress { 
    943943                        //$this->view_slug      . '/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?' . $this->view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&feed='  . $wp_rewrite->preg_index( 2 ),
    944944
    945945                        // View Page
    946                         $this->view_slug . '/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?' . $this->view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ),
     946                        $this->view_slug . '/([^/]+)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$' => 'index.php?' . $this->view_id . '=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ),
    947947                        $this->view_slug . '/([^/]+)/?$'                   => 'index.php?' . $this->view_id . '=' . $wp_rewrite->preg_index( 1 )
    948948                );
    949949