summaryrefslogtreecommitdiffstats
path: root/wp-inst
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-14 11:02:50 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-14 11:02:50 +0000
commit8806bec197b7f49ecfb289bc1cb6b811228c6480 (patch)
tree451648e1f76c84e2e88ecc65a105ce6f9510608d /wp-inst
parent1896c160f4a97415556dd8db89ae7a7d9567d8c4 (diff)
downloadwordpress-mu-8806bec197b7f49ecfb289bc1cb6b811228c6480.tar.gz
wordpress-mu-8806bec197b7f49ecfb289bc1cb6b811228c6480.tar.xz
wordpress-mu-8806bec197b7f49ecfb289bc1cb6b811228c6480.zip
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@562 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst')
-rw-r--r--wp-inst/wp-includes/classes.php2
-rw-r--r--wp-inst/wp-includes/query.php11
2 files changed, 9 insertions, 4 deletions
diff --git a/wp-inst/wp-includes/classes.php b/wp-inst/wp-includes/classes.php
index 79709db..a4ecc54 100644
--- a/wp-inst/wp-includes/classes.php
+++ b/wp-inst/wp-includes/classes.php
@@ -75,7 +75,7 @@ class retrospam_mgr {
class WP {
var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots');
- var $private_query_vars = array('posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'post_type');
+ var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'post_type');
var $extra_query_vars = array();
var $query_vars;
diff --git a/wp-inst/wp-includes/query.php b/wp-inst/wp-includes/query.php
index 5e47486..034b271 100644
--- a/wp-inst/wp-includes/query.php
+++ b/wp-inst/wp-includes/query.php
@@ -874,9 +874,14 @@ class WP_Query {
}
if (($q['what_to_show'] == 'posts')) {
- $pgstrt = '';
- $pgstrt = (intval($page) -1) * $q['posts_per_page'] . ', ';
- $limits = 'LIMIT '.$pgstrt.$q['posts_per_page'];
+ if ( empty($q['offset']) ) {
+ $pgstrt = '';
+ $pgstrt = (intval($page) -1) * $q['posts_per_page'] . ', ';
+ $limits = 'LIMIT '.$pgstrt.$q['posts_per_page'];
+ } else { // we're ignoring $page and using 'offset'
+ $pgstrt = intval($q['offset']) . ', ';
+ $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
+ }
} elseif ($q['what_to_show'] == 'days') {
$startrow = $q['posts_per_page'] * (intval($page)-1);
$start_date = $wpdb->get_var("SELECT max(post_date) FROM $wpdb->posts $join WHERE (1=1) $where GROUP BY year(post_date), month(post_date), dayofmonth(post_date) ORDER BY post_date DESC LIMIT $startrow,1");