Avoid reusing deleted article numbers when writing new articles
This commit is contained in:
parent
7545c5192a
commit
92c932cf75
@ -146,28 +146,23 @@ function get_articles($ns, $group) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($CONFIG['enable_nntp']) && $CONFIG['enable_nntp'] == true) {
|
if(isset($CONFIG['enable_nntp']) && $CONFIG['enable_nntp'] == true) {
|
||||||
$grouplist = file($local_groupfile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
|
||||||
foreach($grouplist as $findgroup) {
|
// Try to find last article number in local_groupfile
|
||||||
$name = explode(':', $findgroup);
|
$local = get_config_value($local_groupfile, $group);
|
||||||
if (strcmp($name[0], $group) == 0) {
|
if(!is_numeric($local)) {
|
||||||
if (is_numeric($name[1]))
|
$thisgroup = $path."/".preg_replace('/\./', '/', $group);
|
||||||
$local = $name[1];
|
$articles = scandir($thisgroup);
|
||||||
else {
|
$ok_article=array();
|
||||||
$thisgroup = $path."/".preg_replace('/\./', '/', $group);
|
foreach($articles as $this_article) {
|
||||||
$articles = scandir($thisgroup);
|
if(!is_numeric($this_article)) {
|
||||||
$ok_article=array();
|
continue;
|
||||||
foreach($articles as $this_article) {
|
|
||||||
if(!is_numeric($this_article)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$ok_article[]=$this_article;
|
|
||||||
}
|
|
||||||
sort($ok_article);
|
|
||||||
$local = $ok_article[key(array_slice($ok_article, -1, 1, true))];
|
|
||||||
if(!is_numeric($local))
|
|
||||||
$local = 0;
|
|
||||||
}
|
}
|
||||||
break;
|
$ok_article[]=$this_article;
|
||||||
|
}
|
||||||
|
sort($ok_article);
|
||||||
|
$local = $ok_article[key(array_slice($ok_article, -1, 1, true))];
|
||||||
|
if(!is_numeric($local)) {
|
||||||
|
$local = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($local < 1)
|
if($local < 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user