## ## ossp_filelist.wml -- News Flash ## Copyright (c) 2000-2001 Ralf S. Engelschall ## # define a tag which can be used to create a file listing which # is optically more compact than the stuff Apache's mod_autoindex creates. # Especially the current version is marked red, too. <: my $url = ""; $url =~ s|/+$||sg; my $directory = ""; my $files = ""; my $highlight = ""; my $odir = chdir($directory) || die; my @F = reverse sort { (stat($a))[9] <=> (stat($b))[9]; } (glob($files)); chdir($odir); my $O = ''; @COL = ( '#e5e5e0', 'NONE', ); $ncol = 1; foreach my $f (@F) { my @S = stat($f); $f = "$f/" if (-d $f); my @T = localtime($S[9]); my @moy = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); $f = "$f"; $ncol = ($ncol + 1) % 2; $col = $COL[$ncol]; my $e = ($col eq "NONE" ? "" : ""). "" . "" . "". ""; $O .= $e . "\n"; } print $O; :>
File BytesTimestamp
".$f."    ".$S[7]."  ".sprintf("%"."02d-%"."s-%"."04d", $T[3], $moy[$T[4]], 1900+$T[5]) . "