diff --git a/fp-includes/core/core.bplustree.class.php b/fp-includes/core/core.bplustree.class.php index 78319f3..b3c2146 100755 --- a/fp-includes/core/core.bplustree.class.php +++ b/fp-includes/core/core.bplustree.class.php @@ -2466,9 +2466,9 @@ class BPlusWalker { $testkey = $node->keys[$nextp]; $keyupper = $this->keyupper; $this->valid =( is_null($keyupper) || - BPT_keycmp($testkey,$upper)<0|| + BPT_keycmp($testkey,$keyupper)<0|| #$testkey < $keyupper || - ($this->includeupper && $testkey == keyupper) ); + ($this->includeupper && $testkey == $keyupper) ); if ($this->valid) $this->node_index = $nextp; } diff --git a/fp-includes/core/core.fpdb.class.php b/fp-includes/core/core.fpdb.class.php index 99c4166..cf702a2 100644 --- a/fp-includes/core/core.fpdb.class.php +++ b/fp-includes/core/core.fpdb.class.php @@ -12,6 +12,7 @@ var $category = 0; var $page = 1; var $fullparse = false; + var $comments = false; function FPDB_QueryParams($params) { @@ -234,7 +235,7 @@ $qp =& $this->params; $entry_num = 0; - $this->walker =& $entry_index->walker(); + if (!$qp->y){ // searches the whole index @@ -242,16 +243,21 @@ #$this->local_list = array_keys($entry_index); $index_count = $entry_index->length(); - + $this->walker =& $entry_index->walker(); + } else { // notice this won't work with cats (for now) $obj =& new entry_archives($qp->y, $qp->m, $qp->d); - $filteredkeys = $obj->getList(); + $filteredkeys = $obj->getList(); $index_count = $obj->getCount(); + + $this->walker =& $entry_index->walker( + entry_idtokey($filteredkeys[0]), true, + entry_idtokey($filteredkeys[$index_count-1]), true + ); - $this->local_list =& $filteredkeys; } @@ -472,7 +478,8 @@ } if ($this->params->page) { - if ($this->_getOffsetId(0, ($this->params->start + $this->params->count))) + #if ($this->_getOffsetId(0, ($this->params->start + $this->params->count))) + if ($this->walker->valid) return array($GLOBALS['lang']['main']['nextpage'], $this->params->page + 1); }