Changeset 6300 for trunk/src/includes/search/template.php
- Timestamp:
- 02/21/2017 11:25:09 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/search/template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/search/template.php
r6228 r6300 402 402 403 403 // Set pagination values 404 $start_num = intval( ( $bbp->search_query->paged - 1 ) * $bbp->search_query->posts_per_page ) + 1; 405 $from_num = bbp_number_format( $start_num ); 406 $to_num = bbp_number_format( ( $start_num + ( $bbp->search_query->posts_per_page - 1 ) > $bbp->search_query->found_posts ) ? $bbp->search_query->found_posts : $start_num + ( $bbp->search_query->posts_per_page - 1 ) ); 407 $total_int = (int) $bbp->search_query->found_posts; 408 $total = bbp_number_format( $total_int ); 404 $total_int = intval( $bbp->search_query->found_posts ); 405 $ppp_int = intval( $bbp->search_query->posts_per_page ); 406 $start_int = intval( ( $bbp->search_query->paged - 1 ) * $ppp_int ) + 1; 407 $to_int = intval( ( $start_int + ( $ppp_int - 1 ) > $total_int ) 408 ? $total_int 409 : $start_int + ( $ppp_int - 1 ) ); 410 411 // Format numbers for display 412 $total_num = bbp_number_format( $total_int ); 413 $from_num = bbp_number_format( $start_int ); 414 $to_num = bbp_number_format( $to_int ); 409 415 410 416 // Single page of results 411 417 if ( empty( $to_num ) ) { 412 $retstr = sprintf( _n( 'Viewing %1$s result', 'Viewing %1$s results', $total_int, 'bbpress' ), $total );418 $retstr = sprintf( _n( 'Viewing %1$s result', 'Viewing %1$s results', $total_int, 'bbpress' ), $total_num ); 413 419 414 420 // Several pages of results 415 421 } else { 416 $retstr = sprintf( _n( 'Viewing %2$s results (of %4$s total)', 'Viewing %1$s results - %2$s through %3$s (of %4$s total)', $bbp->search_query->post_count, 'bbpress' ), $bbp->search_query->post_count, $from_num, $to_num, $total ); 417 422 $retstr = sprintf( _n( 'Viewing %2$s results (of %4$s total)', 'Viewing %1$s results - %2$s through %3$s (of %4$s total)', $bbp->search_query->post_count, 'bbpress' ), $bbp->search_query->post_count, $from_num, $to_num, $total_num ); 418 423 } 419 424
Note: See TracChangeset
for help on using the changeset viewer.