changed entry_cached_index, direct subclass... cache_filelister now probably useless; muted prev/next page for single; "last-entries" still broken; categories not tested yet
This commit is contained in:
parent
522d3616b8
commit
5572be3b3c
@ -94,6 +94,7 @@
|
|||||||
|
|
||||||
|
|
||||||
define('LANG_DEFAULT', 'en-us');
|
define('LANG_DEFAULT', 'en-us');
|
||||||
|
define('BPT_SORT', SORT_DESC);
|
||||||
|
|
||||||
|
|
||||||
set_include_path(ABS_PATH);
|
set_include_path(ABS_PATH);
|
||||||
|
@ -1,14 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class entry_cached_index extends cache_filelister {
|
class entry_cached_index extends caching_SBPT { #cache_filelister {
|
||||||
|
|
||||||
|
var $position = 0;
|
||||||
|
var $nodesize = 30;
|
||||||
|
var $keylen = 12;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* opens the index belonging to a given category
|
* opens the index belonging to a given category
|
||||||
* @params int $id_cat
|
* @params int $id_cat
|
||||||
*/
|
*/
|
||||||
function entry_cached_index($id_cat=0) {
|
function entry_cached_index($id_cat=0) {
|
||||||
$this->_cachefile = INDEX_DIR.'index-'.$id_cat;
|
$F = INDEX_DIR.'index-'.$id_cat.'.dat';
|
||||||
parent::cache_filelister();
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -179,10 +179,15 @@
|
|||||||
|
|
||||||
$qp =& $this->params;
|
$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);
|
trigger_error("FPDB: no entry found for {$qp->id}", E_USER_WARNING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->walker =& $entry_index->walker($key, true);
|
||||||
|
|
||||||
|
/*
|
||||||
if ($this->counter < 0) {
|
if ($this->counter < 0) {
|
||||||
|
|
||||||
$idlist = array_keys($entry_index);
|
$idlist = array_keys($entry_index);
|
||||||
@ -198,6 +203,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->pointer = $qp->start;
|
$this->pointer = $qp->start;
|
||||||
|
*/
|
||||||
|
|
||||||
|
$qp->start = 0;
|
||||||
|
$qp->count = 1;
|
||||||
|
$this->pointer = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,8 +355,6 @@
|
|||||||
|
|
||||||
$cont['comments'] = $this->comments->getCount();
|
$cont['comments'] = $this->comments->getCount();
|
||||||
|
|
||||||
/* index is updated with full-parsed entry */
|
|
||||||
#$this->local_index[$id] = $cont;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -427,6 +435,7 @@
|
|||||||
function getNextPage() {
|
function getNextPage() {
|
||||||
|
|
||||||
if ($this->single){
|
if ($this->single){
|
||||||
|
return false;
|
||||||
$id = $this->_getOffsetId(1, $this->params->start);
|
$id = $this->_getOffsetId(1, $this->params->start);
|
||||||
|
|
||||||
if ($id)
|
if ($id)
|
||||||
@ -450,6 +459,8 @@
|
|||||||
function getPrevPage() {
|
function getPrevPage() {
|
||||||
|
|
||||||
if ($this->single) {
|
if ($this->single) {
|
||||||
|
return false;
|
||||||
|
|
||||||
$id = $this->_getOffsetId(-1, $this->params->start);
|
$id = $this->_getOffsetId(-1, $this->params->start);
|
||||||
|
|
||||||
if ($id)
|
if ($id)
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
require_once INCLUDES_DIR.'core.fileio.php';
|
require_once INCLUDES_DIR.'core.fileio.php';
|
||||||
require_once INCLUDES_DIR.'core.cache.php';
|
require_once INCLUDES_DIR.'core.cache.php';
|
||||||
require_once INCLUDES_DIR.'core.blogdb.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.administration.php';
|
||||||
@ -33,7 +34,6 @@
|
|||||||
require_once INCLUDES_DIR.'core.static.php';
|
require_once INCLUDES_DIR.'core.static.php';
|
||||||
require_once INCLUDES_DIR.'core.draft.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.fpdb.class.php';
|
||||||
|
|
||||||
require_once INCLUDES_DIR.'core.language.php';
|
require_once INCLUDES_DIR.'core.language.php';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user