Change groups_show() to use -title file instead of constantly contacting local nntp server.
This commit is contained in:
parent
0983b18399
commit
db2a64ef45
|
@ -502,50 +502,36 @@ function groups_read($server,$port,$load=0,$force_reload=false) {
|
||||||
if ($ns == false) return false;
|
if ($ns == false) return false;
|
||||||
// $gf=fopen($file_groups,"r");
|
// $gf=fopen($file_groups,"r");
|
||||||
$gfdata = file($file_groups);
|
$gfdata = file($file_groups);
|
||||||
// if we want to mark groups with new articles with colors, wie will later
|
// if we want to mark groups with new articles with colors, we will later
|
||||||
// need the format of the overview
|
// need the format of the overview
|
||||||
$overviewformat=thread_overview_read($ns);
|
$overviewformat=thread_overview_read($ns);
|
||||||
foreach($gfdata as $gf) {
|
foreach($gfdata as $gf) {
|
||||||
$gruppe=new newsgroupType;
|
$gruppe=new newsgroupType;
|
||||||
$tmp=trim($gf);
|
$tmp=preg_replace('/\t/', ' ', trim($gf));
|
||||||
$tmp=preg_replace('/\t/', ' ', $tmp);
|
|
||||||
if(substr($tmp,0,1)==":") {
|
if(substr($tmp,0,1)==":") {
|
||||||
$gruppe->text=substr($tmp,1);
|
$gruppe->text=substr($tmp,1);
|
||||||
$newsgroups[]=$gruppe;
|
$newsgroups[]=$gruppe;
|
||||||
} elseif(strlen(trim($tmp))>0) {
|
} elseif(strlen($tmp)>0) {
|
||||||
// is there a description in groups.txt?
|
// is there a description in groups.txt?
|
||||||
$pos=strpos($tmp," ");
|
$gr = explode(" ", $tmp, 2);
|
||||||
if ($pos != false) {
|
if(isset($gr[1])) { // Yes
|
||||||
// yes.
|
$gruppe->name=$gr[0];
|
||||||
$gruppe->name=substr($tmp,0,$pos);
|
$desc=$gr[1];
|
||||||
$desc=substr($tmp,$pos);
|
} else { // No
|
||||||
} else {
|
|
||||||
// no, get it from the newsserver.
|
// no, get it from the newsserver.
|
||||||
$gruppe->name=$tmp;
|
$gruppe->name=$tmp;
|
||||||
fputs($ns,"XGTITLE $gruppe->name\r\n");
|
if(is_file($spooldir.'/'.$tmp.'-title')) {
|
||||||
$response=line_read($ns);
|
$response = file_get_contents($spooldir.'/'.$tmp.'-title');
|
||||||
if (strcmp(substr($response,0,3),"282") == 0) {
|
$desc=strrchr($response,"\t");
|
||||||
$neu=line_read($ns);
|
|
||||||
do {
|
|
||||||
$response=$neu;
|
|
||||||
echo $response;
|
|
||||||
if ($neu != ".") $neu=line_read($ns);
|
|
||||||
} while ($neu != ".");
|
|
||||||
$desc=strrchr($response,"\t");
|
|
||||||
if (strcmp($response,".") == 0) {
|
|
||||||
$desc="-";
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$desc="";
|
$desc = "-";
|
||||||
}
|
}
|
||||||
if (strcmp(substr($response,0,3),"500") == 0)
|
|
||||||
$desc="-";
|
|
||||||
}
|
}
|
||||||
if (strcmp($desc,"") == 0) $desc="-";
|
if (strcmp($desc,"") == 0) $desc="-";
|
||||||
$gruppe->description=$desc;
|
$gruppe->description=$desc;
|
||||||
fputs($ns,"GROUP ".$gruppe->name."\r\n");
|
fputs($ns,"GROUP ".$gruppe->name."\r\n");
|
||||||
$t=explode(" ",line_read($ns));
|
$t=explode(" ",line_read($ns));
|
||||||
//RETRO
|
|
||||||
if($t[0]=="211")
|
if($t[0]=="211")
|
||||||
$gruppe->count=$t[1];
|
$gruppe->count=$t[1];
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue