Changeset 2855
- Timestamp:
- 09/08/2005 09:05:07 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-links.php
r2803 r2855 438 438 $max_page = $max_num_pages; 439 439 } else { 440 preg_match('#FROM (.*) GROUP BY#', $request, $matches);440 preg_match('#FROM\s(.*)\sGROUP BY#siU', $request, $matches); 441 441 $fromwhere = $matches[1]; 442 $numposts = $wpdb->get_var("SELECT COUNT( ID) FROM $fromwhere");442 $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere"); 443 443 $max_page = $max_num_pages = ceil($numposts / $posts_per_page); 444 444 } … … 480 480 if (get_query_var('what_to_show') == 'posts') { 481 481 if ( ! isset($max_num_pages) ) { 482 preg_match('#FROM (.*) GROUP BY#', $request, $matches);482 preg_match('#FROM\s(.*)\sGROUP BY#siU', $request, $matches); 483 483 $fromwhere = $matches[1]; 484 $numposts = $wpdb->get_var("SELECT COUNT( ID) FROM $fromwhere");484 $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere"); 485 485 $max_num_pages = ceil($numposts / $posts_per_page); 486 486 }
Note: See TracChangeset
for help on using the changeset viewer.