X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=banana%2Fspool.inc.php;h=c7a7daeb85471109d0434be7befed00cf7f9c297;hb=fb6428c855e1be6fed8326d1ddecbf7a4eab3f60;hp=17296b17ee0685f062944f6c071e2414760f093c;hpb=7c111d8d564aa37efe0b364081fabc03c9f42357;p=banana.git diff --git a/banana/spool.inc.php b/banana/spool.inc.php index 17296b1..c7a7dae 100644 --- a/banana/spool.inc.php +++ b/banana/spool.inc.php @@ -104,18 +104,22 @@ class BananaSpool $this->_readFromFile(); $do_save = false; - $first = $banana->maxspool ? max($groupinfo[2]-$banana->maxspool, $groupinfo[1]) : $groupinfo[1]; - $last = $groupinfo[2]; - if ($this->version == BANANA_SPOOL_VERSION && is_array($this->overview)) { - if (count($this->overview)) { - for ($id = min(array_keys($this->overview)); $id<$first; $id++) { + $first = $banana->maxspool ? max($groupinfo[2] - $banana->maxspool, $groupinfo[1]) : $groupinfo[1]; + $last = $groupinfo[2]; + + if ($this->version == BANANA_SPOOL_VERSION && is_array($this->overview)) { + $mids = array_keys($this->overview); + foreach ($mids as $id) { + if (($first <= $last && ($id < $first || $id > $last)) + || ($first > $last && $id < $first && $id > $last)) + { $this->delid($id, false); $do_save = true; } } if (!empty($this->overview)) { $first = max(array_keys($this->overview))+1; - } + } } else { unset($this->overview, $this->ids); $this->version = BANANA_SPOOL_VERSION; @@ -341,7 +345,9 @@ class BananaSpool if ($_index == $_ref) { $res .= ''.htmlentities($subject).''; } else { - $res .= "".htmlentities($subject).''; + $res .= makeHREF(Array('group' => $this->group, + 'artid' => $_id), + htmlentities($subject)); } $res .= "\n".formatFrom($this->overview[$_id]->from)."\n";