#!/util/bin/perl require "/home/unix/web/cgi-bin/cgi-lib.pl"; print &PrintHeader; $cats = "cats.tab"; $database = "big.db"; $foot = "foot.html"; print "WNY Web: New"; print ""; print "

Entries Modified in the Last Three Months

\n"; print "
"; if (-r $database) { open (DB, $database); @dblines = ; close DB; } else { die ("Sorry, can't open sites database.\n"); } @timelist = localtime(time); $date = $timelist[4]+1 . "/" . $timelist[3] . "/" . $timelist[5]; $currmonth = $timelist[4]+1; $curryear = $timelist[5]; foreach $line (@dblines) { @els = split(/\|/,$line); if ($els[9] !~ /PENDING/i && $els[9] !~ /BAD/i) { @dels = split(/\//,$els[5]); if ( ($dels[2] == $curryear) && ($dels[0]+2 >= $currmonth) ) { push (@results,-1,0,$line); } elsif ( ($dels[2]+1 == $curryear) && ( ($currmonth+9) <= $dels[0]) ) { push (@results,-1,0,$line); } } } print "
\n"; foreach $hit (sort sort_criteria @results) { @hels = split(/\|/,$hit); print "
$hels[4] ($hels[5])\n"; } print "
"; open (FOOT,$foot); @feet = ; close (FOOT); print @feet; sub sort_criteria { @splita = split(/\|/,$a); @splitb = split(/\|/,$b); @ma = split(/\//,$splita[5]); @mb = split(/\//,$splitb[5]); if ($ma[2] > $mb[2]) { $retval = -1; } elsif ($ma[0] > $mb[0]) { $retval = -1; } elsif ( ($ma[0] == $mb[0]) && ($ma[1] >= $mb[1]) ) { $retval = -1; } else { $retval = 1; } return $retval; }