#!/usr/local/bin/perl =pod Make list of pictures in directory. Copyright: Public Domain. Change: 2001-06-25 wakaba - In default, images are sized by stylesheet. When ?realsize=1, images are not specified its size. - Images are linked to itself. 2001-05-17 wakaba - New File. =cut #use Suika::CGI; unless ($main::ENV{PATH_TRANSLATED}) { die; #Suika::CGI::Error::die('open'); } my $dir = $main::ENV{PATH_TRANSLATED}; $dir =~ s#/LIST$##; opendir DIR, $dir or die; #Suika::CGI::Error::die('open', $dir); my @files = readdir(DIR); close DIR; for (@files) { undef $_ if /^\./; if (/(.+)\.(?:jpe?g|png)/i) { $_ = $1; } else {undef $_} } my $title = '²èÁü°ìÍ÷'; if (-e $dir.'/-TITLE') { open TITLE, $dir.'/-TITLE'; ($title) = ; close TITLE; } print STDOUT "Content-Type: text/html; charset=euc-jp\n\n"; #my $linkelement = '<link rel="stylesheet" href="/okuchuu/piclist-style" />' my $linkelement = '<style type="text/css">img.s {width: 240px; height: 180px}</style>' unless $Suika::CGI::param{realsize}; my $imgsattr = ' class="s"' unless $Suika::CGI::param{realsize}; $| = ''; print <<EOH; <html> <head> <title>${title} ${linkelement}

${title}

EOH for (sort @files) { if ($_) { print ''; print ''.$_.''; print "\n"; } } print <
[/]
EOH 1;