#!/util/bin/perl require "/home/unix/web//cgi-bin/cgi-lib.pl"; require "/home/unix/web/cgi-bin/muse-lib.pl"; $database = "class.db"; $cats = "categories.db"; $email = "ads\@wnyweb.com"; &ReadParse; print &PrintHeader; print "WNYWeb Classifieds"; print ""; print "
\"WNYWeb

"; print "
"; &printForm; print "
"; open (DB,$database) || die "Error opening database.\n"; @db = ; close (DB); chop @db; open (CATS,$cats) || die "Error opening database.\n"; @cats = ; close (CATS); chop @cats; foreach $c (@cats) { $count{$c} = 0; } foreach $line (@db) { @els = split (/\t/,$line); $count{$els[5]}++; } $catsize = @cats; print "
\n"; print "
    "; for ($i=0;$i<($catsize/2);$i++) { $url = $cats[$i]; $url =~ s/\ /_/g; if ($count{$cats[$i]} > 0) { print "
  • $cats[$i] ($count{$cats[$i]})\n"; } else { print "
  • $cats[$i]\n"; } } print "
    \n"; for ($i=($catsize/2);$i<$catsize;$i++) { $url = $cats[$i]; $url =~ s/\ /_/g; if ($count{$cats[$i]} > 0) { print "
  • $cats[$i] ($count{$cats[$i]})\n"; } else { print "
  • $cats[$i]\n"; } } print "
\n"; sub printForm { print "
\n"; print "Search: \n"; print "
\n"; print "
\n"; print "Please note: WNYWeb is providing this resource \n"; print "as a service to the Western New York community. We cannot \n"; print "be held responsible for the validity of any ads contained herein \n"; print ". We reserve the right to remove classifieds at any time.

\n"; print "

\n"; print "\n"; }