diff --git a/defaults.php b/defaults.php index 86e22e7..6cedd32 100755 --- a/defaults.php +++ b/defaults.php @@ -94,6 +94,7 @@ define('LANG_DEFAULT', 'en-us'); + define('BPT_SORT', SORT_DESC); set_include_path(ABS_PATH); diff --git a/fp-includes/core/core.entry.php b/fp-includes/core/core.entry.php index ff986b6..05b3784 100755 --- a/fp-includes/core/core.entry.php +++ b/fp-includes/core/core.entry.php @@ -1,14 +1,32 @@ _cachefile = INDEX_DIR.'index-'.$id_cat; - parent::cache_filelister(); + $F = INDEX_DIR.'index-'.$id_cat.'.dat'; + + if (!file_exists($F)) { + trigger_error ("Can't find index '{$F}'", E_USER_ERROR); + } + + parent::caching_SBPT( + fopen($F, 'rb'), + fopen(INDEX_DIR.'index.strings.dat', 'rb'), + 256, + $this->position, + $this->nodesize, + $this->keylen + ); + + $this->open(); } } diff --git a/fp-includes/core/core.fpdb.class.php b/fp-includes/core/core.fpdb.class.php index f8e644c..a0733d6 100644 --- a/fp-includes/core/core.fpdb.class.php +++ b/fp-includes/core/core.fpdb.class.php @@ -178,11 +178,16 @@ trigger_error("FPDB: no ID found for query {$this->ID}", E_USER_ERROR); $qp =& $this->params; - - if (!isset($entry_index[$qp->id])){ + + $key = entry_idtokey($qp->id); + if (!($entry_index->has_key($key))){ trigger_error("FPDB: no entry found for {$qp->id}", E_USER_WARNING); return; } + + $this->walker =& $entry_index->walker($key, true); + + /* if ($this->counter < 0) { $idlist = array_keys($entry_index); @@ -198,7 +203,12 @@ } $this->pointer = $qp->start; - + */ + + $qp->start = 0; + $qp->count = 1; + $this->pointer = 0; + } function _prepare_list(&$entry_index) { @@ -345,8 +355,6 @@ $cont['comments'] = $this->comments->getCount(); - /* index is updated with full-parsed entry */ - #$this->local_index[$id] = $cont; } } else { @@ -427,6 +435,7 @@ function getNextPage() { if ($this->single){ + return false; $id = $this->_getOffsetId(1, $this->params->start); if ($id) @@ -450,6 +459,8 @@ function getPrevPage() { if ($this->single) { + return false; + $id = $this->_getOffsetId(-1, $this->params->start); if ($id) diff --git a/fp-includes/core/includes.php b/fp-includes/core/includes.php index 16736e3..84036cd 100755 --- a/fp-includes/core/includes.php +++ b/fp-includes/core/includes.php @@ -22,8 +22,9 @@ require_once INCLUDES_DIR.'core.fileio.php'; require_once INCLUDES_DIR.'core.cache.php'; require_once INCLUDES_DIR.'core.blogdb.php'; - - + require_once INCLUDES_DIR.'core.bplustree.class.php'; + + require_once INCLUDES_DIR.'core.administration.php'; require_once INCLUDES_DIR.'core.widgets.php'; require_once INCLUDES_DIR.'core.comment.php'; @@ -33,7 +34,6 @@ require_once INCLUDES_DIR.'core.static.php'; require_once INCLUDES_DIR.'core.draft.php'; - require_once INCLUDES_DIR.'core.bplustree.class.php'; require_once INCLUDES_DIR.'core.fpdb.class.php'; require_once INCLUDES_DIR.'core.language.php'; diff --git a/index.php b/index.php index 6cfa554..1196c01 100644 --- a/index.php +++ b/index.php @@ -184,7 +184,7 @@ $fpdb->query($params); $q =& $fpdb->getQuery(); - list($id, $e) = @$q->peekEntry(); + list($id, $e) = $q->peekEntry(); /* no entry found : 404 */