Changeset 3361
- Timestamp:
- 07/14/2011 01:33:23 AM (14 years ago)
- Location:
- branches/plugin/bbp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-common-functions.php
r3350 r3361 251 251 */ 252 252 function bbp_get_paged() { 253 global $wp_query; 253 254 254 255 // Make sure to not paginate widget queries 255 if ( !bbp_is_query_name( 'bbp_widget' ) && ( $paged = get_query_var( 'paged' ) ) ) 256 return (int) $paged; 256 if ( !bbp_is_query_name( 'bbp_widget' ) ) { 257 258 // Check the query var 259 if ( get_query_var( 'paged' ) ) { 260 $paged = get_query_var( 'paged' ); 261 262 // Check query paged 263 } elseif ( !empty( $wp_query->query[paged] ) ) { 264 $paged = $wp_query->query[paged]; 265 } 266 267 // Paged found 268 if ( !empty( $paged ) ) { 269 return (int) $paged; 270 } 271 } 257 272 258 273 // Default to first page -
branches/plugin/bbp-includes/bbp-reply-template.php
r3352 r3361 141 141 // If pretty permalinks are enabled, make our pagination pretty 142 142 if ( $wp_rewrite->using_permalinks() ) { 143 143 144 144 // Page or single 145 145 if ( is_page() || is_single() ) { 146 $base = user_trailingslashit( trailingslashit( get_permalink() ) . 'page/%#%/');146 $base = get_permalink(); 147 147 148 148 // Topic 149 149 } else { 150 $base = user_trailingslashit( trailingslashit( get_permalink( bbp_get_topic_id() ) ) . 'page/%#%/');150 $base = get_permalink( bbp_get_topic_id() ); 151 151 } 152 153 $base = trailingslashit( $base ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' ); 152 154 153 155 // Unpretty permalinks … … 173 175 // Remove first page from pagination 174 176 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 ); 176 178 else 177 $bbp->reply_query->pagination_links = str_replace( '&paged=1', '', 179 $bbp->reply_query->pagination_links = str_replace( '&paged=1', '', $bbp->reply_query->pagination_links ); 178 180 } 179 181 … … 388 390 // Pretty permalinks 389 391 if ( $wp_rewrite->using_permalinks() ) { 390 $url = trailingslashit( $topic_url ) . trailingslashit( "page/{$reply_page}") . $reply_hash;392 $url = trailingslashit( $topic_url ) . trailingslashit( $wp_rewrite->pagination_base ) . trailingslashit( $reply_page ) . $reply_hash; 391 393 392 394 // Yucky links … … 528 530 */ 529 531 function bbp_reply_content_append_revisions( $content = '', $reply_id = 0 ) { 530 532 531 533 // Bail if in admin 532 534 if ( is_admin() ) -
branches/plugin/bbp-includes/bbp-topic-template.php
r3354 r3361 239 239 // Profile page 240 240 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() ); 242 242 243 243 // View 244 244 elseif ( bbp_is_single_view() ) 245 $base = user_trailingslashit( trailingslashit( bbp_get_view_url() ) . 'page/%#%/');245 $base = bbp_get_view_url(); 246 246 247 247 // Page or single post 248 248 elseif ( is_page() || is_single() ) 249 $base = user_trailingslashit( trailingslashit( get_permalink() ) . 'page/%#%/');249 $base = get_permalink(); 250 250 251 251 // Topic archive 252 252 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 ); 254 254 255 255 // Default 256 256 else 257 $base = user_trailingslashit( trailingslashit( get_permalink( $post_parent ) ) . 'page/%#%/' ); 257 $base = get_permalink( $post_parent ); 258 259 // Use pagination base 260 $base = trailingslashit( $base ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' ); 258 261 259 262 // Unpretty pagination … … 277 280 278 281 // Remove first page from pagination 279 $bbp->topic_query->pagination_links = str_replace( 'page/1/\'', '\'', $bbp->topic_query->pagination_links );282 $bbp->topic_query->pagination_links = str_replace( $wp_rewrite->pagination_base . "/1/'", "'", $bbp->topic_query->pagination_links ); 280 283 } 281 284 … … 656 659 // If pretty permalinks are enabled, make our pagination pretty 657 660 if ( $wp_rewrite->using_permalinks() ) 658 $base = user_trailingslashit( trailingslashit( get_permalink( $topic_id ) ) . 'page/%#%/' );661 $base = trailingslashit( get_permalink( $topic_id ) ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' ); 659 662 else 660 663 $base = add_query_arg( 'paged', '%#%' ); … … 684 687 // Remove first page from pagination 685 688 if ( $wp_rewrite->using_permalinks() ) 686 $pagination_links = str_replace( 'page/1/','', $pagination_links );689 $pagination_links = str_replace( $wp_rewrite->pagination_base . '/1/', '', $pagination_links ); 687 690 else 688 691 $pagination_links = str_replace( '&paged=1', '', $pagination_links );
Note: See TracChangeset
for help on using the changeset viewer.