Changeset 1791
- Timestamp:
- 10/13/2004 02:18:17 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/template-functions-links.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-links.php
r1785 r1791 505 505 global $paged, $result, $request, $posts_per_page, $wpdb; 506 506 if (!$max_page) { 507 preg_match('# WHERE(.*) GROUP BY#', $request, $matches);508 $ where = $matches[1];509 $numposts = $wpdb->get_var("SELECT COUNT(ID) FROM $ wpdb->posts WHERE $where");507 preg_match('#FROM (.*) GROUP BY#', $request, $matches); 508 $fromwhere = $matches[1]; 509 $numposts = $wpdb->get_var("SELECT COUNT(ID) FROM $fromwhere"); 510 510 $max_page = ceil($numposts / $posts_per_page); 511 511 } … … 546 546 547 547 if (get_query_var('what_to_show') == 'posts') { 548 preg_match('# WHERE(.*) GROUP BY#', $request, $matches);549 $ where = $matches[1];550 $numposts = $wpdb->get_var("SELECT COUNT(ID) FROM $ wpdb->posts WHERE $where");548 preg_match('#FROM (.*) GROUP BY#', $request, $matches); 549 $fromwhere = $matches[1]; 550 $numposts = $wpdb->get_var("SELECT COUNT(ID) FROM $fromwhere"); 551 551 $max_page = ceil($numposts / $posts_per_page); 552 552 } else {
Note: See TracChangeset
for help on using the changeset viewer.