#!/util/bin/perl require "/util/apache/cgi-bin/cgi-lib.pl"; require "/util/apache/cgi-bin/muse-lib.pl"; print &PrintHeader; &ReadParse; $cats = "cats.tab"; $database = "big.db"; $foot = "foot.html"; if (-r $cats) { open (CATS,$cats); @catlines = ; close (CATS); foreach $c (@catlines) { chop $c; @cels = split(/\t/,$c); $text{$cels[0]} = $cels[1]; $graphic{$cels[0]} = $cels[2]; $headfile{$cels[0]} = $cels[3]; } } else { die ("Sorry, can't open categories file.\n"); } $incat = $ARGV[0]; print "WNY Web: $text{$incat}"; print "\n"; print "

\"WNY

\n"; print ""; if (-r $headfile{$incat} ) { &plopFile($headfile{$incat}); } if (-r $database) { open (DB, $database); @dblines = ; close DB; } else { die ("Sorry, can't open sites database.\n"); } foreach $line (@dblines) { @els = split(/\|/,$line); if ($els[1] eq $incat && $els[9] !~ /PENDING/ && $els[9] !~ /BAD/) { $subcats{$els[2]} += 1; push (@results,-1,0,$line); } } print "
    "; foreach $subcat (sort (keys (%subcats))) { if ($subcat =~ /./) { print "
  • $subcat\n"; } } print "
"; if (!($in{'desc'})) { print "
"; print ""; print ""; print "
Webmasters should send us mail to add their descriptions.\n"; print "
"; print "
"; } else { print "
"; print "
"; print "
"; } print "

"; print "

\n"; foreach $subcat (sort (keys (%subcats))) { print "

$subcat"; foreach $hit (sort sort_criteria (@results)) { @hels = split(/\|/,$hit); if ($hels[2] eq $subcat) { print "
$hels[4]\n"; if ($in{'desc'} && $hels[8]) { print "
$hels[8]\n"; } } } } print "
"; open (FOOT,$foot); @feet = ; close (FOOT); print @feet; sub sort_criteria { @splita = split(/\|/,$a); @splitb = split(/\|/,$b); if ($splita[4] ge $splitb[4]) { $retval = 1; } else { $retval = -1; } return $retval; }