)
{
if ($. < 5)
{
if ($metacomp eq "") { $metacomp = &GetMeta($_,"comp"); }
if ($metaprod eq "") { $metaprod = &GetMeta($_,"prod"); }
}
}
($lmetacomp = $metacomp) =~ tr/A-Z/a-z/;
($lmetaprod = $metaprod) =~ tr/A-Z/a-z/;
push(@comp,$lmetacomp . '~' . $metacomp . '~' . $metaprod . '~' . $metadate . '~' . $vpr );
push(@prod,$lmetaprod . '~' . $metaprod . '~' . $metacomp . '~' . $metadate . '~' . $vpr );
}
print "Content-type: text/html\n\n";
print "vpr admin";
print "";
print "
Updating...";
@comp = sort @comp;
@prod = sort @prod;
&BuildToc("comp","Complete",@comp);
&BuildToc("prod","Complete",@prod);
print "
Done updating.";
print "Back to the Virtual Press Room";
print "";
closedir(DIR);
sub BuildToc
{
local($which,$descrip,@view) = @_;
($v1_1, $v1_2, $v1_3, $v1_4, $v1_5) = split(/~/,$view[0],5);
if (($which eq "comp") || ($which eq "prod"))
{
$nav = "";
foreach $item (@view)
{
($junk,$first, $second, $third, $file) = split(/~/,$item,5);
($nav2 = substr($first,0,1)) =~ tr/a-z/A-Z/;
$nav2 =~ s/[0-9]/1/;
# print LOG "nav $nav nav2 $nav2\n";
if ($nav ne $nav2)
{
$nav = $nav2;
$toc = $which . "all" . $nav;
close TOC;
open (TOC, ">$DocRoot/$toc.htm");
print TOC "
$descrip press releases $typenames{$which}\n";
print TOC &StdHdr(1);
print TOC "$descrip press releases $typenames{$which}
";
print TOC "";
for (1,A..Z)
{
if ($nav ne $_)
{
$s = sprintf (" $_ ", $which, $_);
print TOC $s;
}
else
{ print TOC " $nav "; }
} #endfor
print TOC " ";
print TOC "";
} #endif
print TOC "- $first, $second, $third\n";
} #endforeach
} #endif
print TOC "
\n";
} #endsub
sub GetMeta
{
local($line,$meta) = @_;
if ( /(name=$meta)( content=)(.*)>/ )
{
$ret = $3;
}
else
{
$ret = "";
}
return $ret;
}
sub StdHdr
{
($tBackground) = @_;
$hdr = "\n";
if ($tBackground ="[unarchived-media]" 1)
{ $hdr = $hdr . "\n"; }
else
{ $hdr = $hdr . "\n"; }
$hdr = $hdr . "\n";
$hdr = $hdr . "\n";
$hdr = $hdr . "\n";
$hdr = $hdr . "\n";
$hdr = $hdr . "\n";
$hdr = $hdr . "\n";
$hdr = $hdr . "
";
$hdr = $hdr . "\n\n";
return $hdr;
}