--- okuchuu/piclist.ja.cgi 2002/08/03 05:21:30 1.1 +++ okuchuu/piclist.ja.cgi 2002/08/27 08:49:22 1.2 @@ -1,89 +1,88 @@ -#!/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}) { - Suika::CGI::Error::die('open'); -} - -my $dir = $main::ENV{PATH_TRANSLATED}; -$dir =~ s#/LIST$##; - -opendir DIR, $dir or 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; - +#!/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}) { + Suika::CGI::Error::die('open'); +} + +my $dir = $main::ENV{PATH_TRANSLATED}; +$dir =~ s#/LIST$##; + +opendir DIR, $dir or 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; +